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

list-gcp-billing-accounts-settings

dci list-gcp-billing-accounts-settings [flags]

Returns one item per onboarded GCP Billing Account. Each item includes that billing account's recommendation and automation engine settings for each product line activated on it, per region scope: one global entry for compute, and one entry per known region for cloud_sql.

Cloud SQL regions come from the billing account's persisted settings: a region is added when eligible spend is first seen there and is never removed, so its settings entry remains listed even if spend later drops to zero. Items are sorted by billingAccountId; within an item, services lists compute before cloud_sql, with cloud_sql regions sorted alphabetically.

Settings are stored independently on each billing account. Existing customer-level settings are copied lazily when an account is first read or initialized; if no valid legacy value exists, the complete backend defaults are materialized once on the account. Only product lines that are activated/onboarded for a given billing account are returned.

In the DoiT Console, these settings are edited on an account's Settings tab.

Flags​

FlagTypeDefaultExampleDescription
--page-tokenstringOpaque cursor token returned by a previous list response. Omit to start from the beginning; an empty or absent token in a response means there are no more results. Do not parse it. A structurally invalid cursor returns 400 with code pagination_token_invalid; an expired cursor returns 400 with code pagination_token_expired — restart pagination from the beginning.
--max-resultsinteger50Maximum number of items to return. Server may return fewer. Defaults to 50; maximum 500.

Every command also accepts the CLI-wide flags for output shaping — see Output formats and Table output options.

Output​

Settings payload for one onboarded GCP Billing Account, broken down by activated product line (services[].settings).

By default dci renders the result as a table. Use --output json to get the full structure described below — see Output formats.

FieldTypeDescription
itemsarray of object
items[].billingAccountIdstringGCP Billing Account ID.
items[].servicesarray of objectSettings for each product line and region scope activated on this billing account, ordered compute first, then cloud_sql regions alphabetically.
items[].services[].servicestringProduct line these settings apply to. One of: "compute", "cloud_sql".
items[].services[].regionstringRegion scope these settings apply to, in lower_snake_case wire form (for example us_east1). Always global for compute; always a concrete region (never global) for cloud_sql.
items[].services[].settingsobjectCommitment settings for this product line and region.
items[].services[].settings.purchaseModestringWhether purchases execute automatically or require customer approval before the planner proceeds. Configured in the DoiT Console Settings tab; this settings API is read-only. One of: "autonomous", "requires_approval".
items[].services[].settings.minimumCommitmentnumber (double)Minimum hourly commitment amount (USD) per purchase step.
items[].services[].settings.lastDayOfMonthForPurchaseintegerLatest calendar day of the month on which a purchase may be scheduled.
items[].services[].settings.maximumCommitmentnumber (double)Maximum total hourly commitment (USD). 0 means no cap.
items[].services[].settings.termstringPreferred commitment term length for new purchases.
items[].services[].settings.policystringCoverage target policy for recommendations and purchases (built-in or customer-defined).
pageTokenstringOpaque cursor for the next page. Absent when this is the last page.
rowCountinteger (int64)Number of items returned in this page.
Raw JSON schema
{
"type": "object",
"required": [
"items"
],
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"required": [
"billingAccountId",
"services"
],
"properties": {
"billingAccountId": {
"type": "string",
"description": "GCP Billing Account ID.",
"example": "01D4A2-4E3F1B-9C72A0"
},
"services": {
"type": "array",
"items": {
"type": "object",
"required": [
"service",
"region",
"settings"
],
"properties": {
"service": {
"type": "string",
"enum": [
"compute",
"cloud_sql"
],
"description": "Product line these settings apply to."
},
"region": {
"allOf": [
{
"type": "string",
"pattern": "^(global|[a-z]+(_[a-z0-9]+)+)$",
"description": "GCP region scope in the DCI `lower_snake_case` wire form (for example `us_east1`), or the\nliteral `global` for cross-region scopes. This is not the raw provider spelling (`us-east1`);\nthe same pattern applies to the `region` query parameter. Regions are discovery-driven, so the\nlist is open rather than an enum.",
"example": "us_east1"
}
],
"description": "Region scope these settings apply to, in `lower_snake_case` wire form (for example `us_east1`). Always `global` for `compute`; always a concrete region (never `global`) for `cloud_sql`."
},
"settings": {
"allOf": [
{
"type": "object",
"description": "Recommendation and automation engine settings for one product line on a GCP billing account.",
"required": [
"purchaseMode",
"minimumCommitment",
"lastDayOfMonthForPurchase",
"maximumCommitment",
"term",
"policy"
],
"properties": {
"purchaseMode": {
"type": "string",
"enum": [
"autonomous",
"requires_approval"
],
"description": "Whether purchases execute automatically or require customer approval before the planner proceeds. Configured in the DoiT Console Settings tab; this settings API is read-only.",
"x-enumDescriptions": {
"autonomous": "Purchases execute automatically within configured commitment limits. Set in the DoiT Console (Autonomous Purchasing).",
"requires_approval": "Purchases wait for customer approval in the DoiT Console before execution. Default mode; set in Console Settings."
}
},
"minimumCommitment": {
"type": "number",
"format": "double",
"description": "Minimum hourly commitment amount (USD) per purchase step."
},
"lastDayOfMonthForPurchase": {
"type": "integer",
"description": "Latest calendar day of the month on which a purchase may be scheduled."
},
"maximumCommitment": {
"type": "number",
"format": "double",
"description": "Maximum total hourly commitment (USD). `0` means no cap."
},
"term": {
"allOf": [
{
"type": "string",
"enum": [
"one_year",
"three_year"
],
"description": "Preferred or actual commitment term length for Savings Plans and related settings.",
"x-enumDescriptions": {
"one_year": "One-year commitment term.",
"three_year": "Three-year commitment term."
}
}
],
"description": "Preferred commitment term length for new purchases."
},
"policy": {
"allOf": [
{
"type": "string",
"description": "ID of a commitment policy: either one of the built-in policies — `conservative` (lower\ncoverage target, ~65%), `balanced` (moderate, ~80%), `max_savings` (aggressive, ~90%) — or the\nID of a policy the customer defined in the DoiT Console. One catalog is shared by AWS and GCP,\nand the same policy may be assigned to any AWS organization or GCP billing account product\nline. Custom policies make this an open list, so it is not an enum; treat the value as an\nopaque identifier and use the commitment-policies endpoint to resolve it.",
"example": "balanced"
}
],
"description": "Coverage target policy for recommendations and purchases (built-in or customer-defined)."
}
}
}
],
"description": "Commitment settings for this product line and region."
}
}
},
"description": "Settings for each product line and region scope activated on this billing account, ordered `compute` first, then `cloud_sql` regions alphabetically."
}
}
}
},
"pageToken": {
"type": "string",
"description": "Opaque cursor for the next page. Absent when this is the last page.",
"nullable": true
},
"rowCount": {
"type": "integer",
"format": "int64",
"description": "Number of items returned in this page."
}
}
}

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.
500, 50340API_SERVER_ERRORThe API failed to process the request. Retryable; contact DoiT support if it persists.

Aliases: listgcpbillingaccountssettings