Creating consumer

Ops Center Analyzer REST API Reference Guide

Version
11.0.x
Audience
anonymous
Part Number
MK-99ANA003-18

You can create a new consumer by specifying information such as the consumer name and grade.

Execution permission

Admin, Modify

Request line

POST baseURL/v1/objects/Groups

Request body

The structure of the request body and the object attributes are as follows:

Group

{
        "instanceID":"...",
        "name":"...",
        "status":"...",
        "gradeKey":"...",
        "gradeName":"...",
        "gradeDisplayOrder":"...",
        "description":"...",
        "templateCreatorType":"...",
        "numOfVolumes":"...",
        "numOfVMs":"...",
        "numOfHosts":"...",
        "volumeAutoAssignFilters":["...", ...],
        "vmAutoAssignFilters":["...", ...],
        "hostAutoAssignFilters":["...", ...]
}

Group (Type: Group)

Attribute

Type

Description

instanceID

string

ID of the consumer.

name

string

Name of the consumer.

status

enum

Status of the consumer.

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

  • Normal
  • Warning
  • Critical
  • Unknown

gradeKey

string

ID of the grade.

gradeName

string

Name of the grade.

gradeDisplayOrder

int

Priority of the grade.

description

string

Description.

templateCreatorType

enum

Type indicating whether the consumer can perform editing. The consumer can perform editing only if the type is "User".

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

  • User
  • Default

numOfVolumes

int

Number of volumes assigned to the consumer.

numOfVMs

int

Number of virtual machines assigned to the consumer.

numOfHosts

int

Number of hosts assigned to the consumer.

volumeAutoAssignFilters

string[]

Assignment rules of volumes that can be assigned to this consumer.

vmAutoAssignFilters

string[]

Assignment rules of virtual machines that can be assigned to this consumer.

hostAutoAssignFilters

string[]

Assignment rules of hosts that can be assigned to this consumer.

Response body

The structure of the response body and the object attributes is as follows:

Group

{
        "instanceID":"...",
        "name":"...",
        "status":"...",
        "gradeKey":"...",
        "gradeName":"...",
        "gradeDisplayOrder":"...",
        "description":"...",
        "templateCreatorType":"...",
        "numOfVolumes":"...",
        "numOfVMs":"...",
        "numOfHosts":"...",
        "volumeAutoAssignFilters":["...", ...],
        "vmAutoAssignFilters":["...", ...],
        "hostAutoAssignFilters":["...", ...]
}

Group (Type: Group)

Attribute

Type

Description

instanceID

string

ID of the consumer.

name

string

Name of the consumer.

status

enum

Status of the consumer.

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

  • Normal
  • Warning
  • Critical
  • Unknown

gradeKey

string

ID of the grade.

gradeName

string

Name of the grade.

gradeDisplayOrder

int

Priority of the grade.

description

string

Description.

templateCreatorType

enum

Type indicating whether the consumer can perform editing. The consumer can perform editing only if the type is "User".

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

  • User
  • Default

numOfVolumes

int

Number of volumes assigned to the consumer.

numOfVMs

int

Number of virtual machines assigned to the consumer.

numOfHosts

int

Number of hosts assigned to the consumer.

volumeAutoAssignFilters

string[]

Assignment rules of volumes that can be assigned to this consumer.

vmAutoAssignFilters

string[]

Assignment rules of virtual machines that can be assigned to this consumer.

hostAutoAssignFilters

string[]

Assignment rules of hosts that can be assigned to this consumer.

Status codes

Status code

Reason phrase

Description

201

Created

Success.

400

Bad Request

The format of the 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.

503

Service Unavailable

Analyzer detail view server communication error.

Example code

[Request Header]
POST /Analytics/v1/objects/Groups
Authorization: Basic c3lzdGVtOm1hbmFnZXI=
Host: localhost:22015
Accept: application/json
Content-Type: application/json

[Request Body]
{
  "name":"Group-20160720111044502",
  "gradeKey":"10",
  "description":"groupxxxxxxxxx"
}

[Response Header]
HTTP/1.1 201 Created
Date: Wed, 20 Jul 2016 02:10:44 GMT
Server: Cosminexus HTTP Server
Cache-Control: no-cache
WWW-Authenticate: HSSO 33659a74fcee4358dc272b34eca6ded1bf1131ec_YXZvNFIMehp3UB4jbmVyPGUgT3Q=_V0810
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" : "group#aea4c579-af9d-4a01-b786-e05740ea687a",
  "name" : "Group-20160720111044502",
  "status" : "Unknown",
  "gradeKey" : "10",
  "gradeName" : "Platinum",
  "gradeDisplayOrder" : 10,
  "description" : "groupxxxxxxxxx",
  "templateCreatorType" : "User",
  "numOfVolumes" : 0,
  "numOfVMs" : 0,
  "numOfHosts" : 0,
  "volumeAutoAssignFilters" : [ ],
  "vmAutoAssignFilters" : [ ],
  "hostAutoAssignFilters" : [ ]
}