The Control Center interface in Domino provides several views about deployment usage, broken down by hardware tier, project, or user. However, if you want to do a more detailed, custom analysis, you can use the API to export Control Center data for examination with Domino’s data science features or external business intelligence applications.
The endpoint that serves this data is /v4/gateway/runs/getByBatchId
.
See REST documentation on this endpoint, or continue reading for a detailed description plus examples.
Prerequisites
-
The API key for your account.
-
You must have an administrator account to access the full deployment’s Control Center data.
-
Log in as an administrator, click your username, then click Account Settings.
images:/images/4.x/Screen_Shot_2018-10-09_at_1.41.17_PM.png[]
-
Under Account Settings, click API Key.
-
Copy the key and store it carefully. You’ll need it to make requests to the API.
Caution
-
Domino recommends repeating this process on 60-day intervals to maintain security best practices.
The following is a basic call to the data export endpoint, executed with curl:
curl --include -H "X-Domino-Api-Key: <your-api-key>" \
'https://<your-domino-url>/v4/gateway/runs/getByBatchId'
By default, the endpoint starts with the oldest available run data, beginning from January 1st, 2018. Older data isn’t available. The command also has a default limit of 1000 runs worth of data. As written, the preceding call returns data on the oldest 1000 runs available.
To try this example, enter your-api-key
and your-domino-url
in the previous command.
The standard JSON response object you receive has the following scheme:
{
"runs": [
{
"batchId": string,
"runId": string,
"title": string,
"command": string,
"status": string,
"runType": string,
"userName": string,
"userId": string,
"projectOwnerName": string,
"projectOwnerId": string,
"projectName": string,
"projectId": string,
"runDurationSec": integer,
"hardwareTier": string,
"hardwareTierCostCurrency": string,
"hardwareTierCostAmount": number,
"queuedTime": date-time ,
"startTime": date-time,
"endTime": date-time,
"totalCostCurrency": string,
"totalCostAmount": number,
"computeClusterDetails : {
"computeClusterType": string,
"masterHardwareTierId": string,
"masterHardwareTierCostPerMinute": number,
"workerCount": integer,
"workerHardwareTierId": string,
"workerHardwareTierCostPerMinute": number
}
}
],
"nextBatchId": string
}
The Control Center gives each run recorded a batchId
, which is an incrementing field that can be used as a cursor to fetch data in multiple batches.
You can see in the previous response, after the array of runs
objects, a nextBatchId
parameter points to the next run to include.
Use that ID as a query parameter in a subsequent request to get the next batch:
curl --include \
-H "X-Domino-Api-Key: <your-api-key>" \
'https://<your-domino-url>/v4/gateway/runs/getByBatchId?batchId=<your-batchId-here>'
You can also include a header with Accept: text/csv
to request the data as CSV.
On the Unix shell, you can write the response to a file with the >
operator.
This is a quick way to get data suitable for import into analysis tools:
curl --include \
-H "X-Domino-Api-Key: <your-api-key>" \
-H 'Accept: text/csv' \
'https://<your-domino-url>/v4/gateway/runs/getByBatchId' > your_file.csv
The following API call retrieves all workspaces.
GET /controlCenter/utilization/runsPerDay
curl -X GET "<your-domino-url>/v4/controlCenter/utilization/runs?startDate=20220503&endDate=20220503" -H "accept: application/json"
Parameter | Required? | Description |
---|---|---|
projectId | N | |
startingUserId | N | |
organizationId | N | |
hardwareTierId | N | |
startDate | Y | Range must be in YYYYMMDD format |
endDate | Y | Range must be in YYYYMMDD format |