Queries the usage data of an Alibaba Cloud service.
Operation description
You can call this operation to query the usage data of an Alibaba Cloud service. Take note of the following items:
-
The service code that you specify for querying the usage data of a specific Alibaba Cloud service must be valid. You can query the usage data by hour or by day.
-
The time that you specify must follow the ISO8601 standard in the yyyy-MM-ddTHH:mm:ssZ format.
- Latency exists in data pushes. Therefore, if you set the DataType parameter to Hour, the integrity of usage data recorded in the last 24 hours can be ensured. If you set the DataType parameter to Day, the integrity of usage data recorded in the last two days can be ensured.
- You can query the usage data that is recorded in the last quarter.
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:DescribeUserOmsData | READ |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
Table | string | Yes | The service whose usage data you want to query and the details of the usage data. The parameter value is usually set to the code of a service. Various usage models are provided for different services. | rds |
DataType | string | Yes | The time type of the usage data. Set the parameter based on the description in the documentation of the specified service. Valid values:
| Hour |
StartTime | string | Yes | The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. | 2020-02-20T12:00:00Z |
EndTime | string | Yes | The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. | 2020-02-21T12:00:00Z |
Marker | string | No | The name of the record from which the usage data starts to return. The usage data records whose names are alphabetically after the value of the Marker parameter are returned. By default, the usage data starts to return from the earliest record. | NextToken |
PageSize | integer | No | The number of entries to return on each page. Valid values: 1 to 200. Default value: 100. | 1 |
Response parameters
Examples
Sample success responses
JSON
format
{
"Code": "Success",
"Message": "Successful!",
"RequestId": "6000EE23-274B-4E07-A697-FF2E999520A4",
"Success": true,
"Data": {
"Marker": "NextToken",
"HostId": "cn",
"OmsData": [
[
{
"SyncIn": "0",
"Bucket": "quota_for_get_service_",
"NetworkIn": "0",
"PutRequest": "1",
"NetworkOut": "0",
"GetRequest": "0",
"ProcessImgSize": "0",
"SyncOut": "0",
"Storage": "0",
"Region": "ap-northeast-1",
"ProviderId": "26842",
"CdnIn": "0",
"EndTime": "2019-09-03T16:00:00Z",
"StartTime": "2019-09-02T16:00:00Z",
"StorageType": "standard",
"CdnOut": "0"
}
]
]
}
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | NotApplicable | This API is not applicable for caller. | - |
400 | NotAuthorized | This API is not authorized for caller. | - |
400 | InvalidOwner | The specified owner doesn't belong to caller. | Invalid user identity. |
500 | InternalError | The request processing has failed due to some unknown error. | - |
For a list of error codes, visit the Service error codes.