Hitachi

JP1 Version 12 JP1/Operations Analytics REST API Reference Guide


2.10.4 Creating consumer

This API creates a consumer.

Execution permission

Admin, Modify

API version

v1

Request format

POST http[s]://host:port/Analytics/version/objects/Groups

Request body

The structure of the request body and the object attributes are as follows:
{
        "name":"...",
        "gradeKey":"...",
        "description":"...",
        "urls":["...", ...],
        "urlDisplayNames":["...", ...],
        "templateCreatorType":"...",
        "vmAutoAssignment":"...",
        "applicationAssignFollow":"..."
}

Group (Type: Group)

Attribute

Type

Description

name

string

Consumer name. Use 128 or fewer characters.

gradeKey

string

ID for identifying grades

description

string

Description of the consumer. Use 1000 or fewer characters.

urls

string[]

URL

urlDisplayNames

string[]

Character string displayed for the URL

templateCreatorType

enum

Change type of the consumer.

(For details about the specifiable values, see the table TemplateCreatorType in List of enumerators.)

The specifiable values are as follows:

  • User
  • Default

vmAutoAssignment

boolean

Set true if you assign a virtual machine under the hypervisor that belong to this Group automatically

applicationAssignFollow

boolean

Set true if you assign a application under the resource that belong to this Group automatically

Response body

The structure of the response body and the object attributes are as follows:
{
        "instanceID":"...",
        "name":"...",
        "status":"...",
        "gradeKey":"...",
        "gradeName":"...",
        "gradeDisplayOrder":"...",
        "description":"...",
        "urls":["...", ...],
        "urlDisplayNames":["...", ...],
        "templateCreatorType":"...",
        "vmAutoAssignment":"...",
        "applicationAssignFollow":"...",
        "numOfVolumes":"...",
        "numOfVMs":"...",
        "numOfHosts":"...",
        "numOfHypervisors":"...",
        "numOfApplications":"...",
        "numOfPods":"...",
        "numOfInstances":"...",
        "vmAutoAssignFilters":["...", ...],
        "hostAutoAssignFilters":["...", ...],
        "podAutoAssignFilters":["...", ...],
        "instanceAutoAssignFilters":["...", ...]
}

Group (Type: Group)

Attribute

Type

Description

instanceID

long

ID for identifying instances

name

string

Consumer name. Use 128 or fewer characters.

status

enum

Status of the consumer.

(For details about the specifiable values, see the table NodeStatusType in List of enumerators.)

The specifiable values are as follows:

  • Normal
  • Warning
  • Error

gradeKey

string

ID for identifying grades

gradeName

string

Grade name

gradeDisplayOrder

integer

Priority of the grade

description

string

Description of the consumer. Use 1000 or fewer characters.

urls

string[]

URL

urlDisplayNames

string[]

Character string displayed for the URL

templateCreatorType

enum

Change type of the consumer.

(For details about the specifiable values, see the table TemplateCreatorType in List of enumerators.)

The specifiable values are as follows:

  • User
  • Default

vmAutoAssignment

boolean

Set true if you assign a virtual machine under the hypervisor that belong to this Group automatically

applicationAssignFollow

boolean

Set true if you assign a application under the resource that belong to this Group automatically

numOfVolumes

integer

Number of volumes to which the consumer is assigned.

numOfVMs

integer

Number of virtual machines to which the consumer is assigned.

numOfHosts

integer

Number of hosts to which the consumer is assigned.

numOfHypervisors

integer

Number of hypervisors to which the consumer is assigned.

numOfApplications

integer

Number of applications to which the consumer is assigned.

numOfPods

integer

Number of pods to which the consumer is assigned.

numOfInstances

integer

Number of instances to which the consumer is assigned.

vmAutoAssignFilters

string[]

Name of the automatic assignment rule set for the virtual machines

hostAutoAssignFilters

string[]

Name of the automatic assignment rule set for the hosts

podAutoAssignFilters

string[]

Name of the automatic assignment rule set for the pods

instanceAutoAssignFilters

string[]

Name of the automatic assignment rule set for the instances

Status codes

Status code

Reason phrase

Description

201

Created

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 grade is invalid.

409

Conflict

A resource with the same name exists.

412

Precondition Failed

The server is not available.

500

Internal Server Error

Server processing error.

Example code

[Request Header]
POST /Analytics/v1/objects/Groups HTTP/1.1
Host: JP1OAServer:22015
User-Agent: curl/7.63.0
Accept: application/json
Accept-Language: ja
Content-Type: application/json
Authorization: Basic c3lzdGVtOm1hbmFnZXI=
Content-Length: 380

[Request Body]
{
  "name": "A Systems Monitoring Team",
  "gradeKey":"0",
  "description": "Company: A Systems , Monitoring Team\nSystem: monitoring system\nTel: xxx-xxx-xxx-xxx-xxx\nAddress:xxx-xxx-xxx-xxx-xxx\n",
  "urls": ["https://monitoring-system-url"],
  "urlDisplayNames": ["monitoring dashboard"],
  "templateCreatorType": "User",
  "vmAutoAssignment": true,
  "applicationAssignFollow": false
}

[Response Header]
HTTP/1.1 201 Created
Date: Mon, 09 Sep 2019 05:22:34 GMT
Server: Cosminexus HTTP Server
Cache-Control: no-cache
WWW-Authenticate: HSSO eab046278b6ebb7b2c1744afbb58e1984492939_ZAlDSFUHGHp9UB8WcRQLdA==_V0810
Location: http://JP1OAServer:22015/Analytics/v1/objects/Groups/162
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block 
X-Content-Type-Options: nosniff
Transfer-Encoding: chunked
Content-Type: application/json

[Response Body]
{
  "instanceID" : 162,
  "name" : "A Systems Monitoring Team",
  "status" : "Normal",
  "gradeKey" : "0",
  "gradeName" : "Platinum",
  "gradeDisplayOrder" : 0,
  "description" : "Company: A Systems , Monitoring Team\nSystem: monitoring system\nTel: xxx-xxx-xxx-xxx-xxx\nAddress:xxx-xxx-xxx-xxx-xxx\n",
  "urls" : [ "https://monitoring-system-url" ],
  "urlDisplayNames" : [ "monitoring dashboard" ],
  "templateCreatorType" : "User",
  "vmAutoAssignment" : true,
  "applicationAssignFollow" : false,
  "numOfVolumes" : 0,
  "numOfVMs" : 0,
  "numOfHosts" : 0,
  "numOfHypervisors" : 0,
  "numOfApplications" : 0,
  "numOfPods" : 0,
  "numOfInstances" : 0,
  "volumeAutoAssignFilters" : [ ],
  "vmAutoAssignFilters" : [ ],
  "hostAutoAssignFilters" : [ ],
  "podAutoAssignFilters": [ ],
  "instanceAutoAssignFilters": [ ]
}