Queries the usage data of KV storage.
Operation description
Note* You can call this operation up to 5 times per second per account.
- The usage data indicates the number of requests.
Time granularity: This operation supports only the time granularity of 1 hour.
Time granularity | Time range to query | Historical data available | Data latency |
---|---|---|---|
1 hour | 31 days | 90 days | 3 to 4 hours |
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:
- For mandatory resource types, indicate with a prefix of * .
- 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 |
---|---|---|---|---|
dcdn:DescribeKvUsageData | get | *All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
NamespaceId | string | No | The namespace ID. If the parameter is empty, data about all namespaces is returned. You can specify a maximum number of 30 namespace IDs and separate them with commas (,). | 12423131231**** |
StartTime | string | No | 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. The minimum data granularity is 1 hour. If you do not specify this parameter, the data in the last seven days is returned. | 2022-08-10T00:00:00Z |
EndTime | string | No | 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. | 2022-08-10T23:59:59Z |
Field | string | Yes | The type of the request data. Set the value to acc. | acc |
AccessType | string | No | The request method. If the parameter is empty, data about all methods is returned. Valid values:
| get |
ResponseType | string | No | The type of the response data. Valid values:
Default value: detail. | detail |
SplitBy | string | No | The key that is used to group data. Valid values: type and namespace.
If ResponseType is set to total, data to return is not grouped by namespace but by type. | type |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "9732E117-8A37-49FD-A36F-ABBB87556CA7",
"StartTime": "2022-11-06T16:00:00Z",
"EndTime": "2022-11-18T15:59:59Z",
"KvUsageData": [
{
"TimeStamp": "2022-11-14T15:00:03Z",
"NamespaceId": "534167033424646144",
"AccessType": "get",
"Acc": 1340000
}
]
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidStartTime.Malformed | The specified StartTime parameter is invalid. | The format of the specified start time is invalid. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. |
400 | InvalidEndTime.Malformed | The specified EndTime is invalid. | The format of the specified end time is invalid. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. |
400 | InvalidEndTime.Mismatch | The specified EndTime is earlier than the StartTime. | The end time is earlier than the start time. |
400 | InvalidTimeSpan | The time span exceeds the limit. | The time span exceeds the limit. Configure a valid time span as described in API documentation. |
400 | InvalidStartTime.ValueNotSupported | The specified StartTime is invalid. | The specified start time is invalid. |
400 | InvalidParameterField | The specified Field is invalid. | The Field parameter is set to an invalid value. |
For a list of error codes, visit the Service error codes.