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. 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.
>>> 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
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 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 | |