update_omni_slo
¶
update_omni_slo(
space_id: SpaceId,
slo_id: SloId,
*,
config_overrides: Optional[CloudWatchOmniClientConfig] = 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.
>>> 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.
>>> 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/cloud_watch_omni.py
6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 | |