Queries the usage details of reserved instances (RIs) or storage capacity units (SCUs).
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
bssapi:DescribeResourceUsageDetail |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| StartPeriod |
string |
Yes |
The beginning of the time range to query. The beginning is included in the time range. Specify the time in the yyyy-MM-dd HH:mm:ss format. |
2021-01-01 00:00:00 |
| EndPeriod |
string |
No |
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. |
2021-01-02 00:00:00 |
| PeriodType |
string |
Yes |
The time granularity at which usage details are queried. Valid values: MONTH, DAY, and HOUR. |
HOUR |
| NextToken |
string |
No |
The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of NextToken. If NextToken is empty, no next page exists. |
eyJwYWdlTnVtIjoyLCJwYWdlU2l6ZSI6MTB9 |
| MaxResults |
integer |
No |
The maximum number of entries to return. Default value: 20. The maximum value is 300. |
200 |
| BillOwnerId |
integer |
No |
The ID of the account whose data you want to query. If you do not specify this parameter, the data of the current Alibaba Cloud account and its Resource Access Management (RAM) users is queried. To query the data of a RAM user, specify the ID of the RAM user. |
123745698925000 |
| ResourceType |
string |
Yes |
The type of deduction plan whose usage details are queried. Valid values: RI and SCU. |
RI |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Code |
string |
The response code. |
Success |
| Message |
string |
The returned message. |
Successful! |
| RequestId |
string |
The request ID. |
79EE7556-0CFD-44EB-9CD6-B3B526E3A85F |
| Success |
boolean |
Indicates whether the request was successful. |
true |
| Data |
object |
The returned data. |
|
| NextToken |
string |
A pagination token. It can be used in the next request to retrieve a new page of results. |
eyJwYWdlTnVtIjoyLCJwYWdlU2l6ZSI6MTB9 |
| TotalCount |
integer |
The total number of entries returned. |
10000 |
| MaxResults |
integer |
The number of entries returned on the current page. |
200 |
| Items |
array<object> |
The data entries. |
|
|
object |
|||
| Status |
string |
The status of the deduction plan. |
Valid |
| UsagePercentage |
number |
The usage rate of the deduction plan. |
0.5 |
| ResourceInstanceId |
string |
The ID of the deduction plan. |
ecsri-bp147nnfz21225k9mpix00 |
| TotalQuantity |
number |
The total capacity of the deduction plan. |
2 |
| ReservationCost |
string |
The fee of the deduction plan. |
0 |
| RegionNo |
string |
The code of the region. |
cn-hangzhou-dg-a01 |
| UserId |
string |
The account ID. |
123745698925000 |
| StatusName |
string |
The name of the status. |
生效 |
| CapacityUnit |
string |
The unit that is used to measure the resources that are deducted. |
算力*小时 |
| PotentialSavedCost |
string |
The potential net savings. |
0.13 |
| Currency |
string |
The type of the currency. |
CNY |
| ZoneName |
string |
The code of the zone. |
杭州 可用区I |
| InstanceSpec |
string |
The instance type. |
ecs.t5-lc2m1.nano |
| EndTime |
string |
The end of the time range in which the usage details were queried. |
2021-04-01 01:00:00 |
| PostpaidCost |
string |
The equivalent of pay-as-you-go costs. |
0.06 |
| ImageType |
string |
The operating system. |
linux |
| StartTime |
string |
The beginning of the time range in which the usage details were queried. |
2021-04-01 00:00:00 |
| Region |
string |
The region. |
华东1(杭州) |
| DeductQuantity |
number |
The amount of the deducted resources. |
1 |
| SavedCost |
string |
The net savings. |
0.06 |
| Zone |
string |
The zone. |
cn-hangzhou-i |
| UserName |
string |
The username of the account. |
test@aliyun.com |
| Quantity |
integer |
The number of deduction plans. |
2 |
Examples
Success response
JSON format
{
"Code": "Success",
"Message": "Successful!",
"RequestId": "79EE7556-0CFD-44EB-9CD6-B3B526E3A85F",
"Success": true,
"Data": {
"NextToken": "eyJwYWdlTnVtIjoyLCJwYWdlU2l6ZSI6MTB9",
"TotalCount": 10000,
"MaxResults": 200,
"Items": [
{
"Status": "Valid",
"UsagePercentage": 0.5,
"ResourceInstanceId": "ecsri-bp147nnfz21225k9mpix00",
"TotalQuantity": 2,
"ReservationCost": "0",
"RegionNo": "cn-hangzhou-dg-a01",
"UserId": "123745698925000",
"StatusName": "生效",
"CapacityUnit": "算力*小时",
"PotentialSavedCost": "0.13",
"Currency": "CNY",
"ZoneName": "杭州 可用区I",
"InstanceSpec": "ecs.t5-lc2m1.nano",
"EndTime": "2021-04-01 01:00:00",
"PostpaidCost": "0.06",
"ImageType": "linux",
"StartTime": "2021-04-01 00:00:00",
"Region": "华东1(杭州)",
"DeductQuantity": 1,
"SavedCost": "0.06",
"Zone": "cn-hangzhou-i",
"UserName": "test@aliyun.com",
"Quantity": 2
}
]
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.