Help Center> Cloud Eye> API Reference> API v3> Agent maintenance tasks> Creating Agent maintenance Tasks in Batches
Updated on 2024-04-30 GMT+08:00

Creating Agent maintenance Tasks in Batches

Function

This API is used to create Agent maintenance tasks in batches.

Constraints

This API is not supported at the following regions: LA-Buenos Aires1, and LA-Lima1.

URI

POST /v3/{project_id}/agent-invocations/batch-create

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

Minimum: 1

Maximum: 64

Regex Pattern: ^[a-z0-9]+$

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Specifies the MIME type of a request body. The default type is application/json; charset=UTF-8.

Default: application/json; charset=UTF-8

Minimum: 1

Maximum: 64

X-Auth-Token

Yes

String

Specifies the user token. It is a response to the API for obtaining a user token. This API is the only one that does not require authentication. The value of X-Subject-Token in the response header is the token.

Minimum: 1

Maximum: 16384

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

instance_ids

No

Array of strings

Specifies the server ID list. (This parameter is mandatory when the task type is INSTALL or UPDATE.)

Array Length: 1 - 100

invocation_type

Yes

String

Specifies the task type, which can be INSTALL, UPDATE, ROLLBACK, or RETRY.

Enumeration values:

  • INSTALL
  • UPDATE
  • ROLLBACK
  • RETRY

invocation_target

No

String

Specifies the task object. Only telescope is supported.

Default: telescope

Enumeration values:

  • telescope

invocation_ids

No

Array of strings

Specifies the task ID list. This parameter is mandatory when the task type is ROLLBACK or RETRY.

Array Length: 1 - 100

version_type

No

String

Specifies the version the Agent will be upgraded to. The value can be BASIC_VERSION or ADVANCE_VERSION.

Enumeration values:

  • BASIC_VERSION
  • ADVANCE_VERSION

origin

No

String

Specifies the source that calls the Agent maintenance task APIs. CES indicates the Cloud Eye console, APICOM_BMS indicates Bare Metal Server (BMS), and ADMIN_SERVER indicates the O&M platform.

Enumeration values:

  • CES
  • APICOM_BMS
  • ADMIN_SERVER

Response Parameters

Status code: 201

Table 4 Response body parameters

Parameter

Type

Description

invocations

Array of BatchCreateInvocationInfo objects

Specifies the information list of the created task.

Array Length: 0 - 100

Table 5 BatchCreateInvocationInfo

Parameter

Type

Description

instance_id

String

Specifies the server ID.

Regex Pattern: ^[a-zA-Z0-9-]{1,64}$

ret_status

String

Specifies the task result. The value can be successful or error.

Enumeration values:

  • successful
  • error

error_msg

String

Specifies the error message.

Minimum: 1

Maximum: 128

invocation_id

String

Specifies the task ID.

Regex Pattern: ^[a-zA-Z0-9-]{1,64}$

error_code

String

Specifies the error code.

Regex Pattern: ^(invocationmgr\.[0-9]{4})$

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Specifies the error code.

Regex Pattern: ^(taskmgr\.[0-9]{4})$

error_msg

String

Specifies the error message.

Minimum: 1

Maximum: 256

Status code: 401

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Specifies the error code.

Regex Pattern: ^(taskmgr\.[0-9]{4})$

error_msg

String

Specifies the error message.

Minimum: 1

Maximum: 256

Status code: 403

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Specifies the error code.

Regex Pattern: ^(taskmgr\.[0-9]{4})$

error_msg

String

Specifies the error message.

Minimum: 1

Maximum: 256

Status code: 500

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Specifies the error code.

Regex Pattern: ^(taskmgr\.[0-9]{4})$

error_msg

String

Specifies the error message.

Minimum: 1

Maximum: 256

Example Requests

{
  "instance_ids" : [ "instancexxx001", "instancexxx002" ],
  "invocation_type" : "INSTALL",
  "invocation_target" : "telescope"
}

Example Responses

Status code: 201

Created

[ {
  "instance_id" : "instancexxx001",
  "ret_status" : "successful"
}, {
  "instance_id" : "instancexxx002",
  "ret_status" : "error",
  "error_msg" : "do not meet the installation conditions"
} ]

Status Codes

Status Code

Description

201

Created

400

Bad Request

401

Unauthorized

403

Forbidden

500

Internal Server Error

Error Codes

See Error Codes.