Hitachi

JP1 Version 12 JP1/Automatic Operation Command and API Reference 


2.4.1 Acquisition of a list of service templates

Function

Acquires a list of service templates registered in JP1/AO.

Execution permissions

Admin role, Develop role, Modify role

API version

v1

Request format

GET http://host:port/Automation/version/objects/ServiceTemplates

This API function acquires a list of all service templates for which the user who executed the API function has permissions. By specifying query parameters, you can filter the service templates for which you want to acquire the list. Specify query parameters in the following format:

?query-parameter=value[&query-parameter=value...] 
Table 2‒46: List of query parameters that can be specified for the API function Acquisition of a list of service templates

Query parameter

Filter condition

tags

Whether all values are contained. You can specify multiple values by separating them with a comma (,).

q

For the following schema, a full-text search is performed to determine whether the specified value is contained:

  • keyName

  • displayName

  • vendorID

  • vendorName

  • tags

  • description

If you specify multiple values by separating them with a half-width space character, a full-text search is performed to determine whether all of the specified values are contained. This query parameter is not case sensitive.

usingServiceTemplateID

Service component containing the specified values

vendorID

Equal to the specified value. The query parameters are not case sensitive.

keyName

version

For details about other query parameters that can be specified, see 2.2.9 Query parameter.

Status code

The following table describes the various status codes that can be returned as the response to a request.

Status code

Message

Description

200

OK

Processing has been successfully completed.

400

Bad Request

A query parameter is invalid.

401

Unauthorized

The user does not have login permission.

403

Forbidden

The user does not have permission to acquire service templates.

412

Precondition failed

The server is not available.

500

Server-side error

A server processing error occurred.

Response schema

Data that matches the conditions specified by query parameters in a request is returned in the response body. The following shows the schema of the response body.

{
  "data" : [ {"member-of-the-resources-for-service-template-functionality(ServiceTemplates)" : value ... }, ... ],
  "count" : number-of-data-items-that-match-the-conditions-specified-by-query-parameters(0-to-n)
}

Usage example

In the following example, the API function acquires a list of all service templates.

Request header:

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

Response header:

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

Response body:

{
  "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
}