Skip to main content

Usage

With this API, you can retrieve the count of Dremio Consumption Units (DCU) used by jobs run within projects or on engines within projects. The DCUs are added together by hour or by day. You can retrieve the usage for various time periods up to one year in the past.

note:

There is a lag of between one to two hours between the time that a job ends and the time that the number of DCUs used by the job is available to be added into results returned by this API.

Usage Object
{
"id": "95c31978-63c6-437c-9501-951cd712fdc6",
"type": "PROJECT",
"startTime": "2021-07-21T17:00:00Z",
"endTime": "2021-07-21T18:00:00Z",
"usage": 7.2
}

Usage Attributes

{{< api-section file="data/api/usage.json" data="usageAttributes" >}}

Usages Object
{
"data": [
{
Usage object
},
{
Usage object
},
...
],
"previousPageToken": "",
"nextPageToken": "CAIaBkhPVVJMWSIGRU5HSU5FKAI="
}

Usages Attributes

{{< api-section file="data/api/usage.json" data="usagesAttributes" >}}

Pagination Parameters

{{< api-section file="data/api/usage.json" data="pagination" >}}

Retrieving Usage Objects

Retrieves a paginated array of usage objects for all projects or engines in the organization that the requestor belongs to. The default is all projects, with 20 usage objects per page.

Retrieving Usage Objects
GET /v0/usage

Parameters

{{< api-section file="data/api/usage.json" data="getUsageParameters" >}}

Examples of Requests

This example retrieves thirty usage objects (one for each of the past thirty days) for the project that has the ID specified in the filter. For each day, the usages of the jobs that ran in the project that day are added together.

Example 1
curl -X GET "http://api.dremio.cloud/v0/usage?filter=id=='671653b1-5a63-44db-a88e-1aa89cecf0d0'" \
-H "Authorization: Bearer <Authorization token>" \
-H "Content-Type: application/json"

This example uses the token from either the previousPageToken or nextPageToken of a usages object to retrieve the previous or next page of usage objects. The example also specifies to retrieve only up to ten usage objects. Each usage object represents an hour of usage. No filter is specified, so the request retrieves the amount of usage for each project and engine in the organization connected to, and for the default of the previous thirty days.

note:

Except for the value of the pageToken parameter, the values of all of the other parameters are the same as they were in previous requests for subsets of the same set of usage objects. Changing the value of maxResults would change the number of usage objects returned per page, therefore changing the pagination. Changing the value of frequency, groupBy, or both would retrieve an entirely different set of usage objects. So, too, would using a non-default values for filter.

Example 2
curl -X GET "http://dcs-aws-9315-ns.api.drem.io/v0/usage?pageToken=CAIaBkhPVVJMWSIGRU5HSU5FKAI=&maxResults=10&frequency=HOURLY&groupBy=ENGINE" \
-H "Authorization: Bearer JJ+PU3feQDG5eB5MyGlKWrVyx3eorNEWlS82NoWSKakQUwQiiWsrFHu28DMATg==" \
-H "Content-Type: application/json"

Responses

{{< api-responses file="data/api/usage.json" data="usageResponses" >}}