list-allocations
dci list-allocations [flags]
Returns a list of allocations that your account has access to. Allocations are listed in reverse chronological order by default.
CLI default view
dci list-allocations presents a curated table by default:
- Columns:
name(a clickable link to the allocation in the DoiT console in interactive terminals),owner,type,folder(folderIdresolved to the folder name; blank for top-level allocations), andupdated (UTC). - In interactive tables,
updated (UTC)renders in your local timezone and is titledupdated (local); machine formats, agent mode, and--utckeep UTC — see Timestamps and timezones. - Rows are sorted by last update, newest first.
--output jsonand explicit-C/--fieldsselections return the raw fields documented below.
Examples
# Your allocations, newest update first.
dci list-allocations
# Custom (non-preset) allocations only, sorted by name.
dci list-allocations --filter type:custom --sort-by name --sort-order asc
# Allocations in one folder whose name contains a word (ANDs with --filter).
dci list-allocations --filter folderId:<folder-id> --name-contains backyard
# Every page as JSON, for scripts.
dci list-allocations --all --output json
# Browse in the full-screen viewer; Enter prints the selected allocation's id.
dci list-allocations -M interactive
Flags
| Flag | Type | Default | Example | Description |
|---|---|---|---|---|
--max-results | integer (int64) | 50 | The maximum number of results to return in a single page. Use the page tokens to iterate through the entire collection. | |
--page-token | string | Page token, returned by a previous call, to request the next page of results | ||
--filter | string | type:custom | An expression for filtering the results. Valid fields: type, owner, name, folderId. | |
--name-contains | string | monthly spend | Case-insensitive substring match against the resource name. Combined with the "filter" parameter using AND semantics. | |
--sort-by | string | A field by which the results will be sorted. One of: "id", "name", "owner", "description", "type", "createTime", "updateTime". | ||
--sort-order | string | Specifies the sort direction; accepts asc for ascending (lowest to highest) or desc for descending (highest to lowest). One of: "asc", "desc". |
Every command also accepts the CLI-wide flags for output shaping — see Output formats and Table output options.
Output
OK - The request succeeded.
By default dci renders the result as a table. Use --output json to get the full structure described below — see Output formats.
| Field | Type | Description |
|---|---|---|
pageToken | string | Page token, returned by a previous call, to request the next page of results. |
rowCount | integer | Total number of allocations in the result set. |
allocations | array of object | |
allocations[].id | string | Allocation ID. |
allocations[].name | string | Allocation name. |
allocations[].owner | string | Allocation owner. |
allocations[].description | string | Allocation description. |
allocations[].type | string | Type of allocation (preset or custom). |
allocations[].allocationType | string | Composition type of allocation (single or group). One of: "single", "group". |
allocations[].createTime | integer (int64) | The time when the allocation was created (in UNIX timestamp). |
allocations[].updateTime | integer (int64) | Last time the allocation was modified (in UNIX timestamp). |
allocations[].urlUI | string | URL to view the allocation in the DoiT console. |
allocations[].folderId | string | Identifier of the folder that contains the allocation. Set to "root" if the allocation is at the top level (not in a folder). Default: "root". |
allocations[].anomalyDetection | boolean | Whether anomaly detection is enabled for this allocation. Only applicable to single allocations. |
Raw JSON schema
{
"type": "object",
"properties": {
"pageToken": {
"type": "string",
"description": "Page token, returned by a previous call, to request the next page of results."
},
"rowCount": {
"type": "integer",
"description": "Total number of allocations in the result set."
},
"allocations": {
"type": "array",
"items": {
"type": "object",
"description": "Summary information for an allocation.",
"properties": {
"id": {
"type": "string",
"description": "Allocation ID."
},
"name": {
"type": "string",
"description": "Allocation name."
},
"owner": {
"type": "string",
"description": "Allocation owner."
},
"description": {
"type": "string",
"description": "Allocation description."
},
"type": {
"type": "string",
"description": "Type of allocation (preset or custom)."
},
"allocationType": {
"type": "string",
"description": "Composition type of allocation (single or group).",
"enum": [
"single",
"group"
]
},
"createTime": {
"type": "integer",
"description": "The time when the allocation was created (in UNIX timestamp).",
"format": "int64"
},
"updateTime": {
"type": "integer",
"description": "Last time the allocation was modified (in UNIX timestamp).",
"format": "int64"
},
"urlUI": {
"type": "string",
"description": "URL to view the allocation in the DoiT console."
},
"folderId": {
"type": "string",
"description": "Identifier of the folder that contains the allocation. Set to \"root\" if the allocation is at the top level (not in a folder).",
"default": "root",
"example": "root"
},
"anomalyDetection": {
"type": "boolean",
"description": "Whether anomaly detection is enabled for this allocation. Only applicable to single allocations."
}
}
}
}
}
}
Errors
On failure, dci prints a single error message — with a hint when one is available — and exits with a typed code your scripts can branch on. See Errors and exit codes for the full contract.
HTTP status to exit code mapping
| HTTP status | Exit code | Error code | Meaning |
|---|---|---|---|
| 400 | 30 | VALIDATION_ERROR | The arguments or request body were rejected. Review the command's flags and payload. |
| 401 | 10 | AUTHENTICATION_FAILED | Not signed in, or the API token is invalid. Run dci login or check DCI_API_KEY. |
| 403 | 11 | PERMISSION_DENIED | The DoiT user or the active customer context does not have access. |
| 404 | 20 | RESOURCE_NOT_FOUND | The requested resource does not exist. Check the identifier argument. |
Related
- get-allocation — Retrieve an allocation
- create-allocation — Create an allocation
- update-allocation — Update an allocation
- delete-allocation — Delete an allocation
- API reference: GET /analytics/v1/allocations
Aliases: listallocations