list-assets
dci list-assets [flags]
Returns a list of all available customer assets, such as Google Cloud billing accounts, G Suite/Workspace subscriptions, etc. Assets are returned in reverse chronological order by default.
CLI default view
dci list-assets presents a curated table by default:
- Columns:
name(a clickable link to the asset in the DoiT console in interactive terminals),type, andcreated (UTC)(fromcreateTime). - In interactive tables,
created (UTC)renders in your local timezone and is titledcreated (local); machine formats, agent mode, and--utckeep UTC — see Timestamps and timezones. --output jsonand explicit-C/--fieldsselections return the raw fields documented below.
Examples
# The customer's assets, newest first.
dci list-assets
# Only Google Workspace subscriptions.
dci list-assets --filter type:g-suite
# Google Cloud and AWS assets (the same key twice means OR).
dci list-assets --filter "type:google-cloud|type:amazon-web-services"
# Every page with IDs, for scripts.
dci list-assets --all --output json
Flags
| Flag | Type | Default | Example | Description |
|---|---|---|---|---|
--max-results | integer (int64) | 50 | The maximum number of results to return in a single page. Leverage 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 of the request. The syntax is key:[<value>]. e.g: "type:g-suite". Multiple filters can be connected using a pipe |. Note that using different keys in the same filter results in “AND,” while using the same key multiple times in the same filter results in “OR”. |
Every command also accepts the CLI-wide flags for output shaping — see Output formats and Table output options.
Output
OK - List of available assets returned.
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 |
|---|---|---|
assets | array of object | Array of Assets |
assets[].createTime | integer (int64) | The time when the asset was created, in milliseconds since the epoch. |
assets[].id | string | The unique identifier of the asset. |
assets[].name | string | A human-readable label for the asset, typically combining the product name and domain or account ID. |
assets[].quantity | integer (int64) | The number of licenses or seats currently assigned to this asset. |
assets[].type | string | The asset type, e.g. g-suite, office-365, google-cloud, amazon-web-services, or microsoft-azure. |
assets[].url | string | A link to the asset details page in the DoiT console. |
pageToken | string | Page token. Can be used to request the next page of results. |
rowCount | integer (int64) | Assets rows count |
Raw JSON schema
{
"type": "object",
"properties": {
"assets": {
"type": "array",
"description": "Array of Assets",
"items": {
"type": "object",
"description": "Summary information about a single asset.",
"properties": {
"createTime": {
"type": "integer",
"description": "The time when the asset was created, in milliseconds since the epoch.",
"format": "int64"
},
"id": {
"type": "string",
"description": "The unique identifier of the asset."
},
"name": {
"type": "string",
"description": "A human-readable label for the asset, typically combining the product name and domain or account ID."
},
"quantity": {
"type": "integer",
"description": "The number of licenses or seats currently assigned to this asset.",
"format": "int64"
},
"type": {
"type": "string",
"description": "The asset type, e.g. g-suite, office-365, google-cloud, amazon-web-services, or microsoft-azure."
},
"url": {
"type": "string",
"description": "A link to the asset details page in the DoiT console."
}
}
}
},
"pageToken": {
"type": "string",
"description": "Page token. Can be used to request the next page of results."
},
"rowCount": {
"type": "integer",
"description": "Assets rows count",
"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-asset — Retrieve an asset
- update-asset — Update an asset
- create-asset — Create an asset
- API reference: GET /billing/v1/assets
Aliases: id-of-assets