Hitachi

JP1 Version 12 JP1/Operations Analytics REST API Reference Guide


2.10.9 Allocating Consumer

This API assigns the specified consumer to monitoring targets.

Execution permission

Admin, Modify

API version

v1

Request format

POST http[s]://host:port/Analytics/version/objects/Groups/{id}/actions/updateTargetResource/invoke

Request body

The structure of the request body and the object attributes are as follows:
{
        "name":"...",
        "href":"...",
        "method":"...",
        "type":"...",
        "parameters":[{
            "volumeIDs":["...", ...],
            "vmIDs":["...", ...],
            "resourceIDs":["...", ...]
        },
        :
        ]
}

Action (Type: Action)

Attribute

Type

Description

name

string

Name of the execute an operation.

href

string

URL of the execute an operation.

method

string

Name of the method.

type

string

Data format of the object.

parameters

UpdateTargetResourceParam[]

A list of UpdateTargetResourceParam objects necessary to execute an operation. For details about UpdateTargetResourceParam, see the table below.

parameters (Type: UpdateTargetResourceParam)

Attribute

Type

Description

volumeIDs

long[]

Specify IDs for identifying volumes to which the consumer is to be assigned. To assign the consumer to multiple volumes, specify the IDs concurrently. The IDs of monitoring targets to which the consumer has already been assigned also need to be set.

"volumeIDs" : [ 81, 87 ]

To release the assignment of all the volumes, set the member value to a blank.

"volumeIDs" : [ ]

vmIDs

long[]

Specify IDs for identifying virtual machines to which the consumer is to be assigned. To assign the consumer to multiple virtual machines, specify the IDs concurrently. The IDs of monitoring targets to which the consumer has already been assigned also need to be set.

" vmIDs " : [ 81, 87 ]

To release the assignment of all the virtual machines, set the member value to a blank.

" vmIDs " : [ ]

resourceIDs

long[]

Specify IDs for identifying hosts to which the consumer is to be assigned. To assign the consumer to multiple hosts, specify the IDs concurrently. The IDs of monitoring targets to which the consumer has already been assigned also need to be set.

" resourceIDs " : [ 81, 87 ]

To release the assignment of all the hosts, set the member value to a blank.

" resourceIDs " : [ ]

Response body

The structure of the response body and the object attributes are as follows:
{
        "instanceID":"...",
        "created":"...",
        "updated":"...",
        "completed":"...",
        "state":"...",
        "affectedResource":["...", ...],
        "result":["...", ...]
}

Job (Type: Job)

Attribute

Type

Description

instanceID

string

Indicates the ID of the Instance.

created

string

Indicates the date the object is generated in ISO 8601 format.

updated

string

Indicates the time the object is updated in ISO 8601 format. The same value as for "created" is set.

completed

string

Indicates the time the processing completed in ISO 8601 format. The same value as for "created" is set.

state

string

One of the following values is set:

"failed": The operation did not terminate normally.

"success": The operation terminated normally.

affectedResource

string[]

Indicates the URL of the API resource created or updated as a result of the operation. If no resources exist, this parameter is empty.

result

anyType[]

A list of objects. No value is set.

Status codes

Status code

Reason phrase

Description

200

OK

Success.

400

Bad Request

A format of request body is invalid.

401

Unauthorized

No login privilege.

403

Forbidden

No update privilege.

404

Not Found

The resource was not found.

412

Precondition Failed

The server is not available.

500

Internal Server Error

Server processing error.

Example code

[Request Header]
POST /Analytics/v1/objects/Groups/10/actions/updateTargetResource/invoke HTTP/1.1
Authorization: Basic c3lzdGVtOm1hbmFnZXI=
User-Agent: curl/7.33.0
Host: localhost:22015
Accept: application/json
Content-Type: application/json
Accept-Language: ja
Content-Length: 288


[Request Body]
{
  "name" : "updateTargetResource",
  "href" : "http://localhost:22015/Analytics/v1/objects/Groups/10/actions/updateTargetResource/invoke",
  "method" : "POST",
  "type" : "application/json",
  "parameters" : [ {
    "volumeIDs" : [ 534 ],
    "vmIDs" : [ 97, 31 ],
    "resourceIDs" : [ ]
  } ]
}


[Response Header]
HTTP/1.1 200 OK
Date: Fri, 27 Nov 2015 09:11:06 GMT
Server: Cosminexus HTTP Server
Cache-Control: no-cache
WWW-Authenticate: HSSO 154d18c71a465150d5e228e8f16bf42c4dd280_WVlGcHsLfg5ffg0I_V0810
X-Frame-Options: SAMEORIGIN
Transfer-Encoding: chunked
Content-Type: application/json


[Response Body]
{
  "instanceID" : "e89f633c-700d-4e75-9f81-d2d59c95a7bf",
  "created" : "2015-11-27T18:11:06.679+09:00",
  "updated" : "2015-11-27T18:11:07.023+09:00",
  "completed" : "2015-11-27T18:11:07.023+09:00",
  "state" : "success",
  "affectedResource" : [ ],
  "result" : [ ]
}