Skip to main content

get-anomaly

dci get-anomaly id

Returns the specified anomaly.

Output

OK - Anomaly returned.

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

FieldTypeDescription
attributionstringAttribution ID
billingAccountstringBilling account ID
costOfAnomalynumber (double)The difference between the actual cost and the maximum cost in the normal range.
actualCostnumber (double)Observed (actual) cost of the anomaly.
expectedMaxCostnumber (double)Maximum cost within the expected normal range.
platformstringCloud Provider name
scopestringScope: Project or Account
serviceNamestringService name
severityLevelstringSeverity level: information, warning, or critical.
startTimeinteger (int64)Usage start time of the anomaly
endTimeintegerEnd of the anomaly
deactivationReasonstringWhy the anomaly stopped being active. reverted means the cost returned inside the expected normal range; expired means the anomaly was deactivated without the cost returning inside that range; unknown means the reason could not be determined. Null while the anomaly is still active. One of: "reverted", "expired", "unknown".
timeFramestringTimeframe: Daily or Hourly
top3SKUsarray of objectArray of SKU entries contributing to an anomaly.
top3SKUs[].costnumber (double)
top3SKUs[].namestring
resourceDataarray of objectArray of resources contributing to an anomaly.
resourceData[].costnumber (double)
resourceData[].resourceIdstring
resourceData[].skuDescriptionstring
resourceData[].operationstringFor anomalies related to AWS S3
resourceData[].labelsarray of objectLabels (also known as cost-allocation tags) present on this resource during the anomaly; each entry reports the label's key, its value, and the resource's cost tagged with that key/value pair. Cloud providers use different names for the same concept; GCP uses "labels", AWS uses "cost-allocation tags", and Azure uses "tags". We refer to all of these as labels.
resourceData[].labels[].keystringThe label/tag key.
resourceData[].labels[].valuestringThe label/tag value.
resourceData[].labels[].costnumber (double)The resource's cost tagged with this key/value pair; typically equal to the resource's cost, since labels/tags usually cover all of its spend.
statusstringOne of: "active", "inactive".
acknowledgedbooleanHas the anomaly been acknowledged
acknowledgedAtstring (date-time)When the anomaly was first acknowledged
acknowledgedBystringEmail of the user who first acknowledged the anomaly
notificationsarray of objectChronologically ordered notification dispatch events.
notifications[].timestampstring (date-time)Dispatch timestamp in RFC3339 UTC.
notifications[].channelstringDispatch channel. One of: "email", "slack", "msteams".
Raw JSON schema
{
"required": [
"attribution",
"billingAccount",
"costOfAnomaly",
"platform",
"scope",
"serviceName",
"severityLevel",
"startTime",
"timeFrame",
"top3SKUs",
"notifications"
],
"type": "object",
"properties": {
"attribution": {
"type": "string",
"description": "Attribution ID"
},
"billingAccount": {
"type": "string",
"description": "Billing account ID"
},
"costOfAnomaly": {
"type": "number",
"description": "The difference between the actual cost and the maximum cost in the normal range.",
"format": "double"
},
"actualCost": {
"type": "number",
"format": "double",
"nullable": true,
"description": "Observed (actual) cost of the anomaly."
},
"expectedMaxCost": {
"type": "number",
"format": "double",
"nullable": true,
"description": "Maximum cost within the expected normal range."
},
"platform": {
"type": "string",
"description": "Cloud Provider name"
},
"scope": {
"type": "string",
"description": "Scope: Project or Account"
},
"serviceName": {
"type": "string",
"description": "Service name"
},
"severityLevel": {
"type": "string",
"description": "Severity level: `information`, `warning`, or `critical`."
},
"startTime": {
"type": "integer",
"description": "Usage start time of the anomaly",
"format": "int64"
},
"endTime": {
"type": "integer",
"nullable": true,
"description": "End of the anomaly"
},
"deactivationReason": {
"type": "string",
"nullable": true,
"description": "Why the anomaly stopped being active. `reverted` means the cost returned inside the expected normal range; `expired` means the anomaly was deactivated without the cost returning inside that range; `unknown` means the reason could not be determined. Null while the anomaly is still active.",
"enum": [
"reverted",
"expired",
"unknown"
]
},
"timeFrame": {
"type": "string",
"description": "Timeframe: Daily or Hourly"
},
"top3SKUs": {
"type": "array",
"description": "Array of SKU entries contributing to an anomaly.",
"items": {
"type": "object",
"description": "SKU-level information contributing to an anomaly.",
"properties": {
"cost": {
"type": "number",
"format": "double"
},
"name": {
"type": "string"
}
}
}
},
"resourceData": {
"type": "array",
"description": "Array of resources contributing to an anomaly.",
"items": {
"type": "object",
"description": "Resource-specific contribution to an anomaly.",
"properties": {
"cost": {
"type": "number",
"format": "double"
},
"resourceId": {
"type": "string"
},
"skuDescription": {
"type": "string"
},
"operation": {
"description": "For anomalies related to AWS S3",
"type": "string"
},
"labels": {
"type": "array",
"description": "Labels (also known as cost-allocation tags) present on this resource during the anomaly; each entry reports the label's key, its value, and the resource's cost tagged with that key/value pair.\nCloud providers use different names for the same concept; GCP uses \"labels\", AWS uses \"cost-allocation tags\", and Azure uses \"tags\". We refer to all of these as labels.",
"items": {
"type": "object",
"description": "A single label (a.k.a. cost-allocation tag) on the resource, paired with the resource's cost tagged with this key/value pair.",
"properties": {
"key": {
"type": "string",
"description": "The label/tag key."
},
"value": {
"type": "string",
"description": "The label/tag value."
},
"cost": {
"type": "number",
"format": "double",
"description": "The resource's cost tagged with this key/value pair; typically equal to the resource's cost, since labels/tags usually cover all of its spend."
}
}
}
}
}
}
},
"status": {
"type": "string",
"nullable": true,
"enum": [
"active",
"inactive"
]
},
"acknowledged": {
"description": "Has the anomaly been acknowledged",
"type": "boolean"
},
"acknowledgedAt": {
"description": "When the anomaly was first acknowledged",
"type": "string",
"format": "date-time",
"nullable": true
},
"acknowledgedBy": {
"description": "Email of the user who first acknowledged the anomaly",
"type": "string",
"nullable": true
},
"notifications": {
"type": "array",
"description": "Chronologically ordered notification dispatch events.",
"items": {
"type": "object",
"description": "A successful notification dispatch for an anomaly.\nThis records that the API/worker sent the notification, not that delivery was confirmed.",
"required": [
"timestamp",
"channel"
],
"properties": {
"timestamp": {
"type": "string",
"format": "date-time",
"description": "Dispatch timestamp in RFC3339 UTC."
},
"channel": {
"type": "string",
"description": "Dispatch channel.",
"enum": [
"email",
"slack",
"msteams"
]
}
}
}
}
}
}

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 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.

Aliases: getanomaly