View your Qubole Compute Unit (QCU) Usage

Use this API to view Qubole Compute Unit (QCU) usage for an account between the given start and end dates based on the group_by parameter.

Note

The api.qubole.com, in.qubole.com, eu.qubole.com, us.qubole.com, and gcp.qubole.com environments currently support this API. For unsupported environments, a Data not available error is returned.

View QCU

GET /api/v1.2/qcuh_usages

Required Role

The following users can make this API call:

  • Users who belong to the system-user or system-admin group.

  • Users who belong to a group associated with a role that allows viewing an account’s details. See Managing Groups and Managing Roles for more information.

Use this API to see the QCU for your account.

Parameters

Note

Parameters marked in bold below are mandatory. Others are optional and have default values.

Parameter

Type

Description

Multiple values (if any)

start_date

String

The start date from which the you want the usage to be provided. If the group_by value is month, the start date is taken as the starting of the month in UTC as per the given start date.

No

Date format: yyyy-mm-dd

Sample date: 2019-12-25

end_date

String

The end date until which the you want the usage to be provided. If the group_by value is month, the end date is taken as the end of the month in UTC as per the given end date.

No

Date format: yyyy-mm-dd

Sample date: 2019-12-25

group_by

String

You can view the usage on a monthly basis based on this parameter.

“month”

Request API Syntax

curl -X GET -H "X-AUTH-TOKEN:<AUTH-TOKEN>" -H "Content-Type: application/json" -H "Accept: application/json" \
https://api.qubole.com/api/v1.2/qcuh_usages?start_date=<start_date>&end_date=<end_date>&group_by=month

Note

The above syntax uses https://api.qubole.com as the endpoint. Qubole provides other endpoints to access QDS that are described in Supported Qubole Endpoints on Different Cloud Providers.

Sample Request

curl -X GET -H "X-AUTH-TOKEN:<AUTH-TOKEN>" -H "Content-Type: application/json" -H "Accept: application/json" \
https://api.qubole.com/api/v1.2/qcuh_usages?start_date=2019-06-15&end_date=2019-06-25&group_by=month

Sample Response

{
"qcuh_usages": [
    {
        "spot": 0,
        "ondemand": 43777.91522825,
        "month": "2019-06-01 00:00:00"
    }
      ],
"last_updated_qcuh": "2019-07-25T06:00:00Z"
}

Note

The total QCU value is divided between the spot and on-demand utilization based on their respective usage. QCU is automatically calculated by Qubole at fixed intervals. The last_updated_qcuh field provides details of the last time the QCU was calculated.