query-attribute-workloads-over-time
dci query-attribute-workloads-over-time <dimension> [body] [flags]
Returns a cost time series grouped by dimension: the top limit values by cost, each as
its own series, plus one "Others" series that sums the rest. Use this for trends and charts
("daily cost of the top 5 namespaces last month"). Use queryAttributeWorkloadsTable for
rows with totals per value, and queryAttributeWorkloadsStats for one total.
The request body holds the filters; this operation only reads data.
Freemium customers (no paid Attribute plan) see network cost only, and only for the last 60 days.
Authenticate with Authorization: Bearer <token>. Omit X-Tenant-Id when the credential
resolves to one customer. When the credential can act on several customers, send
X-Tenant-Id: <tenant-id> to select one.
dimension— What one row (or one series) stands for: -workload: one Kubernetes workload on one cluster. Only these rows carryworkloadId, 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
| Field | Type | Required | Description |
|---|---|---|---|
filterConditions | one of 2 variants | yes | The 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
| Flag | Type | Default | Example | Description |
|---|---|---|---|---|
--from | string (date) | 2026-09-01 | First 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. | |
--to | string (date) | 2026-09-30 | Last day of the date range (UTC), inclusive, as YYYY-MM-DD. Must be on or after from. | |
--limit | integer | 10 | Number of series to return, the highest cost first. Default 10. The cost of all other values is summed into one more "Others" series. | |
--granularity | string | "day" | Size of each time bucket. Default day. 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". | |
--force-hourly | boolean | false | When true, uses hour buckets whatever granularity says. Default false. | |
--signal | string | Keeps 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 point per series per time bucket.
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 |
|---|---|---|
overTime | array of object | One point per series per time bucket. |
overTime[].time | string | Start of the time bucket, ISO 8601 (UTC). |
overTime[].cost | number | Cost of the series in this bucket. |
overTime[].value | string | Series name (the dimension value), or the "Others" series that sums the rest. |
Raw JSON schema
{
"type": "object",
"required": [
"overTime"
],
"properties": {
"overTime": {
"type": "array",
"description": "One point per series per time bucket.",
"items": {
"type": "object",
"required": [
"time",
"cost",
"value"
],
"properties": {
"time": {
"type": "string",
"description": "Start of the time bucket, ISO 8601 (UTC)."
},
"cost": {
"type": "number",
"description": "Cost of the series in this bucket."
},
"value": {
"type": "string",
"description": "Series name (the dimension value), or the \"Others\" series that sums the rest."
}
}
}
}
}
}
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. |
| 409 | 21 | RESOURCE_CONFLICT | The operation conflicts with the resource's current state. |
| 500, 502, 503 | 40 | API_SERVER_ERROR | The API failed to process the request. Retryable; contact DoiT support if it persists. |
Related
- get-attribute-workload-details — Get one workload's identity
- get-attribute-workloads-cost-data-status — Check whether workload cost data exists
- get-attribute-workloads-signals — Get workloads that need attention
- list-attribute-workload-non-network-resource-types — List one workload's non-network resource types
- list-attribute-workloads-cloud-providers — List the cloud providers that billed workload resources
- list-attribute-workloads-filter-values — List the values of a workload filter field
- list-attribute-workloads-resource-tag-keys — List resource tag keys
- list-attribute-workloads-resource-tag-values — List the values of one resource tag key
- query-attribute-workload-resources-over-time — Get one workload's resource cost over time
- query-attribute-workload-resources-stats — Get one workload's cost totals
- query-attribute-workload-resources-table — List one workload's cloud resources
- query-attribute-workloads-stats — Get Kubernetes workload cost totals
- query-attribute-workloads-table — List Kubernetes workload costs by dimension
- API reference: POST /attribute/v1/workloads/{dimension}/over-time
Aliases: queryattributeworkloadsovertime