Skip to content

get_connection async

get_connection(
    name: NameString,
    *,
    config_overrides: Optional[AsyncGlueClientConfig] = None,
    catalog_id: Optional[CatalogIdString] = None,
    hide_password: Optional[Boolean] = None,
    apply_override_for_compute_environment: Optional[ComputeEnvironment] = None,
) -> GetConnectionResponse

Retrieves a connection definition from the Data Catalog.

Parameters:

  • catalog_id (Optional[CatalogIdString], default: None ) –

    The ID of the Data Catalog in which the connection resides. If none is provided, the Amazon Web Services account ID is used by default.

  • name (NameString) –

    The name of the connection definition to retrieve.

  • hide_password (Optional[Boolean], default: None ) –

    Allows you to retrieve the connection metadata without returning the password. For instance, the Glue console uses this flag to retrieve the connection, and does not display the password. Set this parameter when the caller might not have permission to use the KMS key to decrypt the password, but it does have permission to access the rest of the connection properties.

  • apply_override_for_compute_environment (Optional[ComputeEnvironment], default: None ) –

    For connections that may be used in multiple services, specifies returning properties for the specified compute environment.

Raises:

Source code in docs_src/capo_glue/_services/async_glue.py
async def get_connection(
    self,
    name: "capo_glue.types.name_string.NameString",
    *,
    config_overrides: Optional[AsyncGlueClientConfig] = None,
    catalog_id: Optional[
        "capo_glue.types.catalog_id_string.CatalogIdString"
    ] = None,
    hide_password: Optional["capo_glue.types.boolean.Boolean"] = None,
    apply_override_for_compute_environment: Optional[
        "capo_glue.types.compute_environment.ComputeEnvironment"
    ] = None,
) -> "capo_glue.types.get_connection_response.GetConnectionResponse":
    """<p>Retrieves a connection definition from the Data Catalog.</p>

    Args:
        catalog_id: <p>The ID of the Data Catalog in which the connection resides. If none is provided, the Amazon Web Services account ID is used by default.</p>
        name: <p>The name of the connection definition to retrieve.</p>
        hide_password: <p>Allows you to retrieve the connection metadata without returning the password. For instance, the Glue console uses this flag to retrieve the connection, and does not display the password. Set this parameter when the caller might not have permission to use the KMS key to decrypt the password, but it does have permission to access the rest of the connection properties.</p>
        apply_override_for_compute_environment: <p>For connections that may be used in multiple services, specifies returning properties for the specified compute environment.</p>

    Raises:
        capo_glue.errors.entity_not_found_exception.EntityNotFoundException: <p>A specified entity does not exist</p>
        capo_glue.errors.glue_encryption_exception.GlueEncryptionException: <p>An encryption operation failed.</p>
        capo_glue.errors.invalid_input_exception.InvalidInputException: <p>The input provided was not valid.</p>
        capo_glue.errors.operation_timeout_exception.OperationTimeoutException: <p>The operation timed out.</p>
        capo_glue.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_glue.types.get_connection_request.GetConnectionRequest]",
    ) -> AsyncOperationResponse[
        "capo_glue.types.get_connection_response.GetConnectionResponse"
    ]:
        import capo_glue._operations.aws_glue.get_connection

        (
            output,
            http_response,
        ) = await capo_glue._operations.aws_glue.get_connection.async_get_connection(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetConnection")
    )
    input_: capo_glue.types.get_connection_request.GetConnectionRequest = {
        "name": name
    }
    if catalog_id is not None:
        input_["catalog_id"] = catalog_id
    if hide_password is not None:
        input_["hide_password"] = hide_password
    if apply_override_for_compute_environment is not None:
        input_["apply_override_for_compute_environment"] = (
            apply_override_for_compute_environment
        )

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