Skip to content

delete_alert

delete_alert(
    space_id: SpaceId,
    alert_id: AlertId,
    *,
    config_overrides: Optional[CloudWatchOmniClientConfig] = None,
) -> DeleteAlertOutput

Deletes an alert by its identifier. Idempotent: deleting an alert that has already been removed succeeds without error.

Parameters:

  • space_id (SpaceId) –

    The unique ID of the space.

  • alert_id (AlertId) –

    The alert to delete.

Raises:

Examples:

Delete an alert The following example removes an alert from a space. Deleting an alert that has already been removed succeeds without error. Payloads are shown as JSON; on the wire they are CBOR-encoded.

>>> client.delete_alert(space_id='a1b2c3d4-5e6f-4a3b-8c9d-0e1f2a3b4c5d', alert_id='c3d4e5f67a8b4c9d8e0f1a2b3c4d5e6f')
Source code in docs_src/capo_cloudwatchomni/_services/cloud_watch_omni.py
def delete_alert(
    self,
    space_id: "capo_cloudwatchomni.types.space_id.SpaceId",
    alert_id: "capo_cloudwatchomni.types.alert_id.AlertId",
    *,
    config_overrides: Optional[CloudWatchOmniClientConfig] = None,
) -> "capo_cloudwatchomni.types.delete_alert_output.DeleteAlertOutput":
    """Deletes an alert by its identifier. Idempotent: deleting an alert that has already been removed succeeds without error.

    Args:
        space_id: The unique ID of the space.
        alert_id: The alert to delete.

    Raises:
        capo_cloudwatchomni.errors.access_denied_exception.AccessDeniedException: The caller is not authorized to perform this action.
        capo_cloudwatchomni.errors.internal_server_exception.InternalServerException: An unexpected error occurred while processing the request.
        capo_cloudwatchomni.errors.throttling_exception.ThrottlingException: The request was throttled due to exceeding the allowed request rate.
        capo_cloudwatchomni.errors.validation_exception.ValidationException: A parameter is specified incorrectly.
        capo_cloudwatchomni.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Delete an alert
        The following example removes an alert from a space. Deleting an alert that has already been removed succeeds without error. Payloads are shown as JSON; on the wire they are CBOR-encoded.

        >>> client.delete_alert(space_id='a1b2c3d4-5e6f-4a3b-8c9d-0e1f2a3b4c5d', alert_id='c3d4e5f67a8b4c9d8e0f1a2b3c4d5e6f')
    """

    def _handler(
        req: "OperationRequest[capo_cloudwatchomni.types.delete_alert_input.DeleteAlertInput]",
    ) -> OperationResponse[
        "capo_cloudwatchomni.types.delete_alert_output.DeleteAlertOutput"
    ]:
        import capo_cloudwatchomni._operations.cloud_watch_omni_frontend.delete_alert

        output, http_response = (
            capo_cloudwatchomni._operations.cloud_watch_omni_frontend.delete_alert.delete_alert(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteAlert")
    )
    input_: capo_cloudwatchomni.types.delete_alert_input.DeleteAlertInput = {
        "space_id": space_id,
        "alert_id": alert_id,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output