Help Center/ Cloud Eye/ API Reference/ API v3/ Agent Statuses/ Querying Agent Statuses in Batches
Updated on 2024-05-16 GMT+08:00

Querying Agent Statuses in Batches

Function

This API is used to query the Agent (including the uniagent) statuses.

URI

POST /v3/{project_id}/agent-status/batch-query

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 the 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

Yes

Array of strings

Specifies the cloud server ID list.

Array Length: 1 - 2000

uniagent_status

No

String

Specifies the uniagent status. The value can be none (not installed), running, silent, or unknown (faulty).

Enumeration values:

  • none

  • running

  • silent

  • unknown

extension_name

No

String

Specifies the Agent name. If this parameter is not specified, all Agents are queried. Currently, only telescope can be queried.

Enumeration values:

  • telescope

extension_status

No

String

Specifies the Agent status. If this parameter is not specified, all statuses are queried. The value can be none (not installed), running, stopped, fault (process exception), or unknown (connection exception).

Enumeration values:

  • none

  • running

  • stopped

  • fault

  • unknown

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

agent_status

Array of AgentStatusInfo objects

Specifies the Agent statuses.

Array Length: 1 - 2000

Table 5 AgentStatusInfo

Parameter

Type

Description

instance_id

String

Specifies the cloud server ID.

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

uniagent_status

String

Specifies the uniagent status. The value can be none (not installed), running, silent, or unknown (faulty).

Enumeration values:

  • none

  • running

  • silent

  • unknown

extensions

Array of ExtensionInfo objects

Specifies the Agent information list.

Array Length: 1 - 10

Table 6 ExtensionInfo

Parameter

Type

Description

name

String

Specifies the Agent name.

Minimum: 1

Maximum: 64

status

String

Specifies the Agent status. The value can be none (not installed), running, stopped, fault (process exception), or unknown (connection exception).

Enumeration values:

  • none

  • running

  • stopped

  • fault

  • unknown

version

String

Specifies the Agent version.

Minimum: 1

Maximum: 32

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Specifies the error code.

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

error_msg

String

Specifies the error message.

Minimum: 1

Maximum: 256

Status code: 401

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Specifies the error code.

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

error_msg

String

Specifies the error message.

Minimum: 1

Maximum: 256

Status code: 403

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Specifies the error code.

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

error_msg

String

Specifies the error message.

Minimum: 1

Maximum: 256

Status code: 500

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Specifies the error code.

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

error_msg

String

Specifies the error message.

Minimum: 1

Maximum: 256

Example Requests

{
  "instance_ids" : [ "111111111111" ],
  "uniagent_status" : "none",
  "extension_name" : "telescope",
  "extension_status" : "none"
}

Example Responses

Status code: 200

Specifies the response body for querying the Agent statuses in batches.

{
  "agent_status" : [ {
    "instance_id" : "111111111111",
    "uniagent_status" : "none",
    "extensions" : [ {
      "name" : "telescope",
      "status" : "none",
      "version" : "2.5.6"
    } ]
  } ]
}

Status Codes

Status Code

Description

200

Specifies the response body for querying the Agent statuses in batches.

400

Bad Request

401

Unauthorized

403

Forbidden

500

Internal Server Error

Error Codes

See Error Codes.