Help Center/ Application Performance Management/ API Reference(2.0)/ APIs/ APM/ Enabling or Disabling Collection for an Instance
Updated on 2023-08-02 GMT+08:00

Enabling or Disabling Collection for an Instance

Function

This API is used to enable or disable collection for a specified instance.

URI

POST /v1/apm2/openapi/apm-service/agent-mgr/change-status

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

x-business-id

Yes

Long

Application ID.

X-Auth-Token

Yes

String

User token obtained from IAM.

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

instance_list

Yes

Array of integers

List of Agent IDs.

target_status

Yes

Integer

Expected Agent status. Options: 0: enabled. 1: disabled.

region

Yes

String

Region where the Agent is located.

env_id

No

Long

ID of the environment to which the Agent belongs.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

flag

String

ok: The operation is successful.

Example Requests

Disable data collection for instance 1097.

/v1/apm2/openapi/apm-service/agent-mgr/change-status

{
  "instance_list" : [ 1097 ],
  "target_status" : 1,
  "region" : "xx-xxxx-xx"
}

Example Responses

Status code: 200

OK: The request is successful.

	
Response body
Download
{
  "flag": "ok"
}

Status Codes

Status Code

Description

200

OK: The request is successful.

401

Unauthorized: No permissions.

403

Forbidden: Access forbidden.

404

Not Found: The requested resource is not found.

Error Codes

See Error Codes.