Skip to content

list_functions

list_functions(
    *,
    config_overrides: Optional[LambdaClientConfig] = None,
    master_region: Optional[MasterRegion] = None,
    function_version: Optional[FunctionVersion] = None,
    marker: Optional[String] = None,
    max_items: Optional[MaxListItems] = None,
) -> ListFunctionsResponse

Returns a list of Lambda Event Functions, with the version-specific configuration of each. Lambda returns up to 50 functions per call.

Set FunctionVersion to ALL to include all published versions of each function in addition to the unpublished version.

The ListFunctions operation returns a subset of the FunctionConfiguration fields. To get the additional fields (State, StateReasonCode, StateReason, LastUpdateStatus, LastUpdateStatusReason, LastUpdateStatusReasonCode, RuntimeVersionConfig) for a function or version, use GetFunction.

Parameters:

  • master_region (Optional[MasterRegion], default: None ) –

    For Lambda@Edge functions, the Amazon Web Services Region of the master function. For example, us-east-1 filters the list of functions to include only Lambda@Edge functions replicated from a master function in US East (N. Virginia). If specified, you must set FunctionVersion to ALL.

  • function_version (Optional[FunctionVersion], default: None ) –

    Set to ALL to include entries for all published versions of each function.

  • marker (Optional[String], default: None ) –

    Specify the pagination token that's returned by a previous request to retrieve the next page of results.

  • max_items (Optional[MaxListItems], default: None ) –

    The maximum number of functions to return in the response. Note that ListFunctions returns a maximum of 50 items in each response, even if you set the number higher.

Raises:

Examples:

To get a list of Lambda functions This operation returns a list of Lambda functions.

>>> client.list_functions()
Source code in docs_src/capo_lambda/_services/_lambda.py
def list_functions(
    self,
    *,
    config_overrides: Optional[LambdaClientConfig] = None,
    master_region: Optional["capo_lambda.types.master_region.MasterRegion"] = None,
    function_version: Optional[
        "capo_lambda.types.function_version.FunctionVersion"
    ] = None,
    marker: Optional["capo_lambda.types.string.String"] = None,
    max_items: Optional["capo_lambda.types.max_list_items.MaxListItems"] = None,
) -> "capo_lambda.types.list_functions_response.ListFunctionsResponse":
    """<p>Returns a list of Lambda Event Functions, with the version-specific configuration of each. Lambda returns up to 50 functions per call.</p> <p>Set <code>FunctionVersion</code> to <code>ALL</code> to include all published versions of each function in addition to the unpublished version.</p> <note> <p>The <code>ListFunctions</code> operation returns a subset of the <a>FunctionConfiguration</a> fields. To get the additional fields (State, StateReasonCode, StateReason, LastUpdateStatus, LastUpdateStatusReason, LastUpdateStatusReasonCode, RuntimeVersionConfig) for a function or version, use <a>GetFunction</a>.</p> </note>

    Args:
        master_region: <p>For Lambda@Edge functions, the Amazon Web Services Region of the master function. For example, <code>us-east-1</code> filters the list of functions to include only Lambda@Edge functions replicated from a master function in US East (N. Virginia). If specified, you must set <code>FunctionVersion</code> to <code>ALL</code>.</p>
        function_version: <p>Set to <code>ALL</code> to include entries for all published versions of each function.</p>
        marker: <p>Specify the pagination token that's returned by a previous request to retrieve the next page of results.</p>
        max_items: <p>The maximum number of functions to return in the response. Note that <code>ListFunctions</code> returns a maximum of 50 items in each response, even if you set the number higher.</p>

    Raises:
        capo_lambda.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>One of the parameters in the request is not valid.</p>
        capo_lambda.errors.service_exception.ServiceException: <p>The Lambda service encountered an internal error.</p>
        capo_lambda.errors.too_many_requests_exception.TooManyRequestsException: <p>The request throughput limit was exceeded. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html#api-requests">Lambda quotas</a>.</p>
        capo_lambda.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To get a list of Lambda functions
        This operation returns a list of Lambda functions.

        >>> client.list_functions()
    """

    def _handler(
        req: "OperationRequest[capo_lambda.types.list_functions_request.ListFunctionsRequest]",
    ) -> OperationResponse[
        "capo_lambda.types.list_functions_response.ListFunctionsResponse"
    ]:
        import capo_lambda._operations.aws_gir_api_service.list_functions

        output, http_response = (
            capo_lambda._operations.aws_gir_api_service.list_functions.list_functions(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_lambda.types.list_functions_response.ListFunctionsResponse",
    ) -> dict[str, Any]:
        import capo_lambda.types.list_functions_response

        return capo_lambda.types.list_functions_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ListFunctions", redact_output=_redact_output),
    )
    input_: capo_lambda.types.list_functions_request.ListFunctionsRequest = {}
    if master_region is not None:
        input_["master_region"] = master_region
    if function_version is not None:
        input_["function_version"] = function_version
    if marker is not None:
        input_["marker"] = marker
    if max_items is not None:
        input_["max_items"] = max_items

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