You can generate a consumer definition.
Execution permission
Admin
Request line
POST baseURL/v1/services/GroupsDefinition/actions/generate/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 ConsumerDefinitionGenerateParam objects necessary to execute an operation. For details, see the table below. |
ConsumerDefinitionGenerateParam
{
"baseParameter":"...",
"generationPolicy":"...",
"generationPolicySubParam":"...",
"gradeKey":"..."
}
ConsumerDefinitionGenerateParam (Type: ConsumerDefinitionGenerateParam)
|
Attribute |
Type |
Description |
|---|---|---|
|
baseParameter |
enum |
Base parameter for consumer auto creation (For details about the valid values, see the table BaseParameter in List of enumerators.) |
|
generationPolicy |
enum |
generation policy (For details about the valid values, see the table GenerationPolicy in List of enumerators.) |
|
generationPolicySubParam |
string |
Subparameter to define generation policy |
|
gradeKey |
string |
Grade of consumer |
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 ConsumerDefinitionGenerateResponse objects. For details, see the table below. |
ConsumerDefinitionGenerateResponse
{
"informationMessage":"..."
}
ConsumerDefinitionGenerateResponse (Type: ConsumerDefinitionGenerateResponse)
|
Attribute |
Type |
Description |
|---|---|---|
|
informationMessage |
string |
Information message. |
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/services/GroupsDefinition/actions/generate/invoke
authorization:Basic c3lzdGVtOm1hbmFnZXI=
Host: localhost:22015
Accept: application/json
Content-Type: application/json
[Request Body]
{
"name": "generate",
"href": "http://localhost:22015/Analytics/v1/services/GroupsDefinition/actions/generate/invoke",
"method": "POST",
"type": "application/json",
"parameters": [
{
"baseParameter": "HostGroup",
"generationPolicy": "PrecedeSeparator",
"generationPolicySubParam": "-",
"grade": "Bronze",
"autoAssignRelatedResource": false
}
]
}
[Response Header]
HTTP/1.1 200 OK
date: Fri, 01 Apr 2022 02:07:43 GMT
server: CosminexusComponentContainer
cache-control: no-cache, must-revalidate, private, max-age=0
www-authenticate: HSSO dae9a6422f35b2e6a379db33118dd745ca5228_Wm0HGnlmckFqXXwA_V0810
content-type: application/json
content-length: 348
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
content-security-policy: frame-ancestors 'self'
[Response Body]
{
"instanceID": "c11a5532-649b-40d0-acc2-4653b5d70de7",
"created": "2022-03-31T19:07:43.670-07:00",
"updated": "2022-03-31T19:07:43.670-07:00",
"completed": "2022-03-31T19:07:43.670-07:00",
"state": "success",
"affectedResource": [],
"result": [
{
"instanceID": "consumerDefinition#786722c0-24c0-44ac-b436-cb4d4e52c564"
}
],
}