Updated on 2023-08-02 GMT+08:00

Saving a Monitoring Item

Function

This API is used to save a monitoring item.

URI

POST /v1/apm2/openapi/apm-service/monitor-item-mgr/save-monitor-item-config

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token obtained from IAM.

x-business-id

Yes

Long

Application ID.

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

monitor_item_id

Yes

Long

Monitoring item ID.

interval

No

Integer

Collection interval.

env_id

Yes

Integer

Environment ID.

config_value_list

No

Array of ConfigItem objects

Configuration item list.

Table 3 ConfigItem

Parameter

Mandatory

Type

Description

config_name

No

String

Configuration item name.

config_value

No

String

Configuration item value.

should_override

No

Boolean

Rewrite or not.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

flag

String

Monitoring item status.

Example Requests

Modify the information about monitoring item 4.

/v1/apm2/openapi/apm-service/monitor-item-mgr/save-monitor-item-config

{
  "interval" : 60,
  "config_value_list" : [ {
    "config_name" : "stackThreshold",
    "config_value" : 3,
    "should_override" : true
  } ],
  "monitor_item_id" : 4,
  "env_id" : "1"
}

Example Responses

Status code: 200

OK: The request is successful.

{
  "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.