Skip to content

get_catalogs

get_catalogs(
    *,
    config_overrides: Optional[GlueClientConfig] = None,
    parent_catalog_id: Optional[CatalogIdString] = None,
    next_token: Optional[Token] = None,
    max_results: Optional[PageSize] = None,
    recursive: Optional[Boolean] = None,
    include_root: Optional[NullableBoolean] = None,
    has_databases: Optional[NullableBoolean] = None,
) -> GetCatalogsResponse

Retrieves all catalogs defined in a catalog in the Glue Data Catalog. For a Redshift-federated catalog use case, this operation returns the list of catalogs mapped to Redshift databases in the Redshift namespace catalog.

Parameters:

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

    The ID of the parent catalog in which the catalog resides. If none is provided, the Amazon Web Services Account Number is used by default.

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

    A continuation token, if this is a continuation call.

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

    The maximum number of catalogs to return in one response.

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

    Whether to list all catalogs across the catalog hierarchy, starting from the ParentCatalogId. Defaults to false . When true, all catalog objects in the ParentCatalogID hierarchy are enumerated in the response.

  • include_root (Optional[NullableBoolean], default: None ) –

    Whether to list the default catalog in the account and region in the response. Defaults to false. When true and ParentCatalogId = NULL | Amazon Web Services Account ID, all catalogs and the default catalog are enumerated in the response.

    When the ParentCatalogId is not equal to null, and this attribute is passed as false or true, an InvalidInputException is thrown.

  • has_databases (Optional[NullableBoolean], default: None ) –

    When true, the response only includes catalogs that can contain databases. Some catalogs are organizational containers that hold only other catalogs, not databases. When this parameter is set to true, those container-only catalogs are excluded, and only catalogs capable of containing databases are returned. Defaults to false.

Raises:

Source code in docs_src/capo_glue/_services/glue.py
def get_catalogs(
    self,
    *,
    config_overrides: Optional[GlueClientConfig] = None,
    parent_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.page_size.PageSize"] = None,
    recursive: Optional["capo_glue.types.boolean.Boolean"] = None,
    include_root: Optional[
        "capo_glue.types.nullable_boolean.NullableBoolean"
    ] = None,
    has_databases: Optional[
        "capo_glue.types.nullable_boolean.NullableBoolean"
    ] = None,
) -> "capo_glue.types.get_catalogs_response.GetCatalogsResponse":
    """<p>Retrieves all catalogs defined in a catalog in the Glue Data Catalog. For a Redshift-federated catalog use case, this operation returns the list of catalogs mapped to Redshift databases in the Redshift namespace catalog.</p>

    Args:
        parent_catalog_id: <p>The ID of the parent catalog in which the catalog resides. If none is provided, the Amazon Web Services Account Number 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 catalogs to return in one response.</p>
        recursive: <p>Whether to list all catalogs across the catalog hierarchy, starting from the <code>ParentCatalogId</code>. Defaults to <code>false</code> . When <code>true</code>, all catalog objects in the <code>ParentCatalogID</code> hierarchy are enumerated in the response.</p>
        include_root: <p>Whether to list the default catalog in the account and region in the response. Defaults to <code>false</code>. When <code>true</code> and <code>ParentCatalogId = NULL | Amazon Web Services Account ID</code>, all catalogs and the default catalog are enumerated in the response.</p> <p>When the <code>ParentCatalogId</code> is not equal to null, and this attribute is passed as <code>false</code> or <code>true</code>, an <code>InvalidInputException</code> is thrown.</p>
        has_databases: <p>When <code>true</code>, the response only includes catalogs that can contain databases. Some catalogs are organizational containers that hold only other catalogs, not databases. When this parameter is set to <code>true</code>, those container-only catalogs are excluded, and only catalogs capable of containing databases are returned. Defaults to <code>false</code>.</p>

    Raises:
        capo_glue.errors.access_denied_exception.AccessDeniedException: <p>Access to a resource was denied.</p>
        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.
    """

    def _handler(
        req: "OperationRequest[capo_glue.types.get_catalogs_request.GetCatalogsRequest]",
    ) -> OperationResponse[
        "capo_glue.types.get_catalogs_response.GetCatalogsResponse"
    ]:
        import capo_glue._operations.aws_glue.get_catalogs

        output, http_response = (
            capo_glue._operations.aws_glue.get_catalogs.get_catalogs(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetCatalogs")
    )
    input_: capo_glue.types.get_catalogs_request.GetCatalogsRequest = {}
    if parent_catalog_id is not None:
        input_["parent_catalog_id"] = parent_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 recursive is not None:
        input_["recursive"] = recursive
    if include_root is not None:
        input_["include_root"] = include_root
    if has_databases is not None:
        input_["has_databases"] = has_databases

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