アプリケーションプログラミングインターフェースガイド> REST API> TDVサーバーREST API> Catalog API
 
<g1>Catalog(カタログ) API<x2/></g1>
Catalog REST APIを使用すると、仮想(公開済み)カタログを作成、削除、更新、および読み取ることができます。仮想カタログで実行できるオペレーションは次のとおりです。
GET/catalog
PUT/catalog
POST/catalog
DELETE/catalogs
DELETE/catalog
GET/catalog
このAPIは、仮想カタログの概要や詳細情報を取得するために使用されます。
パラメーター
名前
脱落
パラメータータイプ
データタイプ
path
仮想カタログパス
query
string
summary
仮想カタログの概要を取得する
query
boolean
仮想カタログ「/services/databases/publishedDB/cat1」の要約を取得する例
curl -X GET -u admin:admin "http://localhost:9400/rest/catalog/v1/virtual?path=%2Fservices%2Fdatabases%2FpublishedDB%2Fcat1&summary=true" -H "Content-Type:application/json"
仮想カタログ「/services/databases/publishedDB/cat1」に関する詳細情報を取得する例
curl -X GET -u admin:admin "http://localhost:9400/rest/catalog/v1/virtual?path=%2Fservices%2Fdatabases%2FpublishedDB%2Fcat1" -H "Content-Type:application/json"
PUT/catalog
このAPIは、仮想カタログを更新するために使用されます。
パラメーター
なし。
リクエスト本文
値の例-スキーマ
[
{
"path": "string",
"annotation": "string",
"newPath": "string",
"ifNotExists": true
}
]
アノテーションを更新し、公開されたカタログの名前を「/services/databases/publishedDB/cat1から/services/databases/ publicationdDB/cat2」に変更する例
curl -X PUT -u admin:admin "http://localhost:9400/rest/catalog/v1/virtual" -H "Content-Type:application/json" -d "[{\"path\":\"/services/databases/publishedDB/cat1\", \"annotation\":\"Edited published catalog created using REST api\", \"newPath\":\"/services/databases/publishedDB/cat2\" }]"
アノテーションを更新し、公開されたカタログ「/services/database/publishedDB/cat2を/services/database/ publicationDB1/cat2」に再配置する例
curl -X PUT -u admin:admin "http://localhost:9400/rest/catalog/v1/virtual" -H "Content-Type:application/json" -d "[{\"path\":\"/services/databases/publishedDB/cat2\"、\"annotation\":\"REST apiを使用して作成された編集済みの公開カタログ\"、\"newPath\":\"/services/database/publishedDB1/cat2\" }]"
公開されたカタログ「/services/databases/publishedDB/cat1」のアノテーションを設定解除する例
curl -X PUT -u admin:admin "http://localhost:9400/rest/catalog/v1/virtual" -H "Content-Type:application/json" -d "[{\"path\":\"/services/database/publishedDB/cat1\"、\"annotation\":\"null\"}]"
POST/catalog
このAPIは、仮想カタログを作成するために使用されます。
パラメーター
なし。
リクエスト本文
値の例-スキーマ
[
{
"path": "string",
"annotation": "string",
"newPath": "string",
"ifNotExists": true
}
]
仮想カタログ「/services/databases/publishedDB/cat1」を作成する例
curl -X POST -u admin:admin "http://localhost:9400/rest/catalog/v1/virtual" -H "Content-Type:application/json" -d "[{\"path\":\"/services/databases/publishedDB/cat1\", \"annotation\":\"This is a published catalog created using REST api\" }]"
「ifNotExists」構文を使用して仮想カタログ「/services/database/publishedDB/cat1」を作成する例
curl -X POST -u admin:admin "http://localhost:9400/rest/catalog/v1/virtual" -H "Content-Type:application/json" -d "[{\"path\":\"/services/databases/publishedDB/cat1\", \"ifNotExists\":true, \"annotation\":\"This is a published catalog created using REST api\" }]"
削除/catalog
このAPIは、仮想カタログを削除するために使用されます。
パラメーター
名前
脱落
パラメータータイプ
データタイプ
ifExists
カタログが存在する場合
query
boolean
リクエスト本文
値の例-スキーマ
[
"string"
]
仮想カタログ「/services/databases/publishedDB/cat1」および「/services/databases/publishedDB/cat2」を削除する例
サンプルCURL呼び出し
curl -X DELETE -u admin:admin "http://localhost:9400/rest/catalog/v1/virtual" -H "Content-Type:application/ json" -d "[\"/services/databases/publishedDB/cat1\", \"/services/databases/ publishedDB/cat2\"]"
ifExistsを使用したサンプルCURL呼び出し
curl -X DELETE -u admin:admin "http://localhost:9400/rest/catalog/v1/virtual?ifExists=true" -H "Content-Type:application/json" -d "[\"/shared/examples/publishedDB/cat2\"]"
削除/catalog
このAPIは、特定の仮想カタログを削除するために使用されます。
パラメーター
名前
脱落
パラメータータイプ
データタイプ
ifExists
カタログが存在する場合
query
boolean
リクエスト本文
値の例-スキーマ
[
"string"
]
仮想カタログを削除する例
curl -X DELETE -u admin:admin "http://localhost:9400/rest/catalog/v1/virtual/{catalogPath}?ifExists=true" -H "Content-Type: application/json"
curl -X DELETE -u admin:admin "http://localhost:9400/rest/catalog/v1/virtual/%2Fservices%2Fdatabases%2Fpubdb%2Fcatalog1?ifExists=true" -H "Content-Type:application/json"