Queries the usage of resource plans, including reserved instances (RIs) and storage capacity units (SCUs).
Operation description
Limits:
- Only the usage records within the past year can be queried.
Debugging
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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
bss:FrDeductLogQueryRequest | Read |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
InstanceId | string | No | The ID of the instance to query. If this parameter is not specified, the details of all used instances are returned. | oss-123123 |
InstanceSpec | string | No | The instance type of the instance. | Instancetyp |
CommodityCode | string | No | The code of the resource, such as ecsRi and scu_bag. If this parameter is specified, the ProdCode parameter does not take effect for the request. | ecsRi |
DeductedInstanceId | string | No | The ID of the deducted instance. If this parameter is not specified, the details of all instances are returned. | oss-123123 |
StartTime | string | Yes | The beginning of the time range to query. Specify the time in the YYYY-MM-DD HH:mm:ss format. | 2019-05-23 12:00:00 |
EndTime | string | Yes | The end of the time range to query. Specify the time in the YYYY-MM-DD HH:mm:ss format. | 2019-05-23 12:00:00 |
LastToken | string | No | The token that is used to retrieve the next page of results. For the first query, set the value to null. For subsequent queries, set the value to the token that is obtained from the NextToken parameter. | CAESF***zNTAw |
Limit | integer | No | The number of entries to return on each page. Default value: 20. Maximum value: 300. | 20 |
IncludeShare | boolean | Yes | Specifies whether to query the resource plan usage of linked accounts. Valid values:
| true |
ProdCode | string | No | The code of the service. Example: ecs. | oss |
Response parameters
Examples
Sample success responses
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": "ApsaraDB RDS\n",
"DeductMeasure": 1,
"Region": "cn-hangzhou ",
"DeductQuantity": 1,
"DeductFactorTotal": 1,
"ResCode": "PutRequest",
"Uid": 1111111111
}
]
}
}
}
Error codes
HTTP status code | Error code | Error message |
---|---|---|
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. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|