list-gcp-recommendations
dci list-gcp-recommendations <billingAccountId> [flags]
Returns commitment purchase recommendations for the billing account, filtered to the
term preferred in the customer's compute settings (preferredCommitmentPeriod).
gcp_service and region filters: a gcp_service is required to select which product
line's settings determine the term — omitting both returns no recommendations. Supply
gcp_service alone to return all regions for that service; supply both to return a single
service/region scope. region requires gcp_service — a request with region but no
gcp_service returns 400 with code gcp_service_required. Invalid gcp_service or
region values return 400. In v1 the only supported values are gcp_service=compute
and region=global.
404 is returned only when the billing account does not exist or the caller cannot access
it. A billing account with no matching recommendation documents returns 200 with an empty
items array.
billingAccountId— GCP Billing Account ID (formatXXXXXX-XXXXXX-XXXXXX; the account that owns the CUDs) that scopes the request.
Flags
| Flag | Type | Default | Example | Description |
|---|---|---|---|---|
--gcp-service | string | Filter GCP planned purchases by PS4C product line. One of: "compute". | ||
--region | string | Filter GCP planned purchases by region scope. Requires gcp_service; when omitted together with gcp_service, all available regions for all available product lines are returned. A request with region but no gcp_service returns 400 with code gcp_service_required. One of: "global". |
Every command also accepts the CLI-wide flags for output shaping — see Output formats and Table output options.
Output
List of GCP recommendations.
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 |
|---|---|---|
items | array of object | |
items[].policy | string | Coverage target policy currently configured for this commitment type (display name). One of: "Conservative", "Balanced (Recommended)", "Max Savings". |
items[].region | string | Region scope for this recommendation. v1 supports global only. One of: "global". |
items[].service | string | PS4C product line (gcp_service) this recommendation belongs to. One of: "compute". |
items[].currentCommitment | number (double) | Active hourly commitment ($/h) currently applied to this billing account and product line, including commitments already purchased. |
items[].recommendedCommitment | number (double) | Recommended total hourly commitment ($/h) based on usage patterns and your commitment policy. Designed to increase savings while managing underutilization risk. |
items[].potentialAdditionalSavings | number (double) | Estimated additional monthly savings ($/month) from applying the recommended commitment relative to currentCommitment. |
items[].estimatedAverageCoverage | number (double) | Estimated average coverage (0–1) of eligible spend if the recommended commitment were in place. |
pageToken | string | Reserved for pagination. Currently always null. |
rowCount | integer (int64) | Number of recommendations returned in items. |
Raw JSON schema
{
"type": "object",
"required": [
"items"
],
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"description": "A CUD purchase recommendation for a (service, region) scope.",
"properties": {
"policy": {
"type": "string",
"enum": [
"Conservative",
"Balanced (Recommended)",
"Max Savings"
],
"description": "Coverage target policy currently configured for this commitment type (display name).",
"x-enumDescriptions": {
"Conservative": "Lower coverage target; favors stable usage and lower underutilization risk.",
"Balanced (Recommended)": "Moderate coverage target; default balance of savings and buffer.",
"Max Savings": "Aggressive coverage target; highest savings potential with a smaller buffer."
}
},
"region": {
"type": "string",
"enum": [
"global"
],
"description": "Region scope for this recommendation. v1 supports `global` only."
},
"service": {
"type": "string",
"enum": [
"compute"
],
"description": "PS4C product line (`gcp_service`) this recommendation belongs to."
},
"currentCommitment": {
"type": "number",
"format": "double",
"description": "Active hourly commitment ($/h) currently applied to this billing account and product line, including commitments already purchased."
},
"recommendedCommitment": {
"type": "number",
"format": "double",
"description": "Recommended total hourly commitment ($/h) based on usage patterns and your commitment policy. Designed to increase savings while managing underutilization risk."
},
"potentialAdditionalSavings": {
"type": "number",
"format": "double",
"description": "Estimated additional monthly savings ($/month) from applying the recommended commitment relative to `currentCommitment`."
},
"estimatedAverageCoverage": {
"type": "number",
"format": "double",
"description": "Estimated average coverage (0–1) of eligible spend if the recommended commitment were in place."
}
}
}
},
"pageToken": {
"type": "string",
"description": "Reserved for pagination. Currently always `null`.",
"nullable": true
},
"rowCount": {
"type": "integer",
"format": "int64",
"description": "Number of recommendations returned in `items`."
}
}
}
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. |
| 500, 503 | 40 | API_SERVER_ERROR | The API failed to process the request. Retryable; contact DoiT support if it persists. |
Related
- get-gcp-billing-account — Get a GCP billing account
- get-gcp-recommendation — Get a GCP recommendation
- list-gcp-billing-accounts — List GCP billing accounts
- list-gcp-billing-accounts-settings — List billing account engine settings
- list-gcp-planned-purchases — List GCP planned purchases
- list-gcp-resource-cuds — List GCP resource-based Committed Use Discounts
- list-gcp-spend-cuds — List GCP spend-based Committed Use Discounts
- API reference: GET /ps4commitments/v1/gcp/billing-accounts/{billingAccountId}/recommendations
Aliases: listgcprecommendations