Hitachi

JP1 Version 12 JP1/Automatic Operation Command and API Reference 


2.11.2 Acquisition of a list of tags

Function

Acquires a list of tags that are set for the specified resource.

Execution permissions

Admin role, Develop role, Modify role, Submit role

API version

v1

Request format

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

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

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

Query parameter

Filter condition

detail

Acquires details of tags.

resourceType#1

ServiceTemplate

Equal to the specified value

Service

Task

TaskHistory

#1

If you specify resourceType, query parameters and HQL::filter are valid for the resource specified for resourceType.

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.

401

Unauthorized

The user does not have login permission.

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-tag-functionality-(Tags)" : 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 tags.

Request header:

GET /Automation/v1/objects/Tags 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: Fri, 07 Aug 2015 03:38:52 GMT
Server: Cosminexus HTTP Server
Access-Control-Expose-Headers: WWW-Authenticate
WWW-Authenticate: HSSO d2729dff1c31a47ed713d92612eec93fe7919c8_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" : 35,
    "name" : "Replicate Storage",
    "tagGroupID" : 45
  }, {
    "instanceID" : 36,
    "name" : "SQL Server",
    "tagGroupID" : 34
  }, {
    "instanceID" : 37,
    "name" : "Add Like Storage",
    "tagGroupID" : 45
  }, {
    "instanceID" : 38,
    "name" : "Snapshot",
    "tagGroupID" : 45
  }, {
    "instanceID" : 39,
    "name" : "Add New Storage",
    "tagGroupID" : 45
  }, {
    "instanceID" : 40,
    "name" : "VMware vSphere",
    "tagGroupID" : 42
  }, {
    "instanceID" : 41,
    "name" : "XenDesktop",
    "tagGroupID" : 34
  }, {
    "instanceID" : 43,
    "name" : "Hyper-V",
    "tagGroupID" : 42
  }, {
    "instanceID" : 44,
    "name" : "Oracle Database",
    "tagGroupID" : 34
  }, {
    "instanceID" : 46,
    "name" : "Cluster",
    "tagGroupID" : 34
  }, {
    "instanceID" : 47,
    "name" : "Exchange",
    "tagGroupID" : 34
  }, {
    "instanceID" : 51,
    "name" : "Basic",
    "tagGroupID" : 54
  }, {
    "instanceID" : 52,
    "name" : "Hitachi",
    "tagGroupID" : 54
  }, {
    "instanceID" : 552,
    "name" : "Windows",
    "tagGroupID" : 54
  }, {
    "instanceID" : 559,
    "name" : "Linux",
    "tagGroupID" : 54
  }, {
    "instanceID" : 564,
    "name" : "Execute Script",
    "tagGroupID" : 54
  }, {
    "instanceID" : 1004,
    "name" : "Report Volume Information to Replication Manager",
    "tagGroupID" : 54
  } ],
  "count" : 17
}