Skip to content

get_connection

get_connection(
    connection_id: ConnectionIdentifier,
    *,
    config_overrides: Optional[ContextClientConfig] = None,
) -> GetConnectionResponse

Returns a connection's configuration and status.

Parameters:

  • connection_id (ConnectionIdentifier) –

    The connection to return, by its ID (which starts with conn-) or its ARN.

Raises:

  • AccessDeniedException –

    You don't have sufficient access to perform this operation. Verify that you have permission to perform the operation on the resource.

  • InternalServerException –

    The request failed because of an internal error. Retry the request.

  • ThrottlingException –

    The request was denied because it exceeded a request rate quota. Wait, then retry the request.

  • ValidationException –

    The input fails to satisfy the constraints of the operation. Correct the input before you retry the request.

  • ResourceNotFoundException –

    The specified resource was not found. Check that the ID is correct and that the resource exists in your account and Region.

  • UnknownServiceError –

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

Examples:

Get a connection The following example returns the configuration and status of the connection conn-e5f6a7b8c9d04e1f8a2b3c4d5e6f7a8b.

>>> client.get_connection(connection_id='conn-e5f6a7b8c9d04e1f8a2b3c4d5e6f7a8b')
Source code in docs_src/capo_context/_services/context.py
def get_connection(
    self,
    connection_id: "capo_context.types.connection_identifier.ConnectionIdentifier",
    *,
    config_overrides: Optional[ContextClientConfig] = None,
) -> "capo_context.types.get_connection_response.GetConnectionResponse":
    """<p>Returns a connection's configuration and status.</p>

    Args:
        connection_id: <p>The connection to return, by its ID (which starts with <code>conn-</code>) or its ARN.</p>

    Raises:
        capo_context.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this operation. Verify that you have permission to perform the operation on the resource.</p>
        capo_context.errors.internal_server_exception.InternalServerException: <p>The request failed because of an internal error. Retry the request.</p>
        capo_context.errors.throttling_exception.ThrottlingException: <p>The request was denied because it exceeded a request rate quota. Wait, then retry the request.</p>
        capo_context.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints of the operation. Correct the input before you retry the request.</p>
        capo_context.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found. Check that the ID is correct and that the resource exists in your account and Region.</p>
        capo_context.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Get a connection
        The following example returns the configuration and status of the connection conn-e5f6a7b8c9d04e1f8a2b3c4d5e6f7a8b.

        >>> client.get_connection(connection_id='conn-e5f6a7b8c9d04e1f8a2b3c4d5e6f7a8b')
    """

    def _handler(
        req: "OperationRequest[capo_context.types.get_connection_request.GetConnectionRequest]",
    ) -> OperationResponse[
        "capo_context.types.get_connection_response.GetConnectionResponse"
    ]:
        import capo_context._operations.context.get_connection

        output, http_response = (
            capo_context._operations.context.get_connection.get_connection(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetConnection")
    )
    input_: capo_context.types.get_connection_request.GetConnectionRequest = {
        "connection_id": connection_id
    }

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