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

patch-anomaly

dci patch-anomaly id

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

Request

Content-Type: application/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 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: patchanomaly