Skip to content

get_databases async

get_databases(
    *,
    config_overrides: Optional[AsyncGlueClientConfig] = None,
    catalog_id: Optional[CatalogIdString] = None,
    next_token: Optional[Token] = None,
    max_results: Optional[CatalogGetterPageSize] = None,
    resource_share_type: Optional[ResourceShareType] = None,
    attributes_to_get: Optional[DatabaseAttributesList] = None,
) -> GetDatabasesResponse

Retrieves all databases defined in a given Data Catalog.

Parameters:

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

    The ID of the Data Catalog from which to retrieve Databases. If none is provided, the Amazon Web Services account ID is used by default.

  • next_token (Optional[Token], default: None ) –

    A continuation token, if this is a continuation call.

  • max_results (Optional[CatalogGetterPageSize], default: None ) –

    The maximum number of databases to return in one response.

  • resource_share_type (Optional[ResourceShareType], default: None ) –

    Allows you to specify that you want to list the databases shared with your account. The allowable values are FEDERATED, FOREIGN or ALL.

    • If set to FEDERATED, will list the federated databases (referencing an external entity) shared with your account.

    • If set to FOREIGN, will list the databases shared with your account.

    • If set to ALL, will list the databases shared with your account, as well as the databases in yor local account.

  • attributes_to_get (Optional[DatabaseAttributesList], default: None ) –

    Specifies the database fields returned by the GetDatabases call. This parameter doesn’t accept an empty list. The request must include the NAME.

Raises:

Source code in docs_src/capo_glue/_services/async_glue.py
async def get_databases(
    self,
    *,
    config_overrides: Optional[AsyncGlueClientConfig] = None,
    catalog_id: Optional[
        "capo_glue.types.catalog_id_string.CatalogIdString"
    ] = None,
    next_token: Optional["capo_glue.types.token.Token"] = None,
    max_results: Optional[
        "capo_glue.types.catalog_getter_page_size.CatalogGetterPageSize"
    ] = None,
    resource_share_type: Optional[
        "capo_glue.types.resource_share_type.ResourceShareType"
    ] = None,
    attributes_to_get: Optional[
        "capo_glue.types.database_attributes_list.DatabaseAttributesList"
    ] = None,
) -> "capo_glue.types.get_databases_response.GetDatabasesResponse":
    """<p>Retrieves all databases defined in a given Data Catalog.</p>

    Args:
        catalog_id: <p>The ID of the Data Catalog from which to retrieve <code>Databases</code>. If none is provided, the Amazon Web Services account ID is used by default.</p>
        next_token: <p>A continuation token, if this is a continuation call.</p>
        max_results: <p>The maximum number of databases to return in one response.</p>
        resource_share_type: <p>Allows you to specify that you want to list the databases shared with your account. The allowable values are <code>FEDERATED</code>, <code>FOREIGN</code> or <code>ALL</code>. </p> <ul> <li> <p>If set to <code>FEDERATED</code>, will list the federated databases (referencing an external entity) shared with your account.</p> </li> <li> <p>If set to <code>FOREIGN</code>, will list the databases shared with your account. </p> </li> <li> <p>If set to <code>ALL</code>, will list the databases shared with your account, as well as the databases in yor local account. </p> </li> </ul>
        attributes_to_get: <p>Specifies the database fields returned by the <code>GetDatabases</code> call. This parameter doesn’t accept an empty list. The request must include the <code>NAME</code>.</p>

    Raises:
        capo_glue.errors.entity_not_found_exception.EntityNotFoundException: <p>A specified entity does not exist</p>
        capo_glue.errors.federation_source_exception.FederationSourceException: <p>A federation source failed.</p>
        capo_glue.errors.federation_source_retryable_exception.FederationSourceRetryableException: <p>A federation source failed, but the operation may be retried.</p>
        capo_glue.errors.glue_encryption_exception.GlueEncryptionException: <p>An encryption operation failed.</p>
        capo_glue.errors.internal_service_exception.InternalServiceException: <p>An internal service error occurred.</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_databases_request.GetDatabasesRequest]",
    ) -> AsyncOperationResponse[
        "capo_glue.types.get_databases_response.GetDatabasesResponse"
    ]:
        import capo_glue._operations.aws_glue.get_databases

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetDatabases")
    )
    input_: capo_glue.types.get_databases_request.GetDatabasesRequest = {}
    if catalog_id is not None:
        input_["catalog_id"] = catalog_id
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if resource_share_type is not None:
        input_["resource_share_type"] = resource_share_type
    if attributes_to_get is not None:
        input_["attributes_to_get"] = attributes_to_get

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