Skip to content

list_aliases

list_aliases(
    function_name: FunctionName,
    *,
    config_overrides: Optional[LambdaClientConfig] = None,
    function_version: Optional[VersionWithLatestPublished] = None,
    marker: Optional[String] = None,
    max_items: Optional[MaxListItems] = None,
) -> ListAliasesResponse

Returns a list of aliases for a Lambda Event Function.

Parameters:

  • function_name (FunctionName) –

    The name or ARN of the Lambda function.

    Name formats

    • Function name - MyFunction.

    • Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction.

    • Partial ARN - 123456789012:function:MyFunction.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

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

    Specify a function version to only list aliases that invoke that version.

  • 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 ) –

    Limit the number of aliases returned.

Raises:

Examples:

To list a function's aliases The following example returns a list of aliases for a function named my-function.

>>> client.list_aliases(function_name='my-function')
Source code in docs_src/capo_lambda/_services/_lambda.py
def list_aliases(
    self,
    function_name: "capo_lambda.types.function_name.FunctionName",
    *,
    config_overrides: Optional[LambdaClientConfig] = None,
    function_version: Optional[
        "capo_lambda.types.version_with_latest_published.VersionWithLatestPublished"
    ] = None,
    marker: Optional["capo_lambda.types.string.String"] = None,
    max_items: Optional["capo_lambda.types.max_list_items.MaxListItems"] = None,
) -> "capo_lambda.types.list_aliases_response.ListAliasesResponse":
    """<p>Returns a list of <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html">aliases</a> for a Lambda Event Function.</p>

    Args:
        function_name: <p>The name or ARN of the Lambda function.</p> <p class="title"> <b>Name formats</b> </p> <ul> <li> <p> <b>Function name</b> - <code>MyFunction</code>.</p> </li> <li> <p> <b>Function ARN</b> - <code>arn:aws:lambda:us-west-2:123456789012:function:MyFunction</code>.</p> </li> <li> <p> <b>Partial ARN</b> - <code>123456789012:function:MyFunction</code>.</p> </li> </ul> <p>The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.</p>
        function_version: <p>Specify a function version to only list aliases that invoke that version.</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>Limit the number of aliases returned.</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.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</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 list a function's aliases
        The following example returns a list of aliases for a function named my-function.

        >>> client.list_aliases(function_name='my-function')
    """

    def _handler(
        req: "OperationRequest[capo_lambda.types.list_aliases_request.ListAliasesRequest]",
    ) -> OperationResponse[
        "capo_lambda.types.list_aliases_response.ListAliasesResponse"
    ]:
        import capo_lambda._operations.aws_gir_api_service.list_aliases

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListAliases")
    )
    input_: capo_lambda.types.list_aliases_request.ListAliasesRequest = {
        "function_name": function_name
    }
    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