Skip to content

modify_event_subscription async

modify_event_subscription(
    *,
    config_overrides: Optional[AsyncRedshiftClientConfig] = None,
    subscription_name: Optional[String] = None,
    sns_topic_arn: Optional[String] = None,
    source_type: Optional[String] = None,
    source_ids: Optional[SourceIdsList] = None,
    event_categories: Optional[EventCategoriesList] = None,
    severity: Optional[String] = None,
    enabled: Optional[BooleanOptional] = None,
) -> ModifyEventSubscriptionResult

Modifies an existing Amazon Redshift event notification subscription.

Parameters:

  • subscription_name (Optional[String], default: None ) –

    The name of the modified Amazon Redshift event notification subscription.

  • sns_topic_arn (Optional[String], default: None ) –

    The Amazon Resource Name (ARN) of the SNS topic to be used by the event notification subscription.

  • source_type (Optional[String], default: None ) –

    The type of source that will be generating the events. For example, if you want to be notified of events generated by a cluster, you would set this parameter to cluster. If this value is not specified, events are returned for all Amazon Redshift objects in your Amazon Web Services account. You must specify a source type in order to specify source IDs.

    Valid values: cluster, cluster-parameter-group, cluster-security-group, cluster-snapshot, and scheduled-action.

  • source_ids (Optional[SourceIdsList], default: None ) –

    A list of one or more identifiers of Amazon Redshift source objects. All of the objects must be of the same type as was specified in the source type parameter. The event subscription will return only events generated by the specified objects. If not specified, then events are returned for all objects within the source type specified.

    Example: my-cluster-1, my-cluster-2

    Example: my-snapshot-20131010

  • event_categories (Optional[EventCategoriesList], default: None ) –

    Specifies the Amazon Redshift event categories to be published by the event notification subscription.

    Values: configuration, management, monitoring, security, pending

  • severity (Optional[String], default: None ) –

    Specifies the Amazon Redshift event severity to be published by the event notification subscription.

    Values: ERROR, INFO

  • enabled (Optional[BooleanOptional], default: None ) –

    A Boolean value indicating if the subscription is enabled. true indicates the subscription is enabled

Raises:

  • InvalidSubscriptionStateFault –

    The subscription request is invalid because it is a duplicate request. This subscription request is already in progress.

  • SNSInvalidTopicFault –

    Amazon SNS has responded that there is a problem with the specified Amazon SNS topic.

  • SNSNoAuthorizationFault –

    You do not have permission to publish to the specified Amazon SNS topic.

  • SNSTopicArnNotFoundFault –

    An Amazon SNS topic with the specified Amazon Resource Name (ARN) does not exist.

  • SourceNotFoundFault –

    The specified Amazon Redshift event source could not be found.

  • SubscriptionCategoryNotFoundFault –

    The value specified for the event category was not one of the allowed values, or it specified a category that does not apply to the specified source type. The allowed values are Configuration, Management, Monitoring, and Security.

  • SubscriptionEventIdNotFoundFault –

    An Amazon Redshift event with the specified event ID does not exist.

  • SubscriptionNotFoundFault –

    An Amazon Redshift event notification subscription with the specified name does not exist.

  • SubscriptionSeverityNotFoundFault –

    The value specified for the event severity was not one of the allowed values, or it specified a severity that does not apply to the specified source type. The allowed values are ERROR and INFO.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_redshift/_services/async_redshift.py
async def modify_event_subscription(
    self,
    *,
    config_overrides: Optional[AsyncRedshiftClientConfig] = None,
    subscription_name: Optional["capo_redshift.types.string.String"] = None,
    sns_topic_arn: Optional["capo_redshift.types.string.String"] = None,
    source_type: Optional["capo_redshift.types.string.String"] = None,
    source_ids: Optional[
        "capo_redshift.types.source_ids_list.SourceIdsList"
    ] = None,
    event_categories: Optional[
        "capo_redshift.types.event_categories_list.EventCategoriesList"
    ] = None,
    severity: Optional["capo_redshift.types.string.String"] = None,
    enabled: Optional[
        "capo_redshift.types.boolean_optional.BooleanOptional"
    ] = None,
) -> "capo_redshift.types.modify_event_subscription_result.ModifyEventSubscriptionResult":
    """<p>Modifies an existing Amazon Redshift event notification subscription.</p>

    Args:
        subscription_name: <p>The name of the modified Amazon Redshift event notification subscription.</p>
        sns_topic_arn: <p>The Amazon Resource Name (ARN) of the SNS topic to be used by the event notification subscription.</p>
        source_type: <p>The type of source that will be generating the events. For example, if you want to be notified of events generated by a cluster, you would set this parameter to cluster. If this value is not specified, events are returned for all Amazon Redshift objects in your Amazon Web Services account. You must specify a source type in order to specify source IDs.</p> <p>Valid values: cluster, cluster-parameter-group, cluster-security-group, cluster-snapshot, and scheduled-action.</p>
        source_ids: <p>A list of one or more identifiers of Amazon Redshift source objects. All of the objects must be of the same type as was specified in the source type parameter. The event subscription will return only events generated by the specified objects. If not specified, then events are returned for all objects within the source type specified.</p> <p>Example: my-cluster-1, my-cluster-2</p> <p>Example: my-snapshot-20131010</p>
        event_categories: <p>Specifies the Amazon Redshift event categories to be published by the event notification subscription.</p> <p>Values: configuration, management, monitoring, security, pending</p>
        severity: <p>Specifies the Amazon Redshift event severity to be published by the event notification subscription.</p> <p>Values: ERROR, INFO</p>
        enabled: <p>A Boolean value indicating if the subscription is enabled. <code>true</code> indicates the subscription is enabled </p>

    Raises:
        capo_redshift.errors.invalid_subscription_state_fault.InvalidSubscriptionStateFault: <p>The subscription request is invalid because it is a duplicate request. This subscription request is already in progress.</p>
        capo_redshift.errors.sns_invalid_topic_fault.SNSInvalidTopicFault: <p>Amazon SNS has responded that there is a problem with the specified Amazon SNS topic.</p>
        capo_redshift.errors.sns_no_authorization_fault.SNSNoAuthorizationFault: <p>You do not have permission to publish to the specified Amazon SNS topic.</p>
        capo_redshift.errors.sns_topic_arn_not_found_fault.SNSTopicArnNotFoundFault: <p>An Amazon SNS topic with the specified Amazon Resource Name (ARN) does not exist.</p>
        capo_redshift.errors.source_not_found_fault.SourceNotFoundFault: <p>The specified Amazon Redshift event source could not be found.</p>
        capo_redshift.errors.subscription_category_not_found_fault.SubscriptionCategoryNotFoundFault: <p>The value specified for the event category was not one of the allowed values, or it specified a category that does not apply to the specified source type. The allowed values are Configuration, Management, Monitoring, and Security.</p>
        capo_redshift.errors.subscription_event_id_not_found_fault.SubscriptionEventIdNotFoundFault: <p>An Amazon Redshift event with the specified event ID does not exist.</p>
        capo_redshift.errors.subscription_not_found_fault.SubscriptionNotFoundFault: <p>An Amazon Redshift event notification subscription with the specified name does not exist.</p>
        capo_redshift.errors.subscription_severity_not_found_fault.SubscriptionSeverityNotFoundFault: <p>The value specified for the event severity was not one of the allowed values, or it specified a severity that does not apply to the specified source type. The allowed values are ERROR and INFO.</p>
        capo_redshift.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_redshift.types.modify_event_subscription_message.ModifyEventSubscriptionMessage]",
    ) -> AsyncOperationResponse[
        "capo_redshift.types.modify_event_subscription_result.ModifyEventSubscriptionResult"
    ]:
        import capo_redshift._operations.redshift_service_version20121201.modify_event_subscription

        (
            output,
            http_response,
        ) = await capo_redshift._operations.redshift_service_version20121201.modify_event_subscription.async_modify_event_subscription(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ModifyEventSubscription")
    )
    input_: capo_redshift.types.modify_event_subscription_message.ModifyEventSubscriptionMessage = {}
    if subscription_name is not None:
        input_["subscription_name"] = subscription_name
    if sns_topic_arn is not None:
        input_["sns_topic_arn"] = sns_topic_arn
    if source_type is not None:
        input_["source_type"] = source_type
    if source_ids is not None:
        input_["source_ids"] = source_ids
    if event_categories is not None:
        input_["event_categories"] = event_categories
    if severity is not None:
        input_["severity"] = severity
    if enabled is not None:
        input_["enabled"] = enabled

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output