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. For a telemetryRule, each of {@code query}, {@code condition}, {@code evaluation} and {@code noData} is replaced whole when present. For an sloRule, each of {@code sloId}, {@code condition}, {@code evaluation} and {@code noData} is applied only when supplied; omitted members keep their stored value, and a supplied block is replaced whole. Within any supplied block, an omitted optional member is cleared to unset (null/absent), not preserved from the stored alert or defaulted. The rule kind cannot change: supplying a sloRule for a telemetry alert, or a telemetryRule for an SLO alert, is a validation error.
-
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
5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 | |