update_alert
async
¶
update_alert(
space_id: SpaceId,
alert_id: AlertId,
*,
config_overrides: Optional[AsyncCloudWatchOmniClientConfig] = 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.
>>> await 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/async_cloud_watch_omni.py
5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 | |