update_omni_slo
async
¶
update_omni_slo(
space_id: SpaceId,
slo_id: SloId,
*,
config_overrides: Optional[AsyncCloudWatchOmniClientConfig] = None,
name: Optional[SloName] = None,
description: Optional[SloDescription] = None,
service_attributes: Optional[SloServiceAttributes] = None,
sli: Optional[Sli] = None,
objective: Optional[SloObjective] = None,
) -> UpdateOmniSloOutput
Updates an existing SLO. Omitted members are left unchanged, and a member that is present replaces that block whole, so read the SLO, change it, and write it back. Changing the SLI starts a new revision, which restarts the window totals.
Parameters:
-
space_id(SpaceId) –The unique ID of the space that owns the SLO.
-
slo_id(SloId) –The SLO to update.
-
name(Optional[SloName], default:None) –A new display name. Renaming never changes the sloId or the ARN.
-
description(Optional[SloDescription], default:None) –A new description.
-
service_attributes(Optional[SloServiceAttributes], default:None) –Replaces the whole service attributes block, so resend every member to keep. Omit it to leave the stored attributes unchanged.
-
sli(Optional[Sli], default:None) –Replaces the whole SLI. Starts a new revision.
-
objective(Optional[SloObjective], default:None) –Replaces the whole objective, including the time window, so resend every member to keep. The error budget is recomputed from the stored window totals; no new revision starts.
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.
-
ResourceNotFoundException–The specified resource does not exist.
-
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:
Lower the target of an SLO The following example lowers the target of an SLO from 99.9 to 99.5 percent. A supplied objective is replaced whole, so the warning ratio and the time window to keep are sent again. The SLI is not changed, so no new revision starts and the error budget is recomputed from the stored window totals. Payloads are shown as JSON; on the wire they are CBOR-encoded.
>>> await client.update_omni_slo(space_id='a1b2c3d4-5e6f-4a3b-8c9d-0e1f2a3b4c5d', slo_id='9f8e7d6c5b4a49382716051a2b3c4d5e', objective={'target': 99.5, 'warningBudgetConsumedRatio': 0.75, 'timeWindow': {'rolling': {'days': 30}}})
Change the SLI of an SLO
The following example changes the good condition of a time-slice SLI to a p99 latency of at most 250 milliseconds. A supplied SLI is replaced whole, so the period length and the query are sent again. Changing the SLI starts a new revision, and the window totals restart. Payloads are shown as JSON; on the wire they are CBOR-encoded.
>>> await client.update_omni_slo(space_id='a1b2c3d4-5e6f-4a3b-8c9d-0e1f2a3b4c5d', slo_id='7a6b5c4d3e2f41a0b9c8d7e6f5a4b3c2', sli={'periods': {'periodMinutes': 1, 'query': {'language': 'PROMQL', 'expression': 'histogram_quantile(0.99, sum by (le) (rate({"http.server.request.duration_bucket", "service.name"="checkout-api"}[$__interval])))'}, 'good': {'comparator': 'LTE', 'threshold': 0.25}}})
Source code in docs_src/capo_cloudwatchomni/_services/async_cloud_watch_omni.py
6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 | |