Querying Metrics of All DB Instances
Function
This API is used to query metrics of all DB instances. Before calling this API:
- Learn how to authenticate this API.
- Obtain the required region and endpoint.
Debugging
You can debug this API in API Explorer.
URI
GET /v3/{project_id}/instances/metric-data
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Definition Project ID of a tenant in a region. To obtain the value, see Obtaining a Project ID. Constraints N/A Range The value can contain 32 characters. Only letters and digits are allowed. Default Value N/A |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
offset |
No |
Integer |
Definition Index offset. The query starts from the next piece of data indexed by this parameter. For example, if this parameter is set to 1 and limit is set to 10, only the 2nd to 11th records are displayed. Constraints N/A Range [0, 2^31-1] Default Value 0: The query starts from the first data record. |
limit |
No |
Integer |
Definition Number of records returned by a query. For example, if this parameter is set to 10, a maximum of 10 records can be displayed. Constraints N/A Range [1, 50] Default Value 50 |
name |
No |
String |
Definition Instance name. Instances of the same type can have same names under the same tenant. Constraints N/A Range The name can contain 4 to 64 characters and must start with a letter. Only letters (case-sensitive), digits, hyphens (-), and underscores (_) are allowed. Default Value N/A |
instance_id |
No |
String |
Definition Instance ID, which uniquely identifies an instance. Constraints N/A Range The value can contain 36 characters. Only letters and digits are allowed. Default Value N/A |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
Definition User token. You can obtain the token by calling the IAM API used to obtain a user token. After the request is processed, the value of X-Subject-Token in the message header is the token value. Constraints N/A Range N/A Default Value N/A |
X-Language |
No |
String |
Definition Language. Constraints N/A Range
Default Value en-us |
Response Parameters
Parameter |
Type |
Description |
---|---|---|
instances |
Array of InstancesMetricResult objects |
Definition Instance information. For details, see Table 5. |
total_count |
Integer |
Definition Total number of records. Range N/A |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Definition Instance ID. Range N/A |
name |
String |
Definition Instance name. Range N/A |
status |
String |
Definition Instance status. Range
|
mode |
String |
Definition Instance type. Range N/A |
engine_name |
String |
Definition Engine name. Range N/A |
engine_version |
String |
Definition Engine version. Range N/A |
solution |
String |
Definition Deployment model. Range N/A |
disk_used_size |
String |
Definition Used instance disk size. Range N/A |
disk_total_size |
String |
Definition Total instance disk size. Range N/A |
disk_usage |
String |
Definition Instance disk usage. Range N/A |
p80 |
String |
Definition Response time of 80% SQL statements. Range N/A |
p95 |
String |
Definition Response time of 95% SQL statements. Range N/A |
deadlocks |
String |
Definition Deadlocks. Range N/A |
buffer_hit_ratio |
String |
Definition Buffer hit rate. Range N/A |
nodes |
Array of InstancesNodesResult objects |
Definition Instance node information. For details, see Table 6. |
Example Request
This API is used to query metrics of all DB instances. Before calling this API:
https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v3/0611f1bd8b00d5d32f17c017f15b599f/instances/metric-data?instance_id=e73893ef73754465a8bd2e0857bbf13ein14
Example Response
{ "instances" : [ { "id" : "ad8cd1440aa94a02ae4580fcbebb3143in14", "name" : "user1-v3-independent", "status" : "BUILD", "mode" : "Centralized", "engine_name" : "GaussDB", "engine_version" : "8.0.92", "solution" : "1 primary + 2 standby", "disk_used_size" : 1.05, "disk_total_size" : 160, "disk_usage" : 0.62, "p80" : 342, "p95" : 501, "deadlocks" : 0, "buffer_hit_ratio" : 0, "nodes" : [ { "id" : "6b7616dfb1c14721b1a11dd5654c1515no14", "name" : "DataNode1", "component_ids" : [ "dn_6001", "dn_6002" ] } ] } ], "total_count" : 100 }
Status Codes
- Normal
- Abnormal
For details, see Status Codes.
Error Codes
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot