HTTPSを介したVeridata REST APIへのアクセス

SSL対応のVeridataサーバーに対してcURLコマンドを設定および実行するステップ:

  1. veridata_installation_directory/configに移動し、vdtWebKeystore.p12ファイルがこのディレクトリに存在することを確認します。
  2. 次のコマンドを実行します。
    1. openssl pkcs12 -in vdtWebKeystore.p12 -nocerts -out server-key.pem
    2. openssl pkcs12 -in vdtWebKeystore.p12 -clcerts -nokeys -out server-cert.pem
  3. APIにアクセスするためのトークンを生成するには、ステップ2で生成された証明書のパスを指定し、次のコマンドを実行します:
    curl --cacert <path>/server-cert.pem https://localhost:8831/veridata/v1/auth/login -v --digest -u veridata:Welcome@123
  4. APIを実行するには、ステップ3で取得したトークンを使用して次のコマンドを実行します:
    curl --cacert <path>/server-cert.pem --location --request GET 'https://localhost:8831/veridata/v1/services/configuration/profiles' --header 'Authorization: Bearer {{token}}'

SSL対応のサーバーへのすべてのcURLリクエストでは、--cacert <path>を渡す必要があります。

例:

接続の作成
curl --cacert <path>/server-cert.pem --location  --request POST 'http://localhost:8831/veridata/v1/services/configuration/connections' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{token}}' \
--data '{
    "name": "JCT-D1",
    "host": "100.11.11.237",
    "port": "7890",
    "dbType": "ORACLE",
    "ssl": "false",
    "username": "ordsuser",
    "password": "oracle"
}'

接続の取得

curl --cacert <path>/server-cert.pem --location --request GET 'http://localhost:8831/veridata/v1/services/configuration/connections/1035' \
--header 'Authorization: Bearer {{token}}'