Submit a consumer auto creation task

Ops Center Analyzer REST API Reference Guide

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

You can create consumers by submitting a consumer definition.

Execution permission

Admin

Request line

POST baseURL/v1/objects/GroupsDefinition/{id}/actions/submit/invoke

Request body

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

Action

{
        "name":"...",
        "href":"...",
        "method":"...",
        "type":"...",
        "parameters":["...", ...]
}

Action (Type: Action)

Attribute

Type

Description

name

string

Name of the action.

href

string

URL for the action.

method

string

Name of the method.

type

string

Data format for the object.

parameters

anyType[]

A list of objects necessary to execute an operation. No value is set.

Response body

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

Job

{
        "instanceID":"...",
        "created":"...",
        "updated":"...",
        "completed":"...",
        "state":"...",
        "affectedResource":["...", ...],
        "result":["...", ...]
}

Job (Type: Job)

Attribute

Type

Description

instanceID

string

ID of the Instance.

created

string

Date the object is generated in "yyyy-mm-ddThh:mm:ss.mmmTZD" format (e.g., 2017-08-25T20:07:39.472+09:00).

updated

string

Time the object is updated in "yyyy-mm-ddThh:mm:ss.mmmTZD" format (e.g., 2017-08-25T20:07:39.472+09:00).

completed

string

Time the processing completed in "yyyy-mm-ddThh:mm:ss.mmmTZD" format (e.g., 2017-08-25T20:07:39.472+09:00).

state

string

One of the following values is set:

"failed": The operation failed.

"success": The operation completed successfully.

affectedResource

string[]

A blank space is set.

result

anyType[]

A list of ConsumerDefinitionSubmitResponse objects. For details, see the table below.

ConsumerDefinitionSubmitResponse

{
        "message":"...",
        "createdConsumers":"...",
        "createdRules":"...",
        "modifiedRules":"..."
}

ConsumerDefinitionSubmitResponse (Type: ConsumerDefinitionSubmitResponse)

Attribute

Type

Description

message

string

The message for result of submit API.

createdConsumers

string

List of created consumers.

createdRules

string

List of created rules.

modifiedRules

string

List of modified rules.

Status codes

Status code

Reason phrase

Description

200

OK

Success.

400

Bad Request

The format of the request body is invalid.

401

Unauthorized

No login privilege.

403

Forbidden

No execute privilege.

412

Precondition Failed

The server is not available.

500

Internal Server Error

Server processing error.

Example code

[Request Header]
POST Analytics/v1/objects/GroupsDefinition/consumerDefinition%23786722c0-24c0-44ac-b436-cb4d4e52c564/actions/submit/invoke
authorization:Basic c3lzdGVtOm1hbmFnZXI=
content-type:application/json
Host: localhost:22015
Accept: application/json
Content-Type: application/json

[Request Body]
{
  "name" : "submit",
  "href" : "http://localhost:22015/Analytics/v1/objects/GroupsDefinition/consumerDefinition%23786722c0%2d24c0%2d44ac%2db436%2dcb4d4e52c564/actions/submit/invoke",
  "method" : "POST",
  "type" : "application/json",
  "parameters" : [ ]
}

[Response Header]
HTTP/1.1 200 OK
date: Fri, 01 Apr 2022 10:12:43 GMT
server: CosminexusComponentContainer
cache-control: no-cache, must-revalidate, private, max-age=0
www-authenticate: HSSO dc9c674d68f9ce230f4e199e1e6fd3f96c3db0_Wm0HGnlmckFqXXwA_V0810
content-type: application/json
content-length: 275
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
content-security-policy: frame-ancestors 'self'

[Response Body]
{
  "instanceID" : "b01a367f-e950-4bd7-9f2f-44659407d5f9",
  "created" : "2022-04-01T03:12:43.809-07:00",
  "updated" : "2022-04-01T03:12:43.809-07:00",
  "completed" : "2022-04-01T03:12:43.809-07:00",
  "state" : "success",
  "affectedResource" : [ ],
  "result" : [ { } ]
}