All Products
Search
Document Center

ENS:DescribeEnsResourceUsage

Last Updated:Jul 26, 2024

Queries the usage summary of ENS virtual machines (VMs), disks, and networks.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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:
    • The required resource types are displayed in bold characters.
    • 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
ens:DescribeEnsResourceUsage
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ExpiredStartTimestringNo

The beginning of the time range to query. Format: yyyy-MM-dd or yyyy-MM-dd HH:mm:ss.

2018-06-15T09:07:23Z
ExpiredEndTimestringNo

The end of the time range to query. Format: yyyy-MM-dd or yyyy-MM-dd HH:mm:ss.

2018-06-15T09:07:23Z

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The request ID.

EnsResourceUsagearray<object>

The resource usage data.

object
ServiceTypestring

The type of the service. Valid values:

  • 1: subscription instance.
  • 2: edge service instance.
  • 3: pay-as-you-go instance.
1
InstanceCountinteger

The number of instances.

2
CpuSumlong

The CPU usage. Unit: cores.

2
GpuSumlong

The number of GPUs.

6
DownCountinteger

The number of stopped VMs.

7
ExpiredCountinteger

The number of expired VM instances.

1
ExpiringCountinteger

The number of VM instances that are about to expire.

0
RunningCountinteger

The number of running instances.

19
DiskCountinteger

The number of data disks.

4
StorageSumlong

The total disk size.

5000
ComputeResourceCountinteger

The number of edge services. This parameter is available only when you set the ServiceType parameter to 2.

2

Examples

Sample success responses

JSONformat

{
  "RequestId": "",
  "EnsResourceUsage": [
    {
      "ServiceType": "1",
      "InstanceCount": 2,
      "CpuSum": 2,
      "GpuSum": 6,
      "DownCount": 7,
      "ExpiredCount": 1,
      "ExpiringCount": 0,
      "RunningCount": 19,
      "DiskCount": 4,
      "StorageSum": 5000,
      "ComputeResourceCount": 2
    }
  ]
}

Error codes

HTTP status codeError codeError message
400ens.interface.errorAn error occurred while call the API.
400Invalid%sThe specified parameter %s is invalid.
400Missing%sYou must specify the parameter %s.
400NoPermissionPermission denied.
400InvalidParameter.%sThe specified field %s invalid. Please check it again.

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

Change history

Change timeSummary of changesOperation
No change history