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

query-attribute-workload-resources-over-time

dci query-attribute-workload-resources-over-time [body] [flags]

Returns a cost time series of one workload, split by cloud resource: the top limit resources by cost, each as its own series, plus one "Others" series that sums the rest. Use this for the trend of one workload's cost. Use queryAttributeWorkloadResourcesTable for rows and queryAttributeWorkloadResourcesStats for totals.

Get workloadId from a workload row of queryAttributeWorkloadsTable. An ID that does not decode returns 404. 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.

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

Request​

Content-Type: application/json

FieldTypeRequiredDescription
workloadIdstringyesOpaque ID of one workload. Copy it unchanged from the workloadId of a workload row of queryAttributeWorkloadsTable; do not build or change it. An ID that does not decode returns 404.
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.
Raw JSON schema
{
"type": "object",
"required": [
"workloadId",
"filterConditions"
],
"properties": {
"workloadId": {
"type": "string",
"minLength": 1,
"description": "Opaque ID of one workload. Copy it unchanged from the `workloadId` of a `workload` row of\n`queryAttributeWorkloadsTable`; do not build or change it. An ID that does not decode\nreturns 404."
},
"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"
]
}
]
}
]
}
}
}
}

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.
--limitinteger10Number of series to return, the highest cost first. Default 10. The cost of all other values is summed into one more "Others" series.
--granularitystring"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-hourlybooleanfalseWhen true, uses hour buckets whatever granularity says. Default false.

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.

FieldTypeDescription
overTimearray of objectOne point per series per time bucket.
overTime[].timestringStart of the time bucket, ISO 8601 (UTC).
overTime[].costnumberCost of the series in this bucket.
overTime[].valuestringSeries 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 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: queryattributeworkloadresourcesovertime