update_alert
¶
update_alert(
space_id: SpaceId,
alert_id: AlertId,
*,
config_overrides: Optional[CloudWatchOmniClientConfig] = None,
profile_id: Optional[ProfileId] = None,
name: Optional[str] = None,
description: Optional[str] = None,
rule: Optional[Rule] = None,
notifications_enabled: Optional[bool] = None,
notification_rules: Optional[NotificationRuleList] = None,
) -> UpdateAlertOutput
Updates an existing alert. Only non-null fields overwrite existing values.
Parameters:
-
space_id(SpaceId) –The unique ID of the space.
-
alert_id(AlertId) –The alert to update.
-
profile_id(Optional[ProfileId], default:None) –The ID of the access profile associated with the alert.
-
name(Optional[str], default:None) –A new display name for the alert. Omit to leave the name unchanged (apply-if-present / PATCH). Same constraints as CreateAlert.name; the name is not the alert's identity, so a rename never changes the alertId.
-
description(Optional[str], default:None) –A new description of the alert. Omit to leave unchanged.
-
rule(Optional[Rule], default:None) –The rule that defines how the alert is evaluated. Omit to leave unchanged. Each sub-block is replaced whole when present: {@code query}, {@code condition}, {@code evaluation} and {@code noData} are applied only when supplied, and within a supplied block an omitted optional member is cleared to unset (null/absent) rather than preserved from the stored alert or defaulted. See {@link AlertCondition} and {@link AlertEvaluation}.
-
notifications_enabled(Optional[bool], default:None) –Whether actions (notifications) are enabled for this alert. Omitted = leave existing value unchanged.
-
notification_rules(Optional[NotificationRuleList], default:None) –Replaces the entire notification rule list when present; full-replace, not merge. Omitted = leave existing rules unchanged. An empty list clears all rules (the alert keeps evaluating; only notifications stop).
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:
Raise an alert's thresholds The following example replaces only the condition of an alert's rule; the query, the evaluation cadence and the notification rules are left unchanged. A supplied condition is replaced whole rather than merged, so every threshold to keep is sent again. Payloads are shown as JSON; on the wire they are CBOR-encoded.
>>> client.update_alert(space_id='a1b2c3d4-5e6f-4a3b-8c9d-0e1f2a3b4c5d', alert_id='c3d4e5f67a8b4c9d8e0f1a2b3c4d5e6f', rule={'telemetryRule': {'condition': {'thresholdMode': 'FIELD_VALUE', 'thresholdField': 'error_count', 'comparator': 'GT', 'warningThreshold': 100.0, 'criticalThreshold': 400.0}}})
Source code in docs_src/capo_cloudwatchomni/_services/cloud_watch_omni.py
4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 | |