2.4.1 サービステンプレート一覧の取得
機能
JP1/AOに登録されているサービステンプレートの一覧を取得します。
実行権限
Adminロール,Developロール,Modifyロール
APIのバージョン
v1
リクエスト形式
GET http://host:port/Automation/version/objects/ServiceTemplates
APIの実行ユーザーが権限を持つ,すべてのサービステンプレートを対象として一覧を取得します。クエリパラメータを指定すると,一覧を取得する対象を絞り込めます。クエリパラメータは,次の形式で指定してください。
?クエリパラメータ=値[&クエリパラメータ=値...]
クエリパラメータ |
フィルタ条件 |
|---|---|
tags |
値をすべて含んでいるか。「,」区切りで複数指定できる。 |
q |
次に示す検索対象のスキーマに対して,値を含んでいるか全文検索する。
半角スペース区切りで複数指定した場合,値をすべて含んでいるか全文検索する。大文字・小文字を区別しない。 |
usingServiceTemplateID |
指定した値を含むサービス部品。 |
vendorID |
指定した値に等しい。大文字・小文字を区別しない。 |
keyName |
|
version |
そのほかに指定できるクエリパラメータについては,「2.2.9 クエリパラメータ」を参照してください。
ステータスコード
リクエストに対するレスポンスとして返却されるステータスコードを,次の表に示します。
ステータスコード |
メッセージ |
説明 |
|---|---|---|
200 |
OK |
成功しました。 |
400 |
Bad Request |
クエリパラメータが不正です。 |
401 |
Unauthorized |
ログイン権限がありません。 |
403 |
Forbidden |
サービステンプレート取得の権限がありません。 |
412 |
Precondition failed |
サーバが利用できません。 |
500 |
Server-side error |
サーバ処理エラーが発生しました。 |
レスポンスのスキーマ
レスポンスボディーには,リクエストで指定したクエリパラメータの条件に合致したデータが返却されます。レスポンスボディーのスキーマを次に示します。
{
"data" : [ {"サービステンプレート機能のリソース(ServiceTemplates)のメンバー" : 値 ... }, ... ],
"count" : クエリパラメータの条件に合致したデータの個数(0~n)
}
使用例
すべてのサービステンプレートを対象として,サービステンプレート一覧を取得する場合の使用例を示します。
リクエストヘッダー:
GET /Automation/v1/objects/ServiceTemplates HTTP/1.1
Authorization: Basic c3lzdGVtOm1hbmFnZXI=
User-Agent: curl/7.36.0
Host: 10.196.184.182:22015
Accept: application/json
Accept-Language: ja
レスポンスヘッダー:
HTTP/1.1 200 OK
Date: Thu, 30 Jul 2015 00:34:32 GMT
Server: Cosminexus HTTP Server
Access-Control-Expose-Headers: WWW-Authenticate
WWW-Authenticate: HSSO 998ebb201be1cf76e7491a1380c4c54d5a59b7_Vlo8Y30JdDBUB3ljJSVPaRtjBSA=_V0810
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, DELETE, PUT, HEAD, OPTIONS
Access-Control-Allow-Credentials: true
Cache-Control: no-cache
Transfer-Encoding: chunked
Content-Type: application/json
レスポンスボディー:
{
"data" : [ {
"instanceID" : 560,
"keyName" : "remoteCommandExe",
"displayName" : "Execute Remote Command",
"iconURL" : "http://10.196.184.182:22015/Automation/icon/services/com.hitachi.software.dna.cts/remoteCommandExe/01.20.00",
"vendorID" : "Hitachi,Ltd.",
"version" : "01.20.00",
"vendorName" : "Hitachi,Ltd.",
"tags" : "Execute Script,Linux,Windows",
"createTime" : "2015-07-29T15:27:02.000+09:00",
"modifyTime" : "2015-07-29T15:27:02.000+09:00",
"description" : "Executes a command on the remote execution target server.",
"releaseState" : "release",
"latest" : true,
"supportedScheduleType" : "immediate,schedule,recurrence",
"needVUP" : false,
"componentOutdated" : false,
"usedServices" : 0,
"usedTemplates" : 0,
"supportedActionType" : "forciblyStop,retry"
}, {
"instanceID" : 1116,
"keyName" : "SP_GenericApplication",
"displayName" : "Allocate Volumes for Generic Application",
"iconURL" : "http://10.196.184.182:22015/Automation/icon/services/com.hitachi.software.dna.cts/SP_GenericApplication/01.20.00",
"vendorID" : "Hitachi,Ltd.",
"version" : "01.20.00",
"vendorName" : "Hitachi, Ltd.",
"tags" : "Add New Storage",
"createTime" : "2015-07-29T16:48:25.000+09:00",
"modifyTime" : "2015-07-29T16:48:25.000+09:00",
"description" : "Intelligent allocation service that uses sets of volumes from the associated infrastructure group to be consumed by server(s) running a generic application",
"releaseState" : "release",
"latest" : true,
"imageURL" : "http://10.196.184.182:22015/Automation/services/custom/000000000001116/SP_GenericApplication_overview.png",
"supportedScheduleType" : "immediate,schedule",
"needVUP" : false,
"componentOutdated" : false,
"usedServices" : 0,
"usedTemplates" : 0,
"supportedActionType" : "forciblyStop,retry"
} ],
"count" : 2
}