Creating automatic resource assignment rule

Ops Center Analyzer REST API Reference Guide

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

You can create a new automatic resource assignment rule.

Execution permission

Admin, Modify

Request line

POST baseURL/v1/objects/AutoAssignFilters

Request body

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

AutoAssignFilter

{
        "instanceID":"...",
        "filterName":"...",
        "filterType":"...",
        "resourceType":"...",
        "priority":"...",
        "description":"...",
        "groupID":"...",
        "groupName":"...",
        "userResourceThresholdID":"...",
        "userResourceThresholdName":"...",
        "profileResourceType":"..."
}

AutoAssignFilter (Type: AutoAssignFilter)

Attribute

Type

Description

instanceID

string

ID of the assignment rule

filterName

string

Name of the assignment rule

filterType

enum

Type of the assignment rule

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

  • UserResourceThreshold
  • Group

resourceType

enum

Type of resources to which the assignment rule is to be applied

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

  • VM
  • Volume
  • Host

priority

int

Priority of the assignment rule

description

string

Description of the assignment rule

groupID

string

ID of the assignment-destination consumer. This item is set only if the rule type is "Group".

groupName

string

Name of the assignment-destination consumer. This item is set only if the rule type is "Group".

userResourceThresholdID

string

ID of the threshold profile to be assigned to the resource. This item is set only if the rule type is "UserResourceThreshold".

userResourceThresholdName

string

Name of the threshold profile to be assigned to the resource. This item is set only if the rule type is "UserResourceThreshold".

profileResourceType

enum

Resource type of threshold profile.

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

Response body

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

AutoAssignFilter

{
        "instanceID":"...",
        "filterName":"...",
        "filterType":"...",
        "resourceType":"...",
        "priority":"...",
        "description":"...",
        "groupID":"...",
        "groupName":"...",
        "userResourceThresholdID":"...",
        "userResourceThresholdName":"...",
        "profileResourceType":"..."
}

AutoAssignFilter (Type: AutoAssignFilter)

Attribute

Type

Description

instanceID

string

ID of the assignment rule

filterName

string

Name of the assignment rule

filterType

enum

Type of the assignment rule

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

  • UserResourceThreshold
  • Group

resourceType

enum

Type of resources to which the assignment rule is to be applied

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

  • VM
  • Volume
  • Host

priority

int

Priority of the assignment rule

description

string

Description of the assignment rule

groupID

string

ID of the assignment-destination consumer. This item is set only if the rule type is "Group".

groupName

string

Name of the assignment-destination consumer. This item is set only if the rule type is "Group".

userResourceThresholdID

string

ID of the threshold profile to be assigned to the resource. This item is set only if the rule type is "UserResourceThreshold".

userResourceThresholdName

string

Name of the threshold profile to be assigned to the resource. This item is set only if the rule type is "UserResourceThreshold".

profileResourceType

enum

Resource type of threshold profile.

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

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 create privilege.

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/AutoAssignFilters
Authorization: Basic c3lzdGVtOm1hbmFnZXI=
Host: localhost:22015
Accept: application/json
Content-Type: application/json

[Request Body]
{
  "filterName":"filterName-20160812201703052",
  "filterType":"Group",
  "resourceType":"VM",
  "description":"Description 7 Consumer - Host",
  "groupID":"group#a9942fa3-0567-48fd-a147-da1bbe77c0ff",
  "groupName":"GroupAutoAssignFilterGetId"
}

[Response Header]
HTTP/1.1 201 Created
Date: Fri, 12 Aug 2016 11:17:03 GMT
Server: Cosminexus HTTP Server
Cache-Control: no-cache
WWW-Authenticate: HSSO 30f198fbc8b17b25ed2d623b761929ba5a56df2_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" : "autoAssignFilter#1e24a8b4-afb6-4afe-b657-349588e4248c",
  "filterName" : "filterName-20160812201703052",
  "filterType" : "Group",
  "resourceType" : "VM",
  "priority" : 1,
  "description" : "Description 7 Consumer - Host",
  "groupID" : "group#a9942fa3-0567-48fd-a147-da1bbe77c0ff",
  "groupName" : "GroupAutoAssignFilterGetId",
  "profileResourceType" : "INVALID_MEMBER"
}