Monitoring a Resource Pool
Function
This API is used to obtain the real-time or historical monitoring information about a specified resource pool. This API is used when you need to obtain the monitoring data of a resource pool in real time, such as resource usage, performance status, or historical data. Before using this API, ensure that the resource pool exists and you have the administrator permissions. After the API is called, the system returns the monitoring information of the resource pool, including the resource usage, performance metrics, and historical trends. If the resource pool does not exist, the user does not have the permission to perform the operation, or the resource pool is unavailable, the API will return an error message.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
modelarts:pool:get
Read
pool *
g:ResourceTag/<tag-key>
-
-
-
g:EnterpriseProjectId
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 |
Request Parameters
None
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
metrics |
Array of metrics objects |
Definition: Monitoring metric data of a resource pool. |
|
Parameter |
Type |
Description |
|---|---|---|
|
metric |
metric object |
Definition: Metric description. |
|
dataPoints |
Array of dataPoints objects |
Definition: Monitoring metric data. |
|
Parameter |
Type |
Description |
|---|---|---|
|
dimensions |
Array of dimensions objects |
Definition: Metric dimension information. |
|
metricName |
String |
Definition: Metric name. Range: |
|
namespace |
String |
Definition: Metric namespace. Range: |
|
Parameter |
Type |
Description |
|---|---|---|
|
name |
String |
Definition: Metric dimension name. Range: metric name. Options: |
|
value |
String |
Definition: Metric dimension value. Range: N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
timestamp |
Integer |
Definition: Metric data timestamp, in ms. Range: N/A |
|
unit |
String |
Definition: Metric data unit. Range: |
|
statistics |
Array of statistics objects |
Definition: Metric data value. |
|
Parameter |
Type |
Description |
|---|---|---|
|
statistic |
String |
Definition: Statistical method of resource pool monitoring information at a specified time granularity. Range: |
|
value |
Float |
Definition: Metric value. The value -1 indicates that no metric data is available. Range: N/A |
Status code: 404
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