Adds a source identifier to an existing event notification subscription.
Parameters:
-
subscription_name
(Optional[String], default:
None
)
–
The name of the Amazon DocumentDB event notification subscription that you want to add a source identifier to.
-
source_identifier
(Optional[String], default:
None
)
–
The identifier of the event source to be added:
-
If the source type is an instance, a DBInstanceIdentifier must be provided.
-
If the source type is a security group, a DBSecurityGroupName must be provided.
-
If the source type is a parameter group, a DBParameterGroupName must be provided.
-
If the source type is a snapshot, a DBSnapshotIdentifier must be provided.
Raises:
Source code in docs_src/capo_docdb/_services/doc_db.py
| def add_source_identifier_to_subscription(
self,
*,
config_overrides: Optional[DocDBClientConfig] = None,
subscription_name: Optional["capo_docdb.types.string.String"] = None,
source_identifier: Optional["capo_docdb.types.string.String"] = None,
) -> "capo_docdb.types.add_source_identifier_to_subscription_result.AddSourceIdentifierToSubscriptionResult":
"""<p>Adds a source identifier to an existing event notification subscription.</p>
Args:
subscription_name: <p>The name of the Amazon DocumentDB event notification subscription that you want to add a source identifier to.</p>
source_identifier: <p>The identifier of the event source to be added:</p> <ul> <li> <p>If the source type is an instance, a <code>DBInstanceIdentifier</code> must be provided.</p> </li> <li> <p>If the source type is a security group, a <code>DBSecurityGroupName</code> must be provided.</p> </li> <li> <p>If the source type is a parameter group, a <code>DBParameterGroupName</code> must be provided.</p> </li> <li> <p>If the source type is a snapshot, a <code>DBSnapshotIdentifier</code> must be provided.</p> </li> </ul>
Raises:
capo_docdb.errors.source_not_found_fault.SourceNotFoundFault: <p>The requested source could not be found. </p>
capo_docdb.errors.subscription_not_found_fault.SubscriptionNotFoundFault: <p>The subscription name does not exist. </p>
capo_docdb.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_docdb.types.add_source_identifier_to_subscription_message.AddSourceIdentifierToSubscriptionMessage]",
) -> OperationResponse[
"capo_docdb.types.add_source_identifier_to_subscription_result.AddSourceIdentifierToSubscriptionResult"
]:
import capo_docdb._operations.amazon_rd_sv19.add_source_identifier_to_subscription
output, http_response = (
capo_docdb._operations.amazon_rd_sv19.add_source_identifier_to_subscription.add_source_identifier_to_subscription(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("AddSourceIdentifierToSubscription")
)
input_: capo_docdb.types.add_source_identifier_to_subscription_message.AddSourceIdentifierToSubscriptionMessage = {}
if subscription_name is not None:
input_["subscription_name"] = subscription_name
if source_identifier is not None:
input_["source_identifier"] = source_identifier
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|