Queries the usage of resource plans, including reserved instances (RIs) and storage capacity units (SCUs).
Operation description
Limits:
Only usage records from the past year are supported.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
bss:FrDeductLogQueryRequest |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
No |
The instance ID for the filtered query. If this parameter is left empty, the details of all used instances are returned. |
oss-123123 |
| InstanceSpec |
string |
No |
The instance type. |
Instancetyp |
| CommodityCode |
string |
No |
The commodity code, such as ecsRi and scu_bag. If this parameter is specified, the ProdCode parameter does not take effect. |
ecsRi |
| DeductedInstanceId |
string |
No |
The ID of the deducted instance. If this parameter is left empty, the details of all instances are returned. |
oss-123123 |
| StartTime |
string |
Yes |
The start time. Format: YYYY-MM-dd HH:mm:ss. |
2019-05-23 12:00:00 |
| EndTime |
string |
Yes |
The end time. Format: YYYY-MM-dd HH:mm:ss. |
2019-05-23 12:00:00 |
| LastToken |
string |
No |
The token that specifies the start position of the query. Set this parameter to null for the first query. For subsequent queries, use the NextToken value returned in the previous response. |
CAESF***zNTAw |
| Limit |
integer |
No |
The number of entries to return per query. Default value: 20. Maximum value: 300. |
20 |
| IncludeShare |
boolean |
Yes |
Specifies whether to include the resource plan usage of member accounts in finance trusteeship. Valid values:
|
true |
| ProdCode |
string |
No |
The product code, such as ecs. |
oss |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Code |
string |
The status code. |
Success |
| Message |
string |
The error message. |
Successful! |
| RequestId |
string |
The request ID. |
DF58589C-A06C-4224-8615-7797E6474FA3 |
| Success |
boolean |
Indicates whether the request is successful. |
true |
| Data |
object |
The returned data. |
|
| NextToken |
string |
The token that specifies the start position of the next query. Pass this value to the LastToken parameter in the next request. If this parameter is returned as null, the query is complete. |
CAESF***zNTAw |
| DetailList |
object |
||
| DetailList |
array<object> |
The list of details. |
|
|
object |
|||
| DeductedInstanceId |
string |
The instance ID of the deducted instance. |
oss-123123 |
| InstanceId |
string |
The instance ID of the reserved instance. |
oss-123123 |
| DeductHours |
number |
The deduction coefficient. This parameter is valid only when the CommodityCode parameter is set to ecsRi. |
24 |
| ShareUid |
integer |
The UID of the account to which the deducted instance belongs.
|
1111111111 |
| DeductDate |
string |
The deduction date. Example format: YYYY/M/D HH:mm. |
2019/5/23 12:00 |
| InstanceSpec |
string |
The instance type of the deducted instance. |
rds.mysql.s3.large |
| DeductedCommodityCode |
string |
The commodity code of the deducted item. |
rds |
| DeductedProductDetail |
string |
The name of the deducted product. |
ApsaraDB RDS |
| DeductMeasure |
number |
The original metered amount. This indicates the actual amount of resources used by the user within a specific period, without any rule-based adjustments. |
1 |
| Region |
string |
The region in the metering data. This parameter can be empty. |
cn-hangzhou |
| DeductQuantity |
number |
The actual deducted computing power or capacity of the corresponding pay-as-you-go instance. Note
The actual deducted amount (DeductQuantity) is calculated based on the original metered amount (DeductMeasure) and specific deduction rules. |
1 |
| DeductFactorTotal |
number |
The total computing power or capacity of the RI or SCU during the specified time period. |
1 |
| ResCode |
string |
The billing item. |
PutRequest |
| Uid |
integer |
The UID of the deducted instance. |
1111111111 |
Examples
Success response
JSON format
{
"Code": "Success",
"Message": "Successful!",
"RequestId": "DF58589C-A06C-4224-8615-7797E6474FA3",
"Success": true,
"Data": {
"NextToken": "CAESF***zNTAw",
"DetailList": {
"DetailList": [
{
"DeductedInstanceId": "oss-123123",
"InstanceId": "oss-123123",
"DeductHours": 24,
"ShareUid": 1111111111,
"DeductDate": "2019/5/23 12:00",
"InstanceSpec": "rds.mysql.s3.large",
"DeductedCommodityCode": "rds",
"DeductedProductDetail": "云数据库RDS",
"DeductMeasure": 1,
"Region": "cn-hangzhou ",
"DeductQuantity": 1,
"DeductFactorTotal": 1,
"ResCode": "PutRequest",
"Uid": 1111111111
}
]
}
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InternalError | An error occurred in the internal server. | |
| 400 | InvalidOwner | The specified owner does not belong to caller. | |
| 400 | InvalidParameter | The specified request contains invalid parameters. | |
| 400 | MissingParameter | The specified request lacks essential parameters. | |
| 400 | NotApplicable | The specified API is not applicable for the user. | |
| 400 | NotAuthorized | The user is not authorized for the specified API. | |
| 400 | InvalidInstanceSpec | The specified Instance specification is not valid. | |
| 400 | InvalidQueryTime | The specified start time and end time are incorrect | |
| 400 | CommodityNotSupported | The specified commodity is not supported. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.