patch-anomaly
dci patch-anomaly <id> [body]
Updates the review status of the anomaly identified by \{id\}, the same identifier getAnomaly accepts. Mirrors the review workflow available in the console: set reviewStatus, and when resolving, qualify it with resolution and optionally a resolutionNote (feedback reason and comment). The change is recorded in the anomaly's review history exactly like a console update, and the actor is derived from the API credentials - never from the request body.
Validation: reviewStatus is one of NEEDS_REVIEW, UNDER_REVIEW, RESOLVED; resolution (ANOMALY_CONFIRMED or NOT_ANOMALY) is required when reviewStatus is RESOLVED and forbidden otherwise; resolutionNote.reason must belong to the given resolution - SECURITY_BREACH, MISCONFIGURATION, UNINTENTIONAL_PROVISIONING, EXPECTED_COST_SPIKE or ANOMALOUS_OTHER for ANOMALY_CONFIRMED, and FAULTY_ANOMALY_DETECTION_MODEL, INCORRECT_DATA, LOW_IMPACT or NON_ANOMALOUS_OTHER for NOT_ANOMALY. Requires the AnomaliesManager permission and DoiT API access (platform:externalApi).
id— Anomaly ID as shown bydci list-anomaliesordci anomalies-recent. Anomalies have no names, so name resolution does not apply.
Pass the request body as name: value arguments or pipe JSON on stdin — see Command structure.
resolution is required when reviewStatus is RESOLVED and rejected
otherwise; resolutionNote.reason must belong to the chosen resolution.
The CLI validates field names locally; the API validates these rules.
Examples
# Take an anomaly into review.
dci patch-anomaly <anomaly-id> customerFeedback.reviewStatus: UNDER_REVIEW
# Resolve it as a confirmed anomaly with a reason and a comment.
dci patch-anomaly <anomaly-id> customerFeedback{reviewStatus: RESOLVED, resolution: ANOMALY_CONFIRMED, resolutionNote{reason: MISCONFIGURATION, comment: "Autoscaler max raised by mistake"}}
Exit code 0 and no output; `dci get-anomaly <anomaly-id> --output json` shows the new review status.
# Dismiss it as not an anomaly, with the body read from a file.
dci patch-anomaly <anomaly-id> < feedback.json
# feedback.json
{"customerFeedback": {"reviewStatus": "RESOLVED", "resolution": "NOT_ANOMALY",
"resolutionNote": {"reason": "EXPECTED_COST_SPIKE"}}}
Request
Content-Type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
customerFeedback | object | yes | Partial review-status update. Fields that are omitted are left unchanged. reviewStatus drives the state machine; resolution and resolutionNote apply only when resolving. |
customerFeedback.reviewStatus | string | The review state to move the anomaly to. One of: "NEEDS_REVIEW", "UNDER_REVIEW", "RESOLVED". | |
customerFeedback.resolution | string | Required when reviewStatus is RESOLVED; forbidden otherwise. Qualifies whether the anomaly was confirmed as real. One of: "ANOMALY_CONFIRMED", "NOT_ANOMALY". | |
customerFeedback.resolutionNote | object | Optional reason and comment captured on a resolve transition. | |
customerFeedback.resolutionNote.reason | string | Feedback reason; must belong to the given resolution. ANOMALY_CONFIRMED accepts SECURITY_BREACH, MISCONFIGURATION, UNINTENTIONAL_PROVISIONING, EXPECTED_COST_SPIKE, ANOMALOUS_OTHER; NOT_ANOMALY accepts FAULTY_ANOMALY_DETECTION_MODEL, INCORRECT_DATA, LOW_IMPACT, NON_ANOMALOUS_OTHER. One of: "FAULTY_ANOMALY_DETECTION_MODEL", "INCORRECT_DATA", "EXPECTED_COST_SPIKE", "LOW_IMPACT", "NON_ANOMALOUS_OTHER", "SECURITY_BREACH", "MISCONFIGURATION", "UNINTENTIONAL_PROVISIONING", "ANOMALOUS_OTHER". | |
customerFeedback.resolutionNote.comment | string | Free-text resolution comment; stored as the tagged resolution comment on the anomaly feed. Length-capped like console comments. |
Raw JSON schema
{
"type": "object",
"required": [
"customerFeedback"
],
"properties": {
"customerFeedback": {
"type": "object",
"description": "Partial review-status update. Fields that are omitted are left unchanged. `reviewStatus` drives the state machine; `resolution` and `resolutionNote` apply only when resolving.",
"properties": {
"reviewStatus": {
"type": "string",
"description": "The review state to move the anomaly to.",
"enum": [
"NEEDS_REVIEW",
"UNDER_REVIEW",
"RESOLVED"
]
},
"resolution": {
"type": "string",
"description": "Required when `reviewStatus` is `RESOLVED`; forbidden otherwise. Qualifies whether the anomaly was confirmed as real.",
"enum": [
"ANOMALY_CONFIRMED",
"NOT_ANOMALY"
]
},
"resolutionNote": {
"type": "object",
"description": "Optional reason and comment captured on a resolve transition.",
"properties": {
"reason": {
"type": "string",
"description": "Feedback reason; must belong to the given `resolution`. `ANOMALY_CONFIRMED` accepts `SECURITY_BREACH`, `MISCONFIGURATION`, `UNINTENTIONAL_PROVISIONING`, `EXPECTED_COST_SPIKE`, `ANOMALOUS_OTHER`; `NOT_ANOMALY` accepts `FAULTY_ANOMALY_DETECTION_MODEL`, `INCORRECT_DATA`, `LOW_IMPACT`, `NON_ANOMALOUS_OTHER`.",
"enum": [
"FAULTY_ANOMALY_DETECTION_MODEL",
"INCORRECT_DATA",
"EXPECTED_COST_SPIKE",
"LOW_IMPACT",
"NON_ANOMALOUS_OTHER",
"SECURITY_BREACH",
"MISCONFIGURATION",
"UNINTENTIONAL_PROVISIONING",
"ANOMALOUS_OTHER"
]
},
"comment": {
"type": "string",
"description": "Free-text resolution comment; stored as the tagged resolution comment on the anomaly feed. Length-capped like console comments."
}
}
}
}
}
}
}
Output
On success, this command produces no response data.
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-anomaly — Retrieve an anomaly
- list-anomalies — List anomalies
anomalies-recent- API reference: PATCH /anomalies/v1/{id}
Aliases: patchanomaly