Queries the usage of resource plans, including reserved instances (RIs) and storage capacity units (SCUs).
Operation description
Limits:
Only usage records for the last 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 or 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 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 linked 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 |
| Data |
object |
The returned data. |
|
| DetailList |
object |
||
| DetailList |
array<object> |
The detail array. |
|
|
object |
|||
| DeductDate |
string |
The deduction date. Example format: YYYY/M/D HH:mm. |
2019/5/23 12:00 |
| DeductFactorTotal |
number |
The total computing power or capacity of the RI or SCU during the time period. |
1 |
| DeductHours |
number |
The deduction factor. This parameter is valid only when CommodityCode is set to ecsRi. |
24 |
| DeductMeasure |
number |
The original metered amount. This represents the actual amount of resources used by the user during a specific time period, without any rule-based adjustments. |
1 |
| DeductQuantity |
number |
The actual computing power or capacity deducted for 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 |
| DeductedCommodityCode |
string |
The deducted commodity code. |
rds |
| DeductedInstanceId |
string |
The instance ID of the deducted instance. |
oss-123123 |
| DeductedProductDetail |
string |
The name of the deducted commodity (product detail). |
ApsaraDB RDS |
| InstanceId |
string |
The instance ID of the reserved instance. |
oss-123123 |
| InstanceSpec |
string |
The instance type of the deducted instance. |
rds.mysql.s3.large |
| Region |
string |
The region in the metering data. This parameter can be empty. |
cn-hangzhou |
| ResCode |
string |
The billable item. |
PutRequest |
| ShareUid |
integer |
The UID of the account to which the deducted instance belongs.
|
1111111111 |
| Uid |
integer |
The UID of the deducted instance. |
1111111111 |
| NextToken |
string |
The token that specifies the start of the next query. Pass this value to the LastToken parameter in the next request. If this parameter is returned as null, it indicates that the query is complete. |
CAESF***zNTAw |
| 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 |
Examples
Success response
JSON format
{
"Code": "Success",
"Data": {
"DetailList": {
"DetailList": [
{
"DeductDate": "2019/5/23 12:00",
"DeductFactorTotal": 1,
"DeductHours": 24,
"DeductMeasure": 1,
"DeductQuantity": 1,
"DeductedCommodityCode": "rds",
"DeductedInstanceId": "oss-123123",
"DeductedProductDetail": "ApsaraDB RDS",
"InstanceId": "oss-123123",
"InstanceSpec": "rds.mysql.s3.large",
"Region": "cn-hangzhou ",
"ResCode": "PutRequest",
"ShareUid": 1111111111,
"Uid": 1111111111
}
]
},
"NextToken": "CAESF***zNTAw"
},
"Message": "Successful!",
"RequestId": "DF58589C-A06C-4224-8615-7797E6474FA3",
"Success": true
}
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.