Skip to main content

Query CCU usage of a cluster

Queries the CCU usage of a CelerData cluster.

NOTE

This operation requires the View and manage billing privilege.

Request

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

Path variables

ParameterExample valueRequiredTypeDescription
cluster_id4ae48a3f-f840-46fa-b0e7-0709a220fa40YesStringThe ID of the cluster. You can sign in to the CelerData Cloud BYOC console and then navigate to the Cluster properties section of the cluster's Overview page to obtain the cluster ID.

:<variable_name> indicates a URL path variable in web development tools such as Postman. :cluster_id in the above URL path, as such, indicates the ID of the cluster you want to query. However, if you use other tools such as curl, you need to replace :cluster_id with the actual cluster ID by hand in the curl command.

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_detailtrueYesBooleanWhether to return CCU usage details on a daily basis.

Response

Sample response

{
"code":20000,
"data":{
"cluster_id":"82964bc5-a8ce-4236-9fe6-1ad1e0f80e15",
"cluster_name":"test_privilege_30-wybing",
"total_usage":"87.025277",
"details":[
{
"usage":"18.130654",
"date":20230703
}
]
}
}

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:
  • cluster_id
  • cluster_name
  • total_usage
  • details
data.cluster_id82964bc5-a8ce-4236-9fe6-1ad1e0f80e15StringThe ID of the cluster queried.
data.cluster_nametest_privilege_30-tomStringThe name of the cluster queried.
data.total_usage87.025277StringThe total CCU usage of the cluster over the selected time range.
data.details-ArrayThe CCU usage details of the cluster 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 cluster on each specific date, which are presented as an object. Each object consists of the following elements:
  • usage
  • date
data.details.0.usage18.130654StringThe usage on a specific date.
data.details.0.date20230703IntegerThe specific date.
messageparam start_date is invalidStringThe 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.