list-dimensions
dci list-dimensions [flags]
Returns a list of the dimensions that your account has access to.
--filter matches a single field:value term exactly (type:system_label,
label:team). Globs, substrings, and multi-term expressions are not supported,
and an unrecognized expression is silently ignored and returns the unfiltered
listing. To search, use --search <text>: a client-side, case-insensitive
substring match over every text field, which fetches every page first
(searchDropped records how many items were filtered out). The collection
can run to about a thousand dimensions across some twenty pages, so --all
or --search is usually what you want.
Examples
# The first page of dimensions your account can group and filter by.
dci list-dimensions
# One dimension type only (a single exact field:value term; fields are type, label, key).
dci list-dimensions --filter type:system_label
# Find dimensions for a topic by substring, across the whole collection.
dci list-dimensions --search genai
# Every dimension as JSON, sorted by label, for scripts.
dci list-dimensions --all --sort-by label --sort-order asc --output json
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 | An expression for filtering the results. The fields eligible for filtering are: type, label, key. | ||
--sort-by | string | A field by which the results will be sorted. One of: "type", "label", "key", "timestamp". | ||
--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 |
|---|---|---|
dimensions | array of object | Array of dimensions. |
dimensions[].id | string | The identifier of the dimension. |
dimensions[].label | string | The label of the dimension. |
dimensions[].type | string | Dimension filter type. Always pair type with id on scope filters. Discover valid id + type pairs for your account with GET /analytics/v1/dimensions. allocation_rule replaces attribution; allocation replaces attribution_group. One of: "datetime", "fixed", "optional", "label", "tag", "project_label", "system_label", "attribution", "attribution_group", "allocation", "allocation_rule", "gke", …. |
pageToken | string | |
rowCount | integer (int64) |
Raw JSON schema
{
"type": "object",
"description": "Paged list of available dimensions.",
"properties": {
"dimensions": {
"type": "array",
"description": "Array of dimensions.",
"items": {
"type": "object",
"description": "Summary information about a dimension.",
"properties": {
"id": {
"type": "string",
"description": "The identifier of the dimension."
},
"label": {
"type": "string",
"description": "The label of the dimension."
},
"type": {
"description": "Dimension filter type. Always pair `type` with `id` on scope filters. Discover valid `id` + `type` pairs for your account with `GET /analytics/v1/dimensions`. `allocation_rule` replaces `attribution`; `allocation` replaces `attribution_group`.",
"type": "string",
"enum": [
"datetime",
"fixed",
"optional",
"label",
"tag",
"project_label",
"system_label",
"attribution",
"attribution_group",
"allocation",
"allocation_rule",
"gke",
"gke_label"
],
"x-enumDescriptions": {
"fixed": "Standard built-in billing dimensions (Service, Provider, Project/Account ID, SKU, Region, etc.).",
"label": "Customer-defined resource labels; id is the label key, values are label values.",
"tag": "AWS cost allocation tags; id is the tag key.",
"project_label": "Google Cloud project-level labels; id is the label key.",
"system_label": "DoiT- or provider-generated system labels; id is the system label key.",
"optional": "Console grouping for label/tag keys; use label, tag, project_label, or system_label in API scopes.",
"datetime": "Time dimensions (Year, Month, Day) for date-based filtering or grouping.",
"allocation_rule": "Allocation rule filter; id must be allocation_rule, values are rule IDs.",
"allocation": "Allocation group filter; id is the allocation group ID.",
"gke": "Google Kubernetes Engine cost-allocation dimensions.",
"gke_label": "GKE workload labels; id is the label key.",
"attribution": "Deprecated. Use allocation_rule.",
"attribution_group": "Deprecated. Use allocation."
}
}
}
}
},
"pageToken": {
"type": "string"
},
"rowCount": {
"type": "integer",
"format": "int64"
}
}
}
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-dimension — Retrieve a dimension
- query — Run a query
- create-report — Create a report
- API reference: GET /analytics/v1/dimensions
Aliases: listdimensions