All Products
Search
Document Center

Platform For AI:GetInstanceMetrics

Last Updated:Sep 15, 2025

Queries the resource metrics of an instance.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
paidsw:GetInstanceMetricsget
*All Resources
*
    none
none

Request syntax

GET /api/v2/instance/{InstanceId}/metrics HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The instance ID. You can call ListInstances to obtain the instance ID.

dsw-730xxxxxxxxxx
MetricTypestringYes

The metric type. Valid values:

  • GpuCoreUsage: the GPU utilization.
  • GpuMemoryUsage: the GPU memory utilization.
  • CpuCoreUsage: the CPU utilization.
  • MemoryUsage: the memory utilization.
  • NetworkInputRate: the network ingress rate.
  • NetworkOutputRate: the network egress rate.
  • DiskReadRate: the disk read rate.
  • DiskWriteRate: the disk write rate.
GpuCoreUsage
StartTimestringNo

The beginning of the time range to query.

2020-11-08T15:00:00Z
EndTimestringNo

The end of the time range to query.

2020-11-08T15:00:00Z
TimeStepstringNo

The interval at which metrics are returned. Unit: minutes.

15m

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

E7D55162-4489-1619-AAF5-3F97D5FCA948
Successboolean

Indicates whether the request was successful.

  • true
  • false
true
Messagestring

The response message.

"XXX"
Codestring

The status code. Valid values:

  • InternalError: an internal error. All errors, except for parameter validation errors, are classified as internal errors.
  • ValidationError: a parameter validation error.
null
HttpStatusCodeinteger

The HTTP status code. Valid values:

  • 400
  • 404
null
InstanceIdstring

The instance ID.

dsw-730xxxxxxxxxx
PodMetricsarray<object>

The information about the metrics of the pod that corresponds to the instance.

PodMetricobject

The information about the metric of the pod that corresponds to the instance.

PodIdstring

The ID of the pod that corresponds to the instance.

dsw-15870-695f44c5bc-hd6xm
Metricsarray<object>

The metrics of the pod that corresponds to the instance.

Metricobject

The metric of the pod that corresponds to the instance.

Timelong

The timestamp corresponding to the metric.

1670890560
Valuefloat

The metric value.

25.901031

Examples

Sample success responses

JSONformat

{
  "RequestId": "E7D55162-4489-1619-AAF5-3F97D5FCA948",
  "Success": true,
  "Message": "XXX",
  "Code": null,
  "HttpStatusCode": 0,
  "InstanceId": "dsw-730xxxxxxxxxx",
  "PodMetrics": [
    {
      "PodId": "dsw-15870-695f44c5bc-hd6xm",
      "Metrics": [
        {
          "Time": 1670890560,
          "Value": 25.901031
        }
      ]
    }
  ]
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-08-20The internal configuration of the API is changed, but the call is not affectedView Change Details
2022-08-30Add OperationView Change Details