アプリケーションプログラミングインターフェースガイド> REST API> TDVサーバーREST API> Folder API
 
Folder(フォルダー)API
フォルダーAPIは、複数のフォルダを作成、変更、または削除し、フォルダを読み取る機能を提供します。
GET/folder
PUT/folder
POST/folder
DELETE/folder
DELETE/folder/{folderPath}
GET/フォルダ
このAPIは、フォルダーを取得するために使用されます。
パラメーター:
名前
説明
パラメータータイプ
データタイプ
path
フォルダパス
query
string
summary
フォルダの概要を取得
query
boolean
フォルダ「/shared/examples/folder1」の概要を取得する例
curl -X GET -u admin:admin "http://localhost:9400/rest/folder/v1?path=%2Fshared%2Fexamples%2Ffolder1&summary=true" -H "Content-Type:application/json"
フォルダ「/shared/examples/folder1」の概要と詳細情報を取得する例
curl -X GET -u admin:admin "http://localhost:9400/rest/folder/v1?path=%2Fshared%2Fexamples%2Ffolder1" -H "Content-Type:application/json"
PUT/folder
このAPIは、フォルダーを更新するために使用されます。
パラメーター:
なし。
リクエスト本文
値の例-スキーマ
[
{
"parentPath": "string",
"name": "string",
"properties": {
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
},
"annotation": "string",
"newPath": "string",
"ifNotExists": true
}
]
アノテーション「/shared/examples/folder1」を変更してフォルダを更新する例
curl -X PUT -u admin:admin "http://localhost:9400/rest/folder/v1" -H "Content-Type:application/json" -d "[{\"parentPath\":\"/shared/examples\", \"name\":\"folder1\", \"annotation\":\"Edited annotation of a folder created using REST api\" }]"
フォルダ「/shared/examples/folder1」の名前を「/shared/examples/folder2」に変更する例
curl -X PUT -u admin:admin "http://localhost:9400/rest/folder/v1" -H "Content-Type:application/json" -d "[{\"parentPath\":\"/shared/examples\", \"name\":\"folder1\", \"newPath\":\"/shared/examples/folder2\" }]"
フォルダ「/shared/examples/folder1」を「/users/Composite/admin/folder2」に再配置して名前を変更する例
curl -X PUT -u admin:admin "http://localhost:9400/rest/folder/v1" -H "Content-Type:application/json" -d "[{\"parentPath\":\"/shared/examples\", \"name\":\"folder1\", \"newPath\":\"/users/composite/admin/folder2\" }]"
フォルダ「/shared/examples/folder1」の注釈を設定解除する例
curl -X PUT -u admin:admin "http://localhost:9400/rest/folder/v1" -H "Content-Type:application/json" -d "[{\"parentPath\":\"/shared/examples\", \"name\":\"folder1\", \"annotation\":\"null\" }]"
POST/フォルダ
このAPIは、指定されたパスを使用してフォルダーを作成するために使用されます。
パラメーター:
なし。
リクエスト本文
値の例-スキーマ
[
{
"parentPath": "string",
"name": "string",
"properties": {
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
},
"annotation": "string",
"newPath": "string",
"ifNotExists": true
}
]
フォルダ「/shared/examples/folder1」を作成する例
curl -X POST -u admin:admin "http://localhost:9400/rest/folder/v1" -H "Content-Type:application/json" -d "[{\"parentPath\":\"/shared/examples\", \"name\":\"folder1\", \"annotation\":\"This folder is created using REST api\"}]"
「ifNotExists」構文でフォルダ「/shared/examples/folder1」を作成する例
curl -X POST -u admin:admin "http://localhost:9400/rest/folder/v1" -H "Content-Type:application/json" -d "[{\"parentPath\":\"/shared/examples\", \"name\" : \"folder1\", \"ifNotExists\":true, \"annotation\":\"This is a folder created using REST api\" }]"
削除/フォルダ
このAPIは、フォルダーを削除するために使用されます。
パラメーター:
 
名前
説明
パラメータータイプ
データタイプ
ifExists
フォルダが存在するかどうかを示すフラグ
query
boolean
リクエスト本文
値の例-スキーマ
[
"string"
]
フォルダ「/shared/examples/folder1」を削除する例
curl -X DELETE -u admin:admin "http://localhost:9400/rest/folder/v1" -H "Content-Type:application/json" -d "[\"/shared/examples/folder1\"]"
「ifExists」を使用したサンプルCURL呼び出し:
curl -X DELETE -u admin:admin "http://localhost:9400/rest/folder/v1" -H "Content-Type:application/json" -d "[\"/shared/examples/folder1\"]"
DELETE/folder/{folderPath}
このAPIは、パス内のフォルダーを削除するために使用されます。フォルダを削除します。オプションで「存在する場合」を指定します。
パラメーター:
 
名前
説明
パラメータータイプ
データタイプ
folderPath
フォルダのパス
query
string
ifExists
フォルダが存在するかどうかを示すフラグ
query
boolean
フォルダを削除する例
curl -X DELETE -u admin:admin "http://localhost:9400/rest/folder/v1/{folderPath}?ifExists=true" -H "Content-Type: application/json"
「ifExists」を使用したサンプルCURL呼び出し:
curl -X DELETE -u admin:admin "http://localhost:9400/rest/folder/v1/%2Fshared%2Fexamples%2Ffolder1?ifExists=true" -H "Content-Type:application/json"