Queries the coverage details of reserved instances (RIs) or storage capacity units (SCUs).

1. The queried coverage details are the same as those displayed in the table on the Coverage tab of the Manage Reserved Instances page in the Billing Management console.

2. You can call this operation to query the coverage details of RIs or SCUs.

3. You can call this operation to query coverage details at an hourly, daily, or monthly granularity.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeResourceCoverageDetail

The operation that you want to perform. Set the value to DescribeResourceCoverageDetail.

PeriodType String Yes HOUR

The time granularity at which coverage details are queried. Valid values: MONTH, DAY, and HOUR.

ResourceType String Yes RI

The type of deduction plans whose coverage details are queried. Valid values: RI and SCU.

StartPeriod String Yes 2021-01-01 00:00:00

The beginning of the time range to query.

The beginning is included in the time range. Specify the time in the format of yyyy-MM-dd HH:mm:ss.

EndPeriod String No 2021-01-02 00:00:00

The end of the time range to query. The end is excluded from the time range. If you do not set this parameter, the end time is the current time. Specify the time in the format of yyyy-MM-dd HH:mm:ss.

NextToken String No eyJwYWdlTnVtIjoyLCJwYWdlU2l6ZSI6MTB9

The token that is used to retrieve the next page of results. You do not need to set this parameter if you query coverage details within a specific time range for the first time. The response returns a token that you can use to query coverage details that are displayed on the next page. If a null value is returned for the NextToken parameter, no more coverage details can be queried.

MaxResults Integer No 200

The maximum number of entries to return. Default value: 20. Maximum value: 300.

BillOwnerId Long No 123745698925000

The ID of the account for which you want to query coverage details. If you do not set this parameter, the data of the current Alibaba Cloud account and its RAM users is queried. To query the data of a RAM user, specify the ID of the RAM user.

Response parameters

Parameter Type Example Description
Code String Success

The status code.

Data Struct

The returned data.

Items Array of Item

The data entries.

CapacityUnit String Calc*Hour

The unit that is used to measure the resources deducted from deduction plans.

CommodityCode String ecs

The code of the service.

CommodityName String Elastic Compute Service (ECS) - Pay by quantity

The name and billing method of the service.

CoveragePercentage Float 1

The coverage rate of a deduction plan.

Currency String CNY

The currency in which deduction plans were priced.

DeductQuantity Float 1

The amount of the resources deducted from a deduction plan.

EndTime String 2021-04-01 01:00:00

The end of the time range in which the coverage details were queried.

InstanceId String i-bp1d9x623987rlj0dx4xx

The ID of a pay-as-you-go instance.

InstanceSpec String ecs.t5-lc2m1.nano

The specifications of a deduction plan.

PaymentAmount Float 0

The amount of the bill.

ProductCode String ecs

The code of the service.

ProductName String Elastic Compute Service

The name of the service.

Region String China (hangzhou)

The region.

RegionNo String cn-hangzhou-dg-a01

The code of the region.

StartTime String 2021-04-01 00:00:00

The beginning of the time range in which the coverage details were queried.

TotalQuantity Float 1

The total amount of resources consumed.

UserId String 123745698925000

The ID of the account.

UserName String test13@test.aliyun.com

The username of the account.

Zone String cn-hangzhou-i

The code of the zone.

ZoneName String Hangzhou Zone I

The zone.

MaxResults Integer 200

The number of entries returned on the current page.

NextToken String eyJwYWdlTnVtIjoyLCJwYWdlU2l6ZSI6MTB9

The token of the next page.

TotalCount Integer 10000

The total number of entries returned.

Message String Successful!

The message returned.

RequestId String 79EE7556-0CFD-44EB-9CD6-B3B526E3A85F

The ID of the request.

Success Boolean true

Indicates whether the operation was successful.

Examples

Sample requests

http(s)://[Endpoint]/?Action=DescribeResourceCoverageDetail
&PeriodType=HOUR
&ResourceType=RI
&StartPeriod=2021-01-01 00:00:00
&EndPeriod=2021-01-02 00:00:00
&<Common request parameters>

Sample success responses

JSON format

{"Message":"Successful!","RequestId":"79EE7556-0CFD-44EB-9CD6-B3B526E3A85F","Data":{"TotalCount":"10000","NextToken":"eyJwYWdlTnVtIjoyLCJwYWdlU2l6ZSI6MTB9","MaxResults":"200","Items":[{"RegionNo":"cn-hangzhou-dg-a01","InstanceSpec":"ecs.t5-lc2m1.nano","UserName":"test13@test.aliyun.com","EndTime":"2021-04-01 01:00:00","ProductName":"Elastic Compute Service","CapacityUnit":"Calc*Hour","InstanceId":"i-bp1d9x623987rlj0dx4xx","ProductCode":"ecs","Zone":"cn-hangzhou-i","StartTime":"2021-04-01 00:00:00","PaymentAmount":"0","ZoneName":"Hangzhou Zone I","TotalQuantity":"1","UserId":"123745698925000","Currency":"CNY","CommodityCode":"ecs","Region":"China (hangzhou)","CoveragePercentage":"1","CommodityName":"Elastic Compute Service (ECS) - Pay by quantity","DeductQuantity":"1"}]},"Code":"Success","Success":"true"}

Error codes

For a list of error codes, visit the API Error Center.