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

query-attribute-workloads-table

dci query-attribute-workloads-table <dimension> [body] [flags]

Returns one page of rows of Kubernetes workload cost, grouped by dimension, for a date range. Each row has its cost, its change against the previous period of the same length, and the related values for that dimension (for example the clusters and accounts of a namespace). Use this for granular rows ("top 10 workloads by cost", "which namespaces grew"). Use queryAttributeWorkloadsStats for totals and the total row count, and queryAttributeWorkloadsOverTime for a time series. Rows of the workload dimension carry a workloadId: pass it to the /attribute/v1/workloads/w/* operations to see that one workload's cloud resources.

The request body holds the filters; this operation only reads data. Build filter values with listAttributeWorkloadsFilterValues.

Freemium customers (no paid Attribute plan) see network cost only, and only for the last 60 days.

Authenticate with Authorization: Bearer &lt;token&gt;. Omit X-Tenant-Id when the credential resolves to one customer. When the credential can act on several customers, send X-Tenant-Id: &lt;tenant-id&gt; to select one.

  • dimension — What one row (or one series) stands for: - workload: one Kubernetes workload on one cluster. Only these rows carry workloadId, the input of the /attribute/v1/workloads/w/* operations. - workloadName: all workloads with the same name, across clusters. - workloadType: one workload type. - namespace: one Kubernetes namespace. - platform: one cluster (name, type, region, account and cloud). - accountId: one cloud account that hosts clusters. - resource: one billed cloud resource used by workloads. - resourceType: one billed service. - costDescription: one billing SKU description. - platformCloudProvider: one cloud that clusters run on.

Pass the request body as name: value arguments or pipe JSON on stdin — see Command structure.

Request​

Content-Type: application/json

FieldTypeRequiredDescription
filterConditionsone of 2 variantsyesThe filters, as an object with exactly one key: and (every item must match) or or (at least one item must match). Each item is a condition or a group of conditions. Send \{"and": []\} for no filter.

Example body (JSON)​

{
"filterConditions": {
"and": []
}
}
Raw JSON schema
{
"type": "object",
"required": [
"filterConditions"
],
"properties": {
"filterConditions": {
"description": "The filters, as an object with exactly one key: `and` (every item must match) or `or` (at\nleast one item must match). Each item is a condition or a group of conditions. Send\n`{\"and\": []}` for no filter.",
"oneOf": [
{
"type": "object",
"title": "All of",
"additionalProperties": false,
"required": [
"and"
],
"properties": {
"and": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"description": "One condition on one field.",
"required": [
"var",
"operator",
"values"
],
"properties": {
"var": {
"type": "object",
"required": [
"field"
],
"properties": {
"field": {
"type": "string",
"description": "A field to filter on. Get its values from `listAttributeWorkloadsFilterValues`.\n\n- `name`: workload name. `type`: workload type. `namespace`: Kubernetes namespace.\n- `platform_name`, `platform_type`, `platform_region`: the cluster's name, type and region.\n- `accountId`: the cloud account of the cluster.\n- `platformCloudProvider`: the cloud the cluster runs on.\n- `resourceName`: the billed resource's ID. `resourceType`: the billed service.\n `resourceRegion`: the resource's region.\n- `resourceAccountId`, `resourceAccountName`: the cloud account (or project) that holds\n the resource.\n- `resourceCloudProvider`: the cloud that billed the resource.\n- `costDescription`: the billing SKU description.",
"enum": [
"accountId",
"costDescription",
"name",
"namespace",
"platform_name",
"platform_region",
"platform_type",
"platformCloudProvider",
"resourceAccountId",
"resourceAccountName",
"resourceCloudProvider",
"resourceName",
"resourceRegion",
"resourceType",
"type"
]
}
}
},
"operator": {
"type": "string",
"description": "`in` / `not_in`: the field equals / does not equal one of `values` (exact match).\n`contains` / `not_contains`: the field contains / does not contain one of `values` as a\nsubstring. `exists` / `not_exists`: the field has / has no value; send `values: []`.",
"enum": [
"in",
"not_in",
"contains",
"not_contains",
"exists",
"not_exists"
]
},
"values": {
"type": "array",
"description": "The values to compare with. Send an empty array for `exists` and `not_exists`.",
"items": {
"type": "string"
}
}
}
},
{
"description": "A nested group of conditions, joined with AND or with OR. Groups cannot nest further.",
"oneOf": [
{
"type": "object",
"title": "All of",
"additionalProperties": false,
"required": [
"and"
],
"properties": {
"and": {
"type": "array",
"items": {
"type": "object",
"description": "One condition on one field.",
"required": [
"var",
"operator",
"values"
],
"properties": {
"var": {
"type": "object",
"required": [
"field"
],
"properties": {
"field": {
"type": "string",
"description": "A field to filter on. Get its values from `listAttributeWorkloadsFilterValues`.\n\n- `name`: workload name. `type`: workload type. `namespace`: Kubernetes namespace.\n- `platform_name`, `platform_type`, `platform_region`: the cluster's name, type and region.\n- `accountId`: the cloud account of the cluster.\n- `platformCloudProvider`: the cloud the cluster runs on.\n- `resourceName`: the billed resource's ID. `resourceType`: the billed service.\n `resourceRegion`: the resource's region.\n- `resourceAccountId`, `resourceAccountName`: the cloud account (or project) that holds\n the resource.\n- `resourceCloudProvider`: the cloud that billed the resource.\n- `costDescription`: the billing SKU description.",
"enum": [
"accountId",
"costDescription",
"name",
"namespace",
"platform_name",
"platform_region",
"platform_type",
"platformCloudProvider",
"resourceAccountId",
"resourceAccountName",
"resourceCloudProvider",
"resourceName",
"resourceRegion",
"resourceType",
"type"
]
}
}
},
"operator": {
"type": "string",
"description": "`in` / `not_in`: the field equals / does not equal one of `values` (exact match).\n`contains` / `not_contains`: the field contains / does not contain one of `values` as a\nsubstring. `exists` / `not_exists`: the field has / has no value; send `values: []`.",
"enum": [
"in",
"not_in",
"contains",
"not_contains",
"exists",
"not_exists"
]
},
"values": {
"type": "array",
"description": "The values to compare with. Send an empty array for `exists` and `not_exists`.",
"items": {
"type": "string"
}
}
}
}
}
}
},
{
"type": "object",
"title": "Any of",
"additionalProperties": false,
"required": [
"or"
],
"properties": {
"or": {
"type": "array",
"items": {
"type": "object",
"description": "One condition on one field.",
"required": [
"var",
"operator",
"values"
],
"properties": {
"var": {
"type": "object",
"required": [
"field"
],
"properties": {
"field": {
"type": "string",
"description": "A field to filter on. Get its values from `listAttributeWorkloadsFilterValues`.\n\n- `name`: workload name. `type`: workload type. `namespace`: Kubernetes namespace.\n- `platform_name`, `platform_type`, `platform_region`: the cluster's name, type and region.\n- `accountId`: the cloud account of the cluster.\n- `platformCloudProvider`: the cloud the cluster runs on.\n- `resourceName`: the billed resource's ID. `resourceType`: the billed service.\n `resourceRegion`: the resource's region.\n- `resourceAccountId`, `resourceAccountName`: the cloud account (or project) that holds\n the resource.\n- `resourceCloudProvider`: the cloud that billed the resource.\n- `costDescription`: the billing SKU description.",
"enum": [
"accountId",
"costDescription",
"name",
"namespace",
"platform_name",
"platform_region",
"platform_type",
"platformCloudProvider",
"resourceAccountId",
"resourceAccountName",
"resourceCloudProvider",
"resourceName",
"resourceRegion",
"resourceType",
"type"
]
}
}
},
"operator": {
"type": "string",
"description": "`in` / `not_in`: the field equals / does not equal one of `values` (exact match).\n`contains` / `not_contains`: the field contains / does not contain one of `values` as a\nsubstring. `exists` / `not_exists`: the field has / has no value; send `values: []`.",
"enum": [
"in",
"not_in",
"contains",
"not_contains",
"exists",
"not_exists"
]
},
"values": {
"type": "array",
"description": "The values to compare with. Send an empty array for `exists` and `not_exists`.",
"items": {
"type": "string"
}
}
}
}
}
}
}
]
}
]
}
}
}
},
{
"type": "object",
"title": "Any of",
"additionalProperties": false,
"required": [
"or"
],
"properties": {
"or": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"description": "One condition on one field.",
"required": [
"var",
"operator",
"values"
],
"properties": {
"var": {
"type": "object",
"required": [
"field"
],
"properties": {
"field": {
"type": "string",
"description": "A field to filter on. Get its values from `listAttributeWorkloadsFilterValues`.\n\n- `name`: workload name. `type`: workload type. `namespace`: Kubernetes namespace.\n- `platform_name`, `platform_type`, `platform_region`: the cluster's name, type and region.\n- `accountId`: the cloud account of the cluster.\n- `platformCloudProvider`: the cloud the cluster runs on.\n- `resourceName`: the billed resource's ID. `resourceType`: the billed service.\n `resourceRegion`: the resource's region.\n- `resourceAccountId`, `resourceAccountName`: the cloud account (or project) that holds\n the resource.\n- `resourceCloudProvider`: the cloud that billed the resource.\n- `costDescription`: the billing SKU description.",
"enum": [
"accountId",
"costDescription",
"name",
"namespace",
"platform_name",
"platform_region",
"platform_type",
"platformCloudProvider",
"resourceAccountId",
"resourceAccountName",
"resourceCloudProvider",
"resourceName",
"resourceRegion",
"resourceType",
"type"
]
}
}
},
"operator": {
"type": "string",
"description": "`in` / `not_in`: the field equals / does not equal one of `values` (exact match).\n`contains` / `not_contains`: the field contains / does not contain one of `values` as a\nsubstring. `exists` / `not_exists`: the field has / has no value; send `values: []`.",
"enum": [
"in",
"not_in",
"contains",
"not_contains",
"exists",
"not_exists"
]
},
"values": {
"type": "array",
"description": "The values to compare with. Send an empty array for `exists` and `not_exists`.",
"items": {
"type": "string"
}
}
}
},
{
"description": "A nested group of conditions, joined with AND or with OR. Groups cannot nest further.",
"oneOf": [
{
"type": "object",
"title": "All of",
"additionalProperties": false,
"required": [
"and"
],
"properties": {
"and": {
"type": "array",
"items": {
"type": "object",
"description": "One condition on one field.",
"required": [
"var",
"operator",
"values"
],
"properties": {
"var": {
"type": "object",
"required": [
"field"
],
"properties": {
"field": {
"type": "string",
"description": "A field to filter on. Get its values from `listAttributeWorkloadsFilterValues`.\n\n- `name`: workload name. `type`: workload type. `namespace`: Kubernetes namespace.\n- `platform_name`, `platform_type`, `platform_region`: the cluster's name, type and region.\n- `accountId`: the cloud account of the cluster.\n- `platformCloudProvider`: the cloud the cluster runs on.\n- `resourceName`: the billed resource's ID. `resourceType`: the billed service.\n `resourceRegion`: the resource's region.\n- `resourceAccountId`, `resourceAccountName`: the cloud account (or project) that holds\n the resource.\n- `resourceCloudProvider`: the cloud that billed the resource.\n- `costDescription`: the billing SKU description.",
"enum": [
"accountId",
"costDescription",
"name",
"namespace",
"platform_name",
"platform_region",
"platform_type",
"platformCloudProvider",
"resourceAccountId",
"resourceAccountName",
"resourceCloudProvider",
"resourceName",
"resourceRegion",
"resourceType",
"type"
]
}
}
},
"operator": {
"type": "string",
"description": "`in` / `not_in`: the field equals / does not equal one of `values` (exact match).\n`contains` / `not_contains`: the field contains / does not contain one of `values` as a\nsubstring. `exists` / `not_exists`: the field has / has no value; send `values: []`.",
"enum": [
"in",
"not_in",
"contains",
"not_contains",
"exists",
"not_exists"
]
},
"values": {
"type": "array",
"description": "The values to compare with. Send an empty array for `exists` and `not_exists`.",
"items": {
"type": "string"
}
}
}
}
}
}
},
{
"type": "object",
"title": "Any of",
"additionalProperties": false,
"required": [
"or"
],
"properties": {
"or": {
"type": "array",
"items": {
"type": "object",
"description": "One condition on one field.",
"required": [
"var",
"operator",
"values"
],
"properties": {
"var": {
"type": "object",
"required": [
"field"
],
"properties": {
"field": {
"type": "string",
"description": "A field to filter on. Get its values from `listAttributeWorkloadsFilterValues`.\n\n- `name`: workload name. `type`: workload type. `namespace`: Kubernetes namespace.\n- `platform_name`, `platform_type`, `platform_region`: the cluster's name, type and region.\n- `accountId`: the cloud account of the cluster.\n- `platformCloudProvider`: the cloud the cluster runs on.\n- `resourceName`: the billed resource's ID. `resourceType`: the billed service.\n `resourceRegion`: the resource's region.\n- `resourceAccountId`, `resourceAccountName`: the cloud account (or project) that holds\n the resource.\n- `resourceCloudProvider`: the cloud that billed the resource.\n- `costDescription`: the billing SKU description.",
"enum": [
"accountId",
"costDescription",
"name",
"namespace",
"platform_name",
"platform_region",
"platform_type",
"platformCloudProvider",
"resourceAccountId",
"resourceAccountName",
"resourceCloudProvider",
"resourceName",
"resourceRegion",
"resourceType",
"type"
]
}
}
},
"operator": {
"type": "string",
"description": "`in` / `not_in`: the field equals / does not equal one of `values` (exact match).\n`contains` / `not_contains`: the field contains / does not contain one of `values` as a\nsubstring. `exists` / `not_exists`: the field has / has no value; send `values: []`.",
"enum": [
"in",
"not_in",
"contains",
"not_contains",
"exists",
"not_exists"
]
},
"values": {
"type": "array",
"description": "The values to compare with. Send an empty array for `exists` and `not_exists`.",
"items": {
"type": "string"
}
}
}
}
}
}
}
]
}
]
}
}
}
}
],
"example": {
"and": [
{
"var": {
"field": "namespace"
},
"operator": "in",
"values": [
"checkout"
]
},
{
"or": [
{
"var": {
"field": "platformCloudProvider"
},
"operator": "in",
"values": [
"AWS"
]
},
{
"var": {
"field": "resourceType"
},
"operator": "contains",
"values": [
"Storage"
]
}
]
}
]
}
}
},
"example": {
"filterConditions": {
"and": []
}
}
}

Flags​

FlagTypeDefaultExampleDescription
--fromstring (date)2026-09-01First day of the date range (UTC), inclusive, as YYYY-MM-DD. The change fields compare with the period of the same length right before this day. Freemium customers (no paid Attribute plan) can only read the last 60 days: a from earlier than today minus 60 days (UTC) returns 403.
--tostring (date)2026-09-30Last day of the date range (UTC), inclusive, as YYYY-MM-DD. Must be on or after from.
--limitinteger10Rows per page. Default 10. The server sets no maximum, so ask only for what you need (100 or less keeps the response small).
--offsetinteger0Number of rows to skip. Default 0. For the next page, send offset plus limit. A page with fewer than limit rows is the last page.
--sortstring\{"field":"cost","order":"desc"\}Sort order, as a JSON object \{"field": "&lt;field&gt;", "order": "asc" | "desc"\} (URL-encode it). Default \{"field":"cost","order":"desc"\}. field is one of: cost, change (percent), dollarChange, name, type, namespace, platform_name, platform_region, accountId, platformCloudProvider, resourceName, resourceType, resourceRegion, resourceAccountId, resourceAccountName, resourceCloudProvider, costDescription. Sort by a field that the chosen dimension returns.
--granularitystringWhen set, each row also has costByTime: its cost per hour, day, week or month. Omit it when you do not need a breakdown by time. Use hour only for ranges of a few days; Azure data has one point per day even with hour. One of: "hour", "day", "week", "month".
--signalstringKeeps only the workloads of one "needs attention" list from getAttributeWorkloadsSignals: spike, new or network. The lists use their own fixed windows, not from and to; from and to still decide which cost is shown. When the list is empty, no rows match. Omit it to read all workloads. One of: "spike", "new", "network".

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

Output​

OK - One page of rows, sorted by sort.

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

FieldTypeDescription
workloadsarray of objectThe rows of this page. There is no total row count here: use dimensionRowCount from the matching stats operation. A page shorter than limit is the last page.
workloads[].labelstringDisplay name of the row, built from the dimension's fields. -- when the value is empty.
workloads[].workloadIdstringworkload dimension only. Opaque ID of the workload; pass it unchanged to the /attribute/v1/workloads/w/* operations.
workloads[].namestringWorkload name.
workloads[].typestringWorkload type.
workloads[].namespacestringKubernetes namespace.
workloads[].platformobjectThe cluster the workload runs on.
workloads[].platform.namestringCluster name.
workloads[].platform.typestringCluster type.
workloads[].platform.regionstringCluster region.
workloads[].accountIdstringThe cloud account of the cluster.
workloads[].platformCloudProviderstringThe cloud the cluster runs on.
workloads[].resourceNamestringThe billed resource's ID (resource dimension).
workloads[].resourceTypestringThe billed service.
workloads[].resourceRegionstringThe resource's region.
workloads[].resourceAccountIdstringThe cloud account (or project) that holds the resource.
workloads[].resourceAccountNamestringThe name of that account (or project).
workloads[].resourceCloudProviderstringThe cloud that billed the resource.
workloads[].costDescriptionstringThe billing SKU description.
workloads[].costnumberCost in the date range.
workloads[].changenumberPercent change of cost against the previous period of the same length. Null when the previous cost is 0.
workloads[].dollarChangenumbercost minus the cost of the previous period of the same length. Null when the previous cost is 0.
workloads[].costBeforeChangenumberCost of the previous period, when returned.
workloads[].accountabilitynumberqueryAttributeWorkloadResourcesTable only. The workload's percent (0 to 100) of the resource's total cost in the date range. Null when the resource has no ID.
workloads[].costByTimearray of objectThe row's cost per time bucket. Set only when the request has granularity.
workloads[].costByTime[].timestringStart of the bucket, ISO 8601 (UTC).
workloads[].costByTime[].costnumber
workloads[].typesarray of stringWorkload types in this row.
workloads[].platformsarray of stringCluster names in this row.
workloads[].regionsarray of stringCluster regions in this row.
workloads[].accountIdsarray of stringCloud accounts of the clusters in this row.
workloads[].resourcesarray of stringResource types (billed services) in this row.
workloads[].resourceAccountsarray of stringCloud accounts that hold the resources in this row.
workloads[].platformCloudProvidersarray of stringClouds of the clusters in this row.
Raw JSON schema
{
"type": "object",
"required": [
"workloads"
],
"properties": {
"workloads": {
"type": "array",
"description": "The rows of this page. There is no total row count here: use `dimensionRowCount` from\nthe matching stats operation. A page shorter than `limit` is the last page.",
"items": {
"type": "object",
"description": "One row of a table. Which fields are set depends on the dimension: the fields of the\ndimension itself are scalars, and related values of a grouped dimension are lists. Fields\nthat do not apply are absent or null.",
"required": [
"cost",
"label"
],
"properties": {
"label": {
"type": "string",
"description": "Display name of the row, built from the dimension's fields. `--` when the value is empty."
},
"workloadId": {
"type": "string",
"description": "`workload` dimension only. Opaque ID of the workload; pass it unchanged to the\n`/attribute/v1/workloads/w/*` operations."
},
"name": {
"type": "string",
"nullable": true,
"description": "Workload name."
},
"type": {
"type": "string",
"nullable": true,
"description": "Workload type."
},
"namespace": {
"type": "string",
"nullable": true,
"description": "Kubernetes namespace."
},
"platform": {
"type": "object",
"description": "The cluster the workload runs on.",
"nullable": true,
"properties": {
"name": {
"type": "string",
"nullable": true,
"description": "Cluster name."
},
"type": {
"type": "string",
"nullable": true,
"description": "Cluster type."
},
"region": {
"type": "string",
"nullable": true,
"description": "Cluster region."
}
}
},
"accountId": {
"type": "string",
"nullable": true,
"description": "The cloud account of the cluster."
},
"platformCloudProvider": {
"type": "string",
"nullable": true,
"description": "The cloud the cluster runs on."
},
"resourceName": {
"type": "string",
"nullable": true,
"description": "The billed resource's ID (`resource` dimension)."
},
"resourceType": {
"type": "string",
"nullable": true,
"description": "The billed service."
},
"resourceRegion": {
"type": "string",
"nullable": true,
"description": "The resource's region."
},
"resourceAccountId": {
"type": "string",
"nullable": true,
"description": "The cloud account (or project) that holds the resource."
},
"resourceAccountName": {
"type": "string",
"nullable": true,
"description": "The name of that account (or project)."
},
"resourceCloudProvider": {
"type": "string",
"nullable": true,
"description": "The cloud that billed the resource."
},
"costDescription": {
"type": "string",
"nullable": true,
"description": "The billing SKU description."
},
"cost": {
"type": "number",
"description": "Cost in the date range."
},
"change": {
"type": "number",
"nullable": true,
"description": "Percent change of `cost` against the previous period of the same length. Null when the\nprevious cost is 0."
},
"dollarChange": {
"type": "number",
"nullable": true,
"description": "`cost` minus the cost of the previous period of the same length. Null when the previous\ncost is 0."
},
"costBeforeChange": {
"type": "number",
"nullable": true,
"description": "Cost of the previous period, when returned."
},
"accountability": {
"type": "number",
"nullable": true,
"description": "`queryAttributeWorkloadResourcesTable` only. The workload's percent (0 to 100) of the\nresource's total cost in the date range. Null when the resource has no ID."
},
"costByTime": {
"type": "array",
"nullable": true,
"description": "The row's cost per time bucket. Set only when the request has `granularity`.",
"items": {
"type": "object",
"required": [
"time"
],
"properties": {
"time": {
"type": "string",
"description": "Start of the bucket, ISO 8601 (UTC)."
},
"cost": {
"type": "number",
"nullable": true
}
}
}
},
"types": {
"type": "array",
"nullable": true,
"description": "Workload types in this row.",
"items": {
"type": "string"
}
},
"platforms": {
"type": "array",
"nullable": true,
"description": "Cluster names in this row.",
"items": {
"type": "string"
}
},
"regions": {
"type": "array",
"nullable": true,
"description": "Cluster regions in this row.",
"items": {
"type": "string"
}
},
"accountIds": {
"type": "array",
"nullable": true,
"description": "Cloud accounts of the clusters in this row.",
"items": {
"type": "string"
}
},
"resources": {
"type": "array",
"nullable": true,
"description": "Resource types (billed services) in this row.",
"items": {
"type": "string"
}
},
"resourceAccounts": {
"type": "array",
"nullable": true,
"description": "Cloud accounts that hold the resources in this row.",
"items": {
"type": "string"
}
},
"platformCloudProviders": {
"type": "array",
"nullable": true,
"description": "Clouds of the clusters in this row.",
"items": {
"type": "string"
}
}
}
}
}
}
}

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.
40921RESOURCE_CONFLICTThe operation conflicts with the resource's current state.
500, 502, 50340API_SERVER_ERRORThe API failed to process the request. Retryable; contact DoiT support if it persists.

Aliases: queryattributeworkloadstable