Monitoring a Resource Pool
Function
This API is used to obtain the monitored resource pool information.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
URI
GET /v2/{project_id}/pools/{pool_name}/monitor
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Definition: Project ID. For details, see Obtaining a Project ID and Name. Constraints: N/A Range: N/A Default Value: N/A |
pool_name |
Yes |
String |
Definition: Resource pool ID. The value is obtained from the metadata.name field in the resource pool details. Constraints: N/A *Range: The value can contain 36 to 63 characters. It must start with a lowercase letter and cannot end with a hyphen (-). Digits and hyphens (-) are allowed. Default Value: N/A |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
time_range |
No |
String |
Definition: Time range for obtaining the monitored information of a resource pool, in the format of startTimeInMillis.endTimeInMillis.durationInMinutes Specifically, startTimeInMillis indicates start time (UTC) of the query, in milliseconds. If this parameter is set to -1, the server calculates the start time as follows: endTimeInMillis – durationInMinutes × 60 × 1000. endTimeInMillis indicates end time (UTC) of the query, in milliseconds. If this parameter is set to -1, the server calculates the end time as follows: startTimeInMillis + durationInMinutes × 60 × 1000. If the calculated end time is later than the current system time, the current system time is used. durationInMinutes indicates the query time span, in minutes. The value must be greater than 0, and also greater than or equal to the result of "(endTimeInMillis – startTimeInMillis)/(60 × 1000) – 1". If both the start time and end time are set to -1, the system sets the end time to the current UTC time (in milliseconds) and calculates the start time as follows: endTimeInMillis – durationInMinutes × 60 × 1000. For example, -1.-1.60 indicates the latest 60 minutes. Constraints: In a single request, the following condition must be met: durationInMinutes × 60/period ≤ 1,440 Range: N/A Default Value: -1.-1.60 Query time range. The default value is -1.-1.60. The format is startTimeInMillis.endTimeInMillis.durationInMinutes. Details about the parameter are as follows:
If both the start time and end time are set to -1, the system sets the end time to the current UTC time (in milliseconds) and calculates the start time as follows: endTimeInMillis – durationInMinutes × 60 × 1000. For example, -1.-1.60 indicates the latest 60 minutes. Constraint: In a single request, the following condition must be met: durationInMinutes × 60/period ≤ 1440 |
statistics |
No |
String |
Definition: Statistical method of resource pool monitoring information at a specified time granularity Constraints: N/A Range: The options are as follows:
Default Value: maximum |
period |
No |
String |
Definition: Time granularity for obtaining the monitored information of a resource pool, in seconds Constraints: N/A Range: The options are as follows:
Default Value: 60 |
Request Parameters
None
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
metrics |
Array of metrics objects |
Definition: Monitoring metric data of a resource pool. Constraints: The array size cannot exceed 20. Range: N/A Default Value: N/A |
Parameter |
Type |
Description |
---|---|---|
metric |
metric object |
Definition: Monitoring metric description. Constraints: N/A Range: N/A Default Value: N/A |
dataPoints |
Array of dataPoints objects |
Definition: Monitoring metric data. Constraints: N/A Range: N/A Default Value: N/A |
Parameter |
Type |
Description |
---|---|---|
dimensions |
Array of dimensions objects |
Definition: Metric dimension information. Constraints: N/A Range: N/A Default Value: N/A |
metricName |
String |
Definition: Metric name. Constraints: N/A Range:
Default Value: N/A |
namespace |
String |
Definition: Metric namespace. Constraints: N/A Range:
Default Value: N/A |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Definition: Metric dimension name. Constraints: N/A Range: metric name. The options are as follows:
Default Value: N/A |
value |
String |
Definition: Metric dimension value. Constraints: N/A Range: N/A Default Value: N/A |
Parameter |
Type |
Description |
---|---|---|
timestamp |
Integer |
Definition: Metric data timestamp, in ms. Constraints: N/A Range: N/A Default Value: N/A |
unit |
String |
Definition: Metric data unit. Constraints: N/A Range:
Default Value: N/A |
statistics |
Array of statistics objects |
Definition: Metric data value. Constraints: N/A Range: N/A Default Value: N/A |
Parameter |
Type |
Description |
---|---|---|
statistic |
String |
Definition: Statistical method of resource pool monitoring information at a specified time granularity. Constraints: N/A Range:
Default Value: maximum |
value |
Float |
Definition: Metric value. The value -1 indicates that no metric data is available. Constraints: N/A Range: N/A Default Value: N/A |
Status code: 404
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Range: N/A |
error_msg |
String |
Definition: Error message. Range: N/A |
Example Requests
Obtain the monitored resource pool information.
GET https://{endpoint}/v2/{project_id}/pools/{pool_name}/monitor { }
Example Responses
Status code: 200
OK
{ "metrics" : [ { "metric" : { "dimensions" : [ { "name" : "clusterId", "value" : "83df17f1-d74c-11ec-a070-0255ac1000c3" } ], "metricName" : "cpuUsage", "namespace" : "PAAS.AGGR" }, "dataPoints" : [ { "timestamp" : 1655193600000, "unit" : "Percent", "statistics" : [ { "statistic" : "average", "value" : 7.944 } ] }, { "timestamp" : 1655197200000, "unit" : "Percent", "statistics" : [ { "statistic" : "average", "value" : 7.88 } ] } ] }, { "metric" : { "dimensions" : [ { "name" : "clusterId", "value" : "83df17f1-d74c-11ec-a070-0255ac1000c3" } ], "metricName" : "memUsedRate", "namespace" : "PAAS.AGGR" }, "dataPoints" : [ { "timestamp" : 1655193600000, "unit" : "Percent", "statistics" : [ { "statistic" : "average", "value" : 13.83 } ] }, { "timestamp" : 1655197200000, "unit" : "Percent", "statistics" : [ { "statistic" : "average", "value" : 13.836 } ] } ] }, { "metric" : { "dimensions" : [ { "name" : "clusterId", "value" : "83df17f1-d74c-11ec-a070-0255ac1000c3" } ], "metricName" : "gpuUtil", "namespace" : "PAAS.AGGR" }, "dataPoints" : [ { "timestamp" : 1655193600000, "unit" : "Percent", "statistics" : [ { "statistic" : "average", "value" : -1 } ] }, { "timestamp" : 1655197200000, "unit" : "Percent", "statistics" : [ { "statistic" : "average", "value" : -1 } ] } ] }, { "metric" : { "dimensions" : [ { "name" : "clusterId", "value" : "83df17f1-d74c-11ec-a070-0255ac1000c3" } ], "metricName" : "gpuMemUsage", "namespace" : "PAAS.AGGR" }, "dataPoints" : [ { "timestamp" : 1655193600000, "unit" : "Percent", "statistics" : [ { "statistic" : "average", "value" : -1 } ] }, { "timestamp" : 1655197200000, "unit" : "Percent", "statistics" : [ { "statistic" : "average", "value" : -1 } ] } ] }, { "metric" : { "dimensions" : [ { "name" : "clusterId", "value" : "83df17f1-d74c-11ec-a070-0255ac1000c3" } ], "metricName" : "npuUtil", "namespace" : "PAAS.AGGR" }, "dataPoints" : [ { "timestamp" : 1655193600000, "unit" : "", "statistics" : [ { "statistic" : "average", "value" : -1 } ] }, { "timestamp" : 1655197200000, "unit" : "", "statistics" : [ { "statistic" : "average", "value" : -1 } ] } ] }, { "metric" : { "dimensions" : [ { "name" : "clusterId", "value" : "83df17f1-d74c-11ec-a070-0255ac1000c3" } ], "metricName" : "npuMemUsage", "namespace" : "PAAS.AGGR" }, "dataPoints" : [ { "timestamp" : 1655193600000, "unit" : "", "statistics" : [ { "statistic" : "average", "value" : -1 } ] }, { "timestamp" : 1655197200000, "unit" : "", "statistics" : [ { "statistic" : "average", "value" : -1 } ] } ] }, { "metric" : { "dimensions" : [ { "name" : "clusterId", "value" : "83df17f1-d74c-11ec-a070-0255ac1000c3" } ], "metricName" : "diskAvailableCapacity", "namespace" : "PAAS.AGGR" }, "dataPoints" : [ { "timestamp" : 1655193600000, "unit" : "Megabytes", "statistics" : [ { "statistic" : "average", "value" : 834383.4 } ] }, { "timestamp" : 1655197200000, "unit" : "Megabytes", "statistics" : [ { "statistic" : "average", "value" : 834379.2 } ] } ] }, { "metric" : { "dimensions" : [ { "name" : "clusterId", "value" : "83df17f1-d74c-11ec-a070-0255ac1000c3" } ], "metricName" : "diskCapacity", "namespace" : "PAAS.AGGR" }, "dataPoints" : [ { "timestamp" : 1655193600000, "unit" : "Megabytes", "statistics" : [ { "statistic" : "average", "value" : 1105920 } ] }, { "timestamp" : 1655197200000, "unit" : "Megabytes", "statistics" : [ { "statistic" : "average", "value" : 1105920 } ] } ] }, { "metric" : { "dimensions" : [ { "name" : "clusterId", "value" : "83df17f1-d74c-11ec-a070-0255ac1000c3" } ], "metricName" : "diskUsedRate", "namespace" : "PAAS.AGGR" }, "dataPoints" : [ { "timestamp" : 1655193600000, "unit" : "Percent", "statistics" : [ { "statistic" : "average", "value" : 24.553 } ] }, { "timestamp" : 1655197200000, "unit" : "Percent", "statistics" : [ { "statistic" : "average", "value" : 24.553 } ] } ] } ] }
Status code: 404
Not found.
{ "error_code" : "ModelArts.50015001", "error_msg" : "pool not found" }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
404 |
Not found. |
Error Codes
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