アプリケーションプログラミングインターフェースガイド> REST API> TDVサーバーREST API> Dataview API
 
Dataview(データビュー)API
データビューAPIは、データビューを作成、変更、削除、および読み取る機能を提供します。次のオペレーションを実行できます。
GET/dataview
PUT/dataview
POST/dataview
DELETE/dataview
DELETE/dataview/{dataviewPath}
GET/dataview
このAPIは、データビューの概要や詳細情報を取得するために使用されます。
パラメーター:
名前
説明
パラメータータイプ
データタイプ
path
データビューパス
query
string
summary
データビューの概要を取得
query
boolean
データビューの概要を取得する例「/shared/examples/sampleView」
curl -X GET -u admin:admin "http://localhost:9400/rest/dataview/v1?path=%2Fshared%2Fexamples%2FsampleView&summary=true" -H "Content-Type:application/json"
データビュー「/shared/examples/sampleView」の詳細情報を取得する例
curl -X GET -u admin:admin "http://localhost:9400/rest/dataview/v1?path=%2Fshared%2Fexamples%2FsampleView" -H "Content-Type:application/json"
PUT/dataview
このAPIは、データビューを更新するために使用されます。
パラメーター:
なし
リクエスト本文
値の例-スキーマ
[
{
"parentPath": "string",
"name": "string",
"sql": "string",
"annotation": "string",
"newPath": "string",
"ifNotExists": true,
"properties": {
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
}
}
]
データビュー「/shared/examples/ sampleView」のsqlとアノテーションを更新する例
curl -X PUT -u admin:admin "http://localhost:9400/rest/dataview/v1" -H "Content-Type:application/json" -d "[{\"parentPath\":\"/shared/examples\", \"name\":\"sampleView\", \"sql\":\"SELECT OrderID,CompanyName FROM /shared/examples/ViewOrder\", \"annotation\":\"Edited annotation of a data view created using REST api\" }]"
データビュー「/shared/examples/sampleView」のアノテーションを設定解除する例
curl -X PUT -u admin:admin "http://localhost:9400/rest/dataview/v1" -H "Content-Type:application/json" -d "[{\"parentPath\":\"/shared/examples\", \"name\":\"sampleView\", \"annotation\":\"null\" }]"
POST/dataview
このAPIは、指定された定義sqlを使用してデータビューを作成します。
パラメーター:
なし
リクエスト本文
値の例-スキーマ
[
{
"parentPath": "string",
"name": "string",
"sql": "string",
"annotation": "string",
"newPath": "string",
"ifNotExists": true,
"properties": {
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
}
}
]
データビュー「/shared/examples/sampleView」を作成する例
curl -X POST -u admin:admin "http://localhost:9400/rest/dataview/v1" -H "Content-Type:application/json" -d "[{\"parentPath\":\"/shared/examples\", \"name\":\"sampleView\", \"sql\":\"SELECT OrderID FROM /shared/examples/ViewOrder\", \"annotation\":\"This view is created using REST api\"}]"
「ifNotExists」構文を使用してデータビュー「/shared/examples/dataview1」を作成する例
curl -X POST -u admin:admin "http://localhost:9400/rest/dataview/v1" -H "Content-Type:application/json" -d "[{\"parentPath\":\"/shared/examples\", \"name\" : \"dataview1\", \"ifNotExists\":true, \"annotation\":\"This is a data view created using REST api\" }]"
DELETE/dataview
このAPIは、データビューを削除するために使用されます。
パラメーター:
名前
説明
パラメータータイプ
データタイプ
ifExists
データビューが存在するかどうかを示すフラグ。
query
boolean
リクエスト本文
値の例-スキーマ
[
"string"
]
データビュー「/shared/examples/sampleView」を削除する例
curl -X DELETE -u admin:admin "http://localhost:9400/rest/dataview/v1" -H "Content-Type:application/json" -d "[\"/shared/examples/sampleView\"]"
「ifExists」を使用したサンプルCURL呼び出し
curl -X DELETE -u admin:admin "http://localhost:9400/rest/dataview/v1?ifExists=true" -H "Content-Type:application/json" -d "[\"/shared/examples/sampleView\"]"
DELETE/dataview/{dataviewPath}
このAPIは、データビューを削除するために使用されます。オプションで「存在する場合」を指定します。
パラメーター:
名前
説明
パラメータータイプ
データタイプ
dataViewPath
データビューのパス
query
string
ifExists
データビューが存在するかどうかを示すフラグ
query
boolean
データビューを削除する例
curl -X DELETE -u admin:admin "http://localhost:9400/rest/dataview/v1/{dataViewPath}?ifExists=true" -H "Content-Type: application/json"
「ifExists」を使用したサンプルCURL呼び出し
curl -X DELETE -u admin:admin "http://localhost:9400/rest/dataview/v1/%2Fshared%2Fexamples%2Fdataview1?ifExists=true" -H "Content-Type:application/json"