Skip to main content

Query CCU usage of the logged-in account

Queries the CCU usage of the logged-in account.

Request

Basic information
HTTP URLhttps://cloud-api.celerdata.com/api/1.0/usages
HTTP methodGET
Frequency600/minute

Header parameters

ParameterExample valueRequiredTypeDescription
AuthorizationBearer OGQ5MDA4MZGTNJMWNS0ZY2Y2LWFJNZYTOTBINMZIYTGZZDUYYesStringThe access token used to access the CelerData Cloud BYOC API. Format: Bearer <access_token>.

See Obtain access token.

Query parameters

ParameterExample valueRequiredTypeDescription
start_date20230701YesStringThe start date of the time range to query. Format: yyyyMMdd.
end_date20230731YesStringThe end date of the time range to query. Format: yyyyMMdd.
The start_date must be less than or equal to the end_date, and the result of subtracting start_date from start_date must range from 0 to 31.
show_detailtrueNoBooleanWhether to return CCU usage details on a daily basis.

Response

Sample response

{
"code":20000,
"data":{
"account_id":"lbyx0bt7a",
"total_usage":"1534.833393",
"details":[
{
"usage":"48.000000",
"date":20230701
}
]
}
}

Response elements

ParameterExample valueTypeDescription
code20000IntegerThe error code. If the error code returned is 20000, the request succeeded. If any other error code is returned, the request failed.
data-ObjectThe result of the API call. The data object may not be returned for some API actions. It consists of the following elements:
  • account_id
  • usage
  • details
data.account_idlbyx0bt7aStringThe ID of the account queried.
data.total_usage1534.833393StringThe total CCU usage of the account over the selected time range.
data.details-ArrayThe CCU usage details of the account over the selected time range. details is an array that consists of one or more objects, each of which consists of the CCU usage details on a specific date, depending on the number of days within the selected time range.
The details array is returned only when the show_detail parameter in the request is set to true.
data.details.0-ObjectThe CCU usage details of the account on each specific date, which are presented as an object. Each object consists of the following elements:
  • usage
  • date
data.details.0.usage48.000000StringThe usage on a specific date.
data.details.0.date20230701IntegerThe specific date.
messageThe time range is out of limits.max:31 daysStringThe error message. This element is returned only when the code returned is not 20000.
NOTICE
Do not conclude whether a request succeeded or failed based on the return value of message.