4.12.1 グラフ・シェルによる接続

リモート・グラフ・サーバー(PGX)インスタンスに接続する最も簡単な方法は、次のように、サーバーのベースURLをグラフ・サーバー(PGX)認証に必要なデータベース・ユーザー名とともに指定することです。

cd $PGX_HOME
./bin/opg4j --base_url https://<host>:<port> --username <graphuser>
説明:
  • <host>: サーバー・ホスト名
  • <port>: サーバー・ポート
  • <graphuser>: データベース・ユーザー

    ノート:

    データベース・パスワードの入力を要求されます。

    詳細は、ユーザーの認証および認可を参照してください。

ただし、インメモリー・グラフ・サーバー(PGX)は、現在、管理APIのリモート・サポートを提供していません。

HTTPリクエストのロギングについて

グラフ・シェルでは、デフォルトでデバッグ・メッセージがすべて非表示になります。どのHTTPリクエストが実行されたかを確認するには、この例に示すように、oracle.pgxのログ・レベルをDEBUGに設定します。

ノート:

これらのログを有効にすると、パスワードなどの機密情報が画面に出力されます。
opg4j> loglevel("oracle.pgx","DEBUG")
===> Log level of oracle.pgx logger set to DEBUG
opg4j> session.readGraphWithProperties("bank_graph_analytics.json", "bank_graph");
06:29:03,702 DEBUG CommonsVfsProvider - resolve bank_graph_analytics.json
06:29:03,702 DEBUG AbstractConfigFactory - parse graph config from bank_graph_analytics.json (parent: file:///opt/oracle/graph)
06:29:03,709 DEBUG RemoteUtils - create session cookie (session ID = f5d029d7-2924-4cd4-86a9-6999c1ce5e3f)
06:29:03,713 DEBUG RemoteUtils - no value for the sticky cookie given
06:29:03,713 DEBUG RemoteUtils - create csrf token cookie (token = 36acbee2-6b78-4c13-b114-41040809833a)
06:29:03,713 DEBUG HttpRequestExecutor - Requesting POST https://localhost:7007/core/v1/loadGraph HTTP/1.1 with payload {"graphConfig":"HRcBVFVcO0dfXU9bUEhGEEYOdkMUElZYRFpcZgBeDxBYCxFcRGY2c21wIBUBEElAW11HQV5vVhpYAFRIFAMbeC5+NithRx9EEkwUVRADRlFBXVhGFlBpT0ZfSEFpAlZBQ1RXG1kTKiEXSREVCUAWU1dmElJfRlxKa11GDBJdSV1EQwMPd1paVhZfFxYXSREIB1gBEggbMEVMXEpUUV9HQUgWSV1FFVBDV01QVg1uAApZEF4IRA9GdHdqMGhkdhseFklREBBdQ1lCCFZDaU9cSxdUGzpFF1wQD1EBQhADRnZOUVZHWllHQUgWQVdXBVBDURsDQkFSEQBUEVY5DVAdb19YFEdEXF4QDktVDxdRUBQUBVhZV1tYSgZuFwRXCVY5CFQJVRADRnVsfHJtcWlzJjdrbHViQxUPXVxAZhdIEwAXXxEKCVsDEh4bAlhfX1hGFhcWEQBWQEsUHGQBFE9cSxdUGzpFF1wQD1EBQkEbXmxWEFJXTXJXDAhBQFYUWxtkchsVGw1QDgAXXxEnBVYLRVxNFxUBEFVdVUldDQMWF0MUAktIV01cZghUGjpYBEMWD1sDEghNFkJITxUQUExAAgZVXl1pFVhPWlxmVwJcBkcPR3EnKH47fn19IWQPHhtZUVRrFx1ESBoMQ1BDQlxeXBETT0dTCkELB0FGChBLAFVAQRtPaQEWDQVZSBoMQ1tMWFJmXhFQEw1qBF0HCkwQWVFKRkotMjkyAElr0w==","graphName":"bank_graph","_csrf_token":"36acbee2-6b78-4c13-b114-41040809833a"}
06:29:03,788 DEBUG HttpRequestExecutor - received HTTP status 202
06:29:03,789 DEBUG HttpRequestExecutor - {"futureId":"7f7a2206-8881-4c1e-909f-6e8778be617c"}
06:29:03,789 DEBUG PgxRemoteFuture - Requesting GET https://localhost:7007/core/v1/futures/x-future-id/status HTTP/1.1
06:29:03,801 DEBUG PgxRemoteFuture - Requesting GET https://localhost:7007/core/v1/futures/x-future-id/value HTTP/1.1
06:29:03,831 DEBUG RemoteUtils - received HTTP status 201
06:29:03,831 DEBUG RemoteUtils - {"id":"8B473228-0751-49A9-A945-9A0E4011AB69","links":[{"href":"https://localhost:7007/core/v1/graphs/x-graph-id","rel":"self","method":"GET","interaction":["async-polling"]},{"href":"https://localhost:7007/core/v1/graphs/x-graph-id","rel":"canonical","method":"GET","interaction":["async-polling"]}],"graphName":"bank_graph","vertexTables":{"Accounts":{"name":"Accounts","metaData":{"name":"Accounts","idType":"integer","labels":["Accounts"],"properties":[],"edgeProviderNamesWhereSource":["Transfers"],"edgeProviderNamesWhereDestination":["Transfers"],"id":null,"links":null},"providerLabels":["Accounts"],"entityKeyType":"integer","isIdentityKeyMapping":false,"vertexProperties":{},"vertexLabels":{"id":"04156FFE-A3C1-4A6D-87E5-879A0895BBD4","links":[{"href":"https://localhost:7007/core/v1/graphs/x-graph-id/properties/x-property-name","rel":"self","method":"GET","interaction":["async-polling"]},{"href":"https://localhost:7007/core/v1/graphs/x-graph-id/properties/x-property-name","rel":"canonical","method":"GET","interaction":["async-polling"]}],"dimension":-1,"propertyId":"04156FFE-A3C1-4A6D-87E5-879A0895BBD4","name":"__vertex_labels__","entityType":"vertex","type":"ro_string_set","namespace":"2C17C639-3771-3E30-88AE-34D6B380C5EC","transient":false},"transient":false}},"edgeTables":{"Transfers":{"name":"Transfers","metaData":{"name":"Transfers","idType":"long","directed":true,"labels":["Transfers"],"properties":[{"name":"AMOUNT","id":null,"propertyType":"float","dimension":0,"transient":true,"links":null,"propertyId":"AF2A2D0A-9C8C-478F-BD74-3444A7DD7339"}],"sourceVertexProviderName":"Accounts","destinationVertexProviderName":"Accounts","id":null,"links":null},"providerLabels":["Transfers"],"entityKeyType":"long","isIdentityKeyMapping":true,"sourceVertexTableName":"Accounts","destinationVertexTableName":"Accounts","edgeProperties":{"4046D845-D0C6-4231-A69B-F69D4963CD91":{"id":"4046D845-D0C6-4231-A69B-F69D4963CD91","links":[{"href":"https://localhost:7007/core/v1/graphs/x-graph-id/properties/x-property-name","rel":"self","method":"GET","interaction":["async-polling"]},{"href":"https://localhost:7007/core/v1/graphs/x-graph-id/properties/x-property-name","rel":"canonical","method":"GET","interaction":["async-polling"]}],"dimension":0,"propertyId":"4046D845-D0C6-4231-A69B-F69D4963CD91","name":"AMOUNT","entityType":"edge","type":"float","namespace":"2C17C639-3771-3E30-88AE-34D6B380C5EC","transient":false}},"edgeLabel":{"id":"9763546A-1860-49A4-9292-77D2AA04F4BB","links
06:29:03,836 DEBUG PgxSession - engine reports latest snapshot is 621849 milli-seconds old. Max age is 0 milli-seconds
06:29:03,836 DEBUG PgxSession - ==> try to check out newer snapshot
06:29:03,836 DEBUG RemoteUtils - create session cookie (session ID = f5d029d7-2924-4cd4-86a9-6999c1ce5e3f)
06:29:03,836 DEBUG RemoteUtils - no value for the sticky cookie given
06:29:03,836 DEBUG RemoteUtils - create csrf token cookie (token = 36acbee2-6b78-4c13-b114-41040809833a)
06:29:03,836 DEBUG HttpRequestExecutor - Requesting POST https://localhost:7007/core/v1/graphs/x-graph-id/refresh HTTP/1.1 with payload {"blockIfFull":false,"_csrf_token":"36acbee2-6b78-4c13-b114-41040809833a"}
06:29:03,878 DEBUG HttpRequestExecutor - received HTTP status 202
06:29:03,878 DEBUG HttpRequestExecutor - {"futureId":"898d546e-583f-4d37-9ca9-d1e10134037f"}
06:29:04,135 DEBUG PgxRemoteFuture - Requesting GET https://localhost:7007/core/v1/futures/x-future-id/status HTTP/1.1
06:29:04,828 DEBUG PgxRemoteFuture - Requesting GET https://localhost:7007/core/v1/futures/x-future-id/value HTTP/1.1
06:29:04,858 DEBUG RemoteUtils - received HTTP status 201
06:29:04,859 DEBUG RemoteUtils - {"id":"BE960B34-E135-4CF8-AB2F-E1A6E2D7DB60","links":[{"href":"https://localhost:7007/core/v1/graphs/x-graph-id","rel":"self","method":"GET","interaction":["async-polling"]},{"href":"https://localhost:7007/core/v1/graphs/x-graph-id","rel":"canonical","method":"GET","interaction":["async-polling"]}],"graphName":"bank_graph","vertexTables":{"Accounts":{"name":"Accounts","metaData":{"name":"Accounts","idType":"integer","labels":["Accounts"],"properties":[],"edgeProviderNamesWhereSource":["Transfers"],"edgeProviderNamesWhereDestination":["Transfers"],"id":null,"links":null},"providerLabels":["Accounts"],"entityKeyType":"integer","isIdentityKeyMapping":false,"vertexProperties":{},"vertexLabels":{"id":"19D95502-40D5-47F2-9F45-B1CD09ECB989","links":[{"href":"https://localhost:7007/core/v1/graphs/x-graph-id/properties/x-property-name","rel":"self","method":"GET","interaction":["async-polling"]},{"href":"https://localhost:7007/core/v1/graphs/x-graph-id/properties/x-property-name","rel":"canonical","method":"GET","interaction":["async-polling"]}],"dimension":-1,"propertyId":"19D95502-40D5-47F2-9F45-B1CD09ECB989","name":"__vertex_labels__","entityType":"vertex","type":"ro_string_set","namespace":"2C17C639-3771-3E30-88AE-34D6B380C5EC","transient":false},"transient":false}},"edgeTables":{"Transfers":{"name":"Transfers","metaData":{"name":"Transfers","idType":"long","directed":true,"labels":["Transfers"],"properties":[{"name":"AMOUNT","id":null,"propertyType":"float","dimension":0,"transient":true,"links":null,"propertyId":"9A49BC0C-F8AA-465A-B8D6-CA5A92BAE2C9"}],"sourceVertexProviderName":"Accounts","destinationVertexProviderName":"Accounts","id":null,"links":null},"providerLabels":["Transfers"],"entityKeyType":"long","isIdentityKeyMapping":true,"sourceVertexTableName":"Accounts","destinationVertexTableName":"Accounts","edgeProperties":{"FED6FE43-D311-46B6-9A5A-E8DC0D7B56C6":{"id":"FED6FE43-D311-46B6-9A5A-E8DC0D7B56C6","links":[{"href":"https://localhost:7007/core/v1/graphs/x-graph-id/properties/x-property-name","rel":"self","method":"GET","interaction":["async-polling"]},{"href":"https://localhost:7007/core/v1/graphs/x-graph-id/properties/x-property-name","rel":"canonical","method":"GET","interaction":["async-polling"]}],"dimension":0,"propertyId":"FED6FE43-D311-46B6-9A5A-E8DC0D7B56C6","name":"AMOUNT","entityType":"edge","type":"float","namespace":"2C17C639-3771-3E30-88AE-34D6B380C5EC","transient":false}},"edgeLabel":{"id":"371D2AC6-4EC5-45AD-8885-B3590F56D944","links
$5 ==> PgxGraph[name=bank_graph,N=1000,E=5001,created=1621160944599]