Skip to content

create_outbound_connection

create_outbound_connection(
    local_domain_info: DomainInformationContainer,
    remote_domain_info: DomainInformationContainer,
    connection_alias: ConnectionAlias,
    *,
    config_overrides: Optional[OpenSearchClientConfig] = None,
    connection_mode: Optional[ConnectionMode] = None,
    connection_properties: Optional[ConnectionProperties] = None,
) -> CreateOutboundConnectionResponse

Creates a new cross-cluster search connection from a source Amazon OpenSearch Service domain to a destination domain. For more information, see Cross-cluster search for Amazon OpenSearch Service.

Parameters:

Raises:

Source code in docs_src/capo_opensearch/_services/open_search.py
def create_outbound_connection(
    self,
    local_domain_info: "capo_opensearch.types.domain_information_container.DomainInformationContainer",
    remote_domain_info: "capo_opensearch.types.domain_information_container.DomainInformationContainer",
    connection_alias: "capo_opensearch.types.connection_alias.ConnectionAlias",
    *,
    config_overrides: Optional[OpenSearchClientConfig] = None,
    connection_mode: Optional[
        "capo_opensearch.types.connection_mode.ConnectionMode"
    ] = None,
    connection_properties: Optional[
        "capo_opensearch.types.connection_properties.ConnectionProperties"
    ] = None,
) -> "capo_opensearch.types.create_outbound_connection_response.CreateOutboundConnectionResponse":
    """<p>Creates a new cross-cluster search connection from a source Amazon OpenSearch Service domain to a destination domain. For more information, see <a href="https://docs.aws.amazon.com/opensearch-service/latest/developerguide/cross-cluster-search.html">Cross-cluster search for Amazon OpenSearch Service</a>.</p>

    Args:
        local_domain_info: <p>Name and Region of the source (local) domain.</p>
        remote_domain_info: <p>Name and Region of the destination (remote) domain.</p>
        connection_alias: <p>Name of the connection.</p>
        connection_mode: <p>The connection mode.</p>
        connection_properties: <p>The <code>ConnectionProperties</code> for the outbound connection.</p>

    Raises:
        capo_opensearch.errors.disabled_operation_exception.DisabledOperationException: <p>An error occured because the client wanted to access an unsupported operation.</p>
        capo_opensearch.errors.internal_exception.InternalException: <p>Request processing failed because of an unknown error, exception, or internal failure.</p>
        capo_opensearch.errors.limit_exceeded_exception.LimitExceededException: <p>An exception for trying to create more than the allowed number of resources or sub-resources.</p>
        capo_opensearch.errors.resource_already_exists_exception.ResourceAlreadyExistsException: <p>An exception for creating a resource that already exists.</p>
        capo_opensearch.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_opensearch.types.create_outbound_connection_request.CreateOutboundConnectionRequest]",
    ) -> OperationResponse[
        "capo_opensearch.types.create_outbound_connection_response.CreateOutboundConnectionResponse"
    ]:
        import capo_opensearch._operations.amazon_open_search_service.create_outbound_connection

        output, http_response = (
            capo_opensearch._operations.amazon_open_search_service.create_outbound_connection.create_outbound_connection(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateOutboundConnection")
    )
    input_: capo_opensearch.types.create_outbound_connection_request.CreateOutboundConnectionRequest = {
        "local_domain_info": local_domain_info,
        "remote_domain_info": remote_domain_info,
        "connection_alias": connection_alias,
    }
    if connection_mode is not None:
        input_["connection_mode"] = connection_mode
    if connection_properties is not None:
        input_["connection_properties"] = connection_properties

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