メインコンテンツへスキップ

list-dimensions

dci list-dimensions [flags]

Returns a list of the dimensions that your account has access to.

Filtering versus searching

--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

FlagTypeDefaultExampleDescription
--max-resultsinteger (int64)50The maximum number of results to return in a single page. Use the page tokens to iterate through the entire collection.
--page-tokenstringPage token, returned by a previous call, to request the next page of results
--filterstringAn expression for filtering the results. The fields eligible for filtering are: type, label, key.
--sort-bystringA field by which the results will be sorted. One of: "type", "label", "key", "timestamp".
--sort-orderstringSpecifies 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.

FieldTypeDescription
dimensionsarray of objectArray of dimensions.
dimensions[].idstringThe identifier of the dimension.
dimensions[].labelstringThe label of the dimension.
dimensions[].typestringDimension 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", ….
pageTokenstring
rowCountinteger (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 statusExit codeError codeMeaning
40030VALIDATION_ERRORThe arguments or request body were rejected. Review the command's flags and payload.
40110AUTHENTICATION_FAILEDNot signed in, or the API token is invalid. Run dci login or check DCI_API_KEY.
40311PERMISSION_DENIEDThe DoiT user or the active customer context does not have access.
40420RESOURCE_NOT_FOUNDThe requested resource does not exist. Check the identifier argument.

Aliases: listdimensions