アプリケーションプログラミングインターフェースガイド> REST API> TDVサーバーREST API> Link API
 
Link(リンク) API
リンク REST APIは、複数の仮想テーブル/プロシージャを作成、変更、または削除し、仮想テーブル/プロシージャを読み取る機能を提供します。
GET/link
PUT/link
POST/link
DELETE/link
DELETE/link/{linkPath}
GET/link
このAPIは、仮想テーブルまたはプロシージャの要約および/または詳細情報を取得するために使用されます。
パラメーター:
名前
説明
パラメータータイプ
データタイプ
path
仮想テーブルまたはプロシージャパス
query
string
summary
仮想テーブルまたはプロシージャの概要をフェッチする
query
boolean
公開されたテーブル「/services/databases/ publicationDB/pubTable」の概要を取得する例
curl -X GET -u admin:admin "http://localhost:9400/rest/link/v1?path=%2Fservices%2Fdatabases%2FpublishedDB%2FpubTable&summary=true" -H "Content-Type:application/json"
公開されたテーブル「/services/databases/publishedDB/pubTable」に関する詳細情報を取得する例
curl -X GET -u admin:admin "http://localhost:9400/rest/link/v1?path=%2Fservices%2Fdatabases%2FpublishedDB%2FpubTable" -H "Content-Type:application/json"
公開されたプロシージャ「/services/databases/publishedDB/pubProcedure」に関する詳細情報を取得する例
curl -X GET -u admin:admin "http://localhost:9400/rest/link/v1?path=%2Fservices%2Fdatabases%2FpublishedDB%2FpubProcedure" -H "Content-Type:application/json"
PUT/link
このAPIは、仮想テーブルまたはプロシージャを更新するために使用されます。
パラメーター:
なし。
リクエスト本文
値の例-スキーマ
[
“path”: "string",
“isTable”: true,
“targetPath”: “string”,
“annotation”: “string”,
“newPath”: “string”,
“ifNotExists”: true
]
アノテーションを更新し、公開されたテーブルの名前を「/services/databases/publishedDB/link1から/services/databases/ publicedDB/pubTable」に変更する例
curl -X PUT -u admin:admin "http://localhost:9400/rest/link/v1" -H "Content-Type:application/json" -d "[{\"path\":\"/services/databases/publishedDB/link1\", \"isTable\" : true, \"annotation\":\"Edited published table created using REST api\", \"newPath\":\"/services/databases/publishedDB/pubTable\" }]"
アノテーションを更新し、公開されたプロシージャ「/services/databases/publishedDB/link2を/services/database/ publishedDB1/pubProcedure」に再配置する例
curl -X PUT -u admin:admin "http://localhost:9400/rest/link/v1" -H "Content-Type:application/json" -d "[{\"path\":\"/services/databases/publishedDB/link2\", \"isTable\" : false, \"annotation\":\"Edited published procedure created using REST api\", \"newPath\":\"/services/databases/publishedDB1/pubProcedure\" }]"
公開されたテーブル「/services/databases/ publicationDB/pubTable」のターゲットを更新する例
curl -X PUT -u admin:admin "http://localhost:9400/rest/link/v1" -H "Content-Type:application/json" -d "[{\"path\":\"/services/databases/publishedDB/pubTable\", \"isTable\" : true, \"annotation\":\"Edited target of published table created using REST api\", \"targetPath\":\"/shared/examples/ds_orders/tutorial/orderdetails\" }]"
公開されたテーブル「/services/databases/ publicationDB/pubTable」のアノテーションを設定解除する例
curl -X PUT -u admin:admin "http://localhost:9400/rest/link/v1" -H "Content-Type:application/json" -d "[{\"path\":\"/services/databases/publishedDB/pubTable\", \"isTable\" : true, \"annotation\":\"null\"}]"
POST/link
このAPIは、仮想テーブルまたはプロシージャを作成するために使用されます。
パラメーター:
なし。
リクエスト本文
値の例-スキーマ
[
"path": "string"、
"isTable":true、
"targetPath": "string"、
"annotation": "string"、
“ newPath”:“ string”、
“ ifNotExists”:true
]
仮想テーブル "/services/database/publishedDB/link1"を作成する例
curl -X POST -u admin:admin "http://localhost:9400/rest/link/v1" -H "Content-Type:application/json" -d "[{\"path\":\"/services/databases/publishedDB/link1\", \"isTable\":true, \"targetPath\" : \"/shared/examples/ds_orders/tutorial/orders\", \"annotation\":\"This is a published table created using REST api\" }]"
仮想プロシージャ「/services/databases/ publicationDB/link2」を作成する例
curl -X PUT -u admin:admin "http://localhost:9400/rest/link/v1" -H "Content-Type:application/json" -d "[{\"path\":\"/services/databases/publishedDB/link2\"、\"isTable\":false、\"annotation\":\"REST apiを使用して作成された編集済みの公開済みプロシージャ\"、\"newPath\":\"/services/databases/publishedDB1/pubProcedure\"}]"
公開されたテーブル「/services/databases/ publicationDB/pubTable」のターゲットを更新する例
curl -X POST -u admin:admin "http://localhost:9400/rest/link/v1" -H "Content-Type:application/json" -d "[{\"path\":\"/services/databases/publishedDB/link2\", \"isTable\":false, \"targetPath\" : \"/shared/examples/LookupProduct\", \"annotation\":\"This is a published procedure created using REST api\" }]"
「ifNotExists」構文を使用して仮想テーブル「/services/databases/publishedDB/link1」を作成する例
curl -X POST -u admin:admin "http://localhost:9400/rest/link/v1" -H "Content-Type:application/json" -d "[{\"path\":\"/services/databases/publishedDB/link1\", \"ifNotExists\":true, \"isTable\":true, \"targetPath\" : \"/shared/examples/ds_orders/tutorial/orders\", \"annotation\":\"This is a published table created using REST api\" }]"
DELETE/link
このAPIは、仮想テーブルまたはプロシージャを削除するために使用されます。
パラメーター:
なし。
リクエスト本文
値の例-スキーマ
[
“ path”: "string"、
“ isTable”:true
]
仮想テーブルとプロシージャ「/services/databases/ publishedDB/pubTable」と「/services/databases/ publicationDB/pubProcedure」を削除する例
curl -X DELETE -u admin:admin "http://localhost:9400/rest/link/v1" -H "Content-Type:application/json" -d "[{\"path\":\"/services/databases/publishedDB/pubTable\", \"isTable\":true}, {\"path\":\"/services/databases/publishedDB/pubProcedure\", \"isTable\":false}]"
「ifExists」を使用したサンプルCURL呼び出し:
curl -X DELETE -u admin:admin "http://localhost:9400/rest/link/v1?ifExists=true" -H "Content-Type:application/json" -d "[{\"path\":\"/services/databases/publishedDB/pubTable\", \"isTable\":true}, {\"path\":\"/services/databases/publishedDB/pubProcedure\", \"isTable\":false}]"
DELETE/link/{linkPath}
このAPIは、仮想テーブルまたはプロシージャを削除するために使用されます。
パラメーター:
 
名前
説明
パラメータータイプ
データタイプ
linkPath
仮想テーブルまたはプロシージャパス
query
string
isTable
リソースがテーブルであるかどうかを示すフラグ
query
boolean
ifExists
リソースが存在するかどうかを示すフラグ
query
boolean
仮想テーブルを削除する例
curl -X DELETE -u admin:admin "http://localhost:9400/rest/link/v1/{linkPath}?isTable=true&ifExists=true" -H "Content-Type: application/json"
「ifExists」を使用したサンプルCURL呼び出し:
curl -X DELETE -u admin:admin "http://localhost:9400/rest/link/v1/%2Fservices%2Fdatabases%2FpublishedDB%2FpubProcedure?isTable=false&ifExists=true" -H "Content-Type:application/json"