Help Center> GaussDB(for MySQL)> API Reference> APIs (Recommended)> Intelligent Diagnosis> Querying Abnormal Instance Information by a Specific Metric
Updated on 2023-12-20 GMT+08:00

Querying Abnormal Instance Information by a Specific Metric

Function

This API is used to abnormal instance information by a specific metric. Before calling this API:

URI

GET /v3/{project_id}/instances/diagnosis-instance-infos

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region.

To obtain this value, see Obtaining a Project ID.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

metric_name

Yes

String

Metric name.

offset

Yes

Integer

Index offset. If offset is set to N, the resource query starts from the N+1 piece of data. The value is 0 by default, indicating that the query starts from the first piece of data. The value cannot be a negative number.

limit

Yes

Integer

Number of records to be queried. The default value is 100. The value must be a positive integer. The minimum value is 1 and the maximum value is 100.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

To obtain the value, call the API for obtaining a user token.

After the request is processed, the value of X-Subject-Token in the message header is the token value.

X-Language

No

String

Request language type. The default value is en-us. Value range:

  • en-us
  • zh-cn

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

total_count

Integer

Number of abnormal instances queried by the current metric.

instance_infos

Array of InstanceInfoForDiagnosis objects

Information about the abnormal instances.

Table 5 InstanceInfoForDiagnosis

Parameter

Type

Description

instance_id

String

Instance ID.

master_node_id

String

Primary node ID.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Request

Querying abnormal instance information based on project_id and a metric name (The information is displayed on multiple pages)

GET https://{endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances/diagnosis-instance-infos?metric_name=high_pressure&offset=0&limit=10

Example Response

Status code: 200

Success.

{
  "total_count" : 6,
  "instance_infos" : [ {
    "instance_id" : "6206d5be05914703938ff9dfe5c07d34in07",
    "master_node_id" : "7fe925aa8bab4cc9bac3990a94386c29no07"
  }, {
    "instance_id" : "cbdb32e08f0440158c4f2998dbf69b14in07",
    "master_node_id" : "3e90e7b99b964dca9704b3af903fcb41no07"
  }, {
    "instance_id" : "325af119c2ca4e77b1deb4810a9b921bin07",
    "master_node_id" : "f4dfb362039a45818e59416abc9a5ca6no07"
  }, {
    "instance_id" : "9e8b52a5b6e84f4a9e4db01235b1c770in07",
    "master_node_id" : "408666cd6f104133ad0685b722f88cffno07"
  }, {
    "instance_id" : "5814254f12f74d16bd0a93885b00867fin07",
    "master_node_id" : "637d96ffbf6745ff835445fe87d08fc5no07"
  }, {
    "instance_id" : "d0da4882ebdf44bd9d3f1edf9b0bd4a2in07",
    "master_node_id" : "7a670f4ecdf14db5a4b5df737b0911a5no07"
  } ]
}

Status Code

Status Code

Description

200

Success.

400

Client error.

500

Server error.

Error Code

For details, see Error Codes.