delete_omni_slo
¶
delete_omni_slo(
space_id: SpaceId,
slo_id: SloId,
*,
config_overrides: Optional[CloudWatchOmniClientConfig] = None,
force: Optional[bool] = None,
) -> DeleteOmniSloOutput
Deletes an SLO by its identifier and stops its evaluation. Idempotent: deleting an SLO that has already been removed succeeds without error. An SLO that alerts reference is refused with a ConflictException (conflictType RESOURCE_IN_USE) unless force is true. The error does not name the alerts; ListAlerts with filterCriteria.sloIds lists them. With force, the alerts are not changed: the SLO's metrics stop being published, so they report their noData state (NODATA by default) until they are deleted or pointed at another SLO.
Parameters:
-
space_id(SpaceId) –The unique ID of the space that owns the SLO.
-
slo_id(SloId) –The SLO to delete.
-
force(Optional[bool], default:None) –Delete the SLO even when alerts reference it. Those alerts go to their noData state. Defaults to false.
Raises:
-
AccessDeniedException–The caller is not authorized to perform this action.
-
ConflictException–The operation could not be completed because of a conflict with the current state of the resource.
-
InternalServerException–An unexpected error occurred while processing the request.
-
ThrottlingException–The request was throttled due to exceeding the allowed request rate.
-
ValidationException–A parameter is specified incorrectly.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Delete an SLO The following example deletes an SLO that no alert references. Deleting an SLO that has already been removed succeeds without error. Payloads are shown as JSON; on the wire they are CBOR-encoded.
>>> client.delete_omni_slo(space_id='a1b2c3d4-5e6f-4a3b-8c9d-0e1f2a3b4c5d', slo_id='9f8e7d6c5b4a49382716051a2b3c4d5e')
Delete an SLO that alerts reference
The following example deletes an SLO even though alerts reference it. Because force is true, the delete succeeds; without force, it would fail with a ConflictException. The referencing alerts are not changed: they report their noData state until they are deleted or pointed at another SLO. Payloads are shown as JSON; on the wire they are CBOR-encoded.
>>> client.delete_omni_slo(space_id='a1b2c3d4-5e6f-4a3b-8c9d-0e1f2a3b4c5d', slo_id='7a6b5c4d3e2f41a0b9c8d7e6f5a4b3c2', force=True)
Source code in docs_src/capo_cloudwatchomni/_services/cloud_watch_omni.py
2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 | |