All Products
Search
Document Center

Dynamic Content Delivery Network:DescribeKvUsageData

Last Updated:Apr 11, 2024

Queries the usage data of KV storage.

Operation description

  • 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 granularityMaximum time range per queryHistorical data availableData delay
1 hour31 days90 days3 to 4 hours

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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.
OperationAccess levelResource typeCondition keyAssociated operation
dcdn:DescribeKvUsageDataRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
NamespaceIdstringNo

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****
StartTimestringNo

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
EndTimestringNo

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
FieldstringYes

The type of the request data. Set the value to acc.

acc
AccessTypestringNo

The request method. If the parameter is empty, data about all methods is returned. Valid values:

  • get
  • put
  • list
  • delete
get
ResponseTypestringNo

The type of the response data. Valid values:

  • detail: detailed data
  • total: summary data

Default value: detail.

detail
SplitBystringNo

The key that is used to group data. Valid values: type and namespace.

  • type: Data is grouped by time. The data in the last 5 minutes is returned.
  • namespace: Data is grouped by namespace and is not padded with zeros.
  • Default value: type.

If ResponseType is set to total, data to return is not grouped by namespace but by type.

type

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The request ID.

9732E117-8A37-49FD-A36F-ABBB87556CA7
StartTimestring

The beginning of the time range during which data was queried.

2022-11-06T16:00:00Z
EndTimestring

The end of the time range during which data was queried.

2022-11-18T15:59:59Z
KvUsageDataobject []

The detailed usage data.

TimeStampstring

The timestamp of the data returned.

2022-11-14T15:00:03Z
NamespaceIdstring

The ID of the namespace. This parameter is returned only if SplitBy is set to namespace.

534167033424646144
AccessTypestring

The request method. This parameter is returned only if SplitBy is set to type.

get
Acclong

The number of visits.

1340000

Examples

Sample success responses

JSONformat

{
  "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 codeError codeError messageDescription
400InvalidStartTime.MalformedThe 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.
400InvalidEndTime.MalformedThe 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.
400InvalidEndTime.MismatchThe specified EndTime is earlier than the StartTime.The end time is earlier than the start time.
400InvalidTimeSpanThe time span exceeds the limit.The time span exceeds the limit. Configure a valid time span as described in API documentation.
400InvalidStartTime.ValueNotSupportedThe specified StartTime is invalid.The specified start time is invalid.
400InvalidParameterFieldThe specified Field is invalid.The Field parameter is set to an invalid value.

For a list of error codes, visit the Service error codes.