2.5.2 サービスの情報取得
機能
指定したサービスに関する情報を取得します。
実行権限
Adminロール,Developロール,Modifyロール,Submitロール
APIのバージョン
v1
リクエスト形式
GET http://host:port/Automation/version/objects/Services/id
ステータスコード
リクエストに対するレスポンスとして返却されるステータスコードを,次の表に示します。
ステータスコード |
メッセージ |
説明 |
---|---|---|
200 |
OK |
成功しました。 |
401 |
Unauthorized |
ログイン権限がありません。 |
404 |
Not found |
権限が不正です。または,リソースがありません。 |
412 |
Precondition failed |
サーバが利用できません。 |
500 |
Server-side error |
サーバ処理エラーが発生しました。 |
レスポンスのスキーマ
リクエストに対するレスポンスボディーの構造を次に示します。
{ "instanceID" : instance-id, "name" : "service-display-name", "description" : "description-text", "tags" : "tags" "serviceTemplateName" : "service-template-name" "createTime" : "created-date-and-time", "modifyTime" : "updated-date-and-time", "serviceState" : "service-state" "serviceGroupName" : "service-group-name", "iconURL" : "icon-URL", "vendorName" : "vendor-name", "version" : "version" "lastSubmitTime" : "last-submit-time", "favorite" : {true|false}, "failedCount" : failed-count, "completedCount" : completed-count, "lastFailedTime" : last-failed-time, "resetTime" : reset-time, "executedCount" : executed-count, "latest" : {true|false}, "imageURL" : "image-URL", "supportedScheduleType" : "supported-schedule-type", "submitCount" : submit-count, "serviceTemplateID" : service-template-id, "serviceGroupID" : service-group-id, "supportedActionType" : supported-action-type }
使用例
instanceID=2015のサービスに関する情報を取得する場合の使用例を示します。
リクエストヘッダー: GET /Automation/v1/objects/Services/2015 HTTP/1.1 Host: 10.196.184.238:22015 Accept: application/json Authorization: Basic c3lzdGVtOm1hbmFnZXI= User-Agent: useragent1 Accept-Language: ja レスポンスヘッダー: HTTP/1.1 200 OK Date: Mon, 14 Jul 2014 11:40:06 GMT Server: Cosminexus HTTP Server Access-Control-Expose-Headers: WWW-Authenticate WWW-Authenticate: HSSO 1aa95d66e62d885b5583da3620bd166fd3a3_Vlo8Y30JBWoKHUYTEXAMXx5iHgQ=_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 レスポンスボディー: { "instanceID" : 2015, "name" : "testService1", "description" : "description", "tags" : "", "serviceTemplateName" : "testService", "createTime" : "2014-07-14T01:16:11.000-0700", "modifyTime" : "2014-07-14T04:36:30.000-0700", "serviceState" : "release", "serviceGroupName" : "DefaultServiceGroup", "iconURL" : "http://10.196.184.238:22015/Automation/icon/services/com.hitachi.software/remoteCommandExe/01.20.00", "vendorName" : "Hitachi,Ltd.", "version" : "01.20.00", "lastSubmitTime" : "2014-07-14T01:16:11.000-0700", "favorite" : false, "failedCount" : 0, "completedCount" : 0, "executedCount" : 0, "latest" : true, "supportedScheduleType" : "immediate,schedule,recurrence", "submitCount" : 0, "serviceTemplateID" : 5106, "serviceGroupID" : 3, "supportedActionType" : "forciblyStop,retry" }