Skip to content

get_user_defined_functions

get_user_defined_functions(
    pattern: NameString,
    *,
    config_overrides: Optional[GlueClientConfig] = None,
    catalog_id: Optional[CatalogIdString] = None,
    database_name: Optional[NameString] = None,
    function_type: Optional[FunctionType] = None,
    next_token: Optional[Token] = None,
    max_results: Optional[CatalogGetterPageSize] = None,
) -> GetUserDefinedFunctionsResponse

Retrieves multiple function definitions from the Data Catalog.

Parameters:

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

    The ID of the Data Catalog where the functions to be retrieved are located. If none is provided, the Amazon Web Services account ID is used by default.

  • database_name (Optional[NameString], default: None ) –

    The name of the catalog database where the functions are located. If none is provided, functions from all the databases across the catalog will be returned.

  • pattern (NameString) –

    An optional function-name pattern string that filters the function definitions returned.

  • function_type (Optional[FunctionType], default: None ) –

    An optional function-type pattern string that filters the function definitions returned from Amazon Redshift Federated Permissions Catalog.

    Specify a value of REGULAR_FUNCTION or STORED_PROCEDURE. The STORED_PROCEDURE function type is only compatible with Amazon Redshift Federated Permissions Catalog.

  • 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 functions to return in one response.

Raises:

Source code in docs_src/capo_glue/_services/glue.py
def get_user_defined_functions(
    self,
    pattern: "capo_glue.types.name_string.NameString",
    *,
    config_overrides: Optional[GlueClientConfig] = None,
    catalog_id: Optional[
        "capo_glue.types.catalog_id_string.CatalogIdString"
    ] = None,
    database_name: Optional["capo_glue.types.name_string.NameString"] = None,
    function_type: Optional["capo_glue.types.function_type.FunctionType"] = None,
    next_token: Optional["capo_glue.types.token.Token"] = None,
    max_results: Optional[
        "capo_glue.types.catalog_getter_page_size.CatalogGetterPageSize"
    ] = None,
) -> "capo_glue.types.get_user_defined_functions_response.GetUserDefinedFunctionsResponse":
    """<p>Retrieves multiple function definitions from the Data Catalog.</p>

    Args:
        catalog_id: <p>The ID of the Data Catalog where the functions to be retrieved are located. If none is provided, the Amazon Web Services account ID is used by default.</p>
        database_name: <p>The name of the catalog database where the functions are located. If none is provided, functions from all the databases across the catalog will be returned.</p>
        pattern: <p>An optional function-name pattern string that filters the function definitions returned.</p>
        function_type: <p>An optional function-type pattern string that filters the function definitions returned from Amazon Redshift Federated Permissions Catalog.</p> <p>Specify a value of <code>REGULAR_FUNCTION</code> or <code>STORED_PROCEDURE</code>. The <code>STORED_PROCEDURE</code> function type is only compatible with Amazon Redshift Federated Permissions Catalog. </p>
        next_token: <p>A continuation token, if this is a continuation call.</p>
        max_results: <p>The maximum number of functions to return in one response.</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.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_user_defined_functions_request.GetUserDefinedFunctionsRequest]",
    ) -> OperationResponse[
        "capo_glue.types.get_user_defined_functions_response.GetUserDefinedFunctionsResponse"
    ]:
        import capo_glue._operations.aws_glue.get_user_defined_functions

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetUserDefinedFunctions")
    )
    input_: capo_glue.types.get_user_defined_functions_request.GetUserDefinedFunctionsRequest = {
        "pattern": pattern
    }
    if catalog_id is not None:
        input_["catalog_id"] = catalog_id
    if database_name is not None:
        input_["database_name"] = database_name
    if function_type is not None:
        input_["function_type"] = function_type
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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