Skip to content

list_layer_versions

list_layer_versions(
    layer_name: LayerName,
    *,
    config_overrides: Optional[LambdaClientConfig] = None,
    compatible_architecture: Optional[Architecture] = None,
    compatible_runtime: Optional[Runtime] = None,
    marker: Optional[String] = None,
    max_items: Optional[MaxLayerListItems] = None,
) -> ListLayerVersionsResponse

Lists the versions of an Lambda layer. Versions that have been deleted aren't listed. Specify a runtime identifier to list only versions that indicate that they're compatible with that runtime. Specify a compatible architecture to include only layer versions that are compatible with that architecture.

Parameters:

Raises:

Examples:

To list versions of a layer The following example displays information about the versions for the layer named blank-java-lib

>>> client.list_layer_versions(layer_name='blank-java-lib')
Source code in docs_src/capo_lambda/_services/_lambda.py
def list_layer_versions(
    self,
    layer_name: "capo_lambda.types.layer_name.LayerName",
    *,
    config_overrides: Optional[LambdaClientConfig] = None,
    compatible_architecture: Optional[
        "capo_lambda.types.architecture.Architecture"
    ] = None,
    compatible_runtime: Optional["capo_lambda.types.runtime.Runtime"] = None,
    marker: Optional["capo_lambda.types.string.String"] = None,
    max_items: Optional[
        "capo_lambda.types.max_layer_list_items.MaxLayerListItems"
    ] = None,
) -> "capo_lambda.types.list_layer_versions_response.ListLayerVersionsResponse":
    """<p>Lists the versions of an <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html">Lambda layer</a>. Versions that have been deleted aren't listed. Specify a <a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html">runtime identifier</a> to list only versions that indicate that they're compatible with that runtime. Specify a compatible architecture to include only layer versions that are compatible with that architecture.</p>

    Args:
        compatible_architecture: <p>The compatible <a href="https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html">instruction set architecture</a>.</p>
        compatible_runtime: <p>A runtime identifier.</p> <p>The following list includes deprecated runtimes. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels">Runtime use after deprecation</a>.</p> <p>For a list of all currently supported runtimes, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported">Supported runtimes</a>.</p>
        layer_name: <p>The name or Amazon Resource Name (ARN) of the layer.</p>
        marker: <p>A pagination token returned by a previous call.</p>
        max_items: <p>The maximum number of versions to return.</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 versions of a layer
        The following example displays information about the versions for the layer named blank-java-lib

        >>> client.list_layer_versions(layer_name='blank-java-lib')
    """

    def _handler(
        req: "OperationRequest[capo_lambda.types.list_layer_versions_request.ListLayerVersionsRequest]",
    ) -> OperationResponse[
        "capo_lambda.types.list_layer_versions_response.ListLayerVersionsResponse"
    ]:
        import capo_lambda._operations.aws_gir_api_service.list_layer_versions

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListLayerVersions")
    )
    input_: capo_lambda.types.list_layer_versions_request.ListLayerVersionsRequest = {
        "layer_name": layer_name
    }
    if compatible_architecture is not None:
        input_["compatible_architecture"] = compatible_architecture
    if compatible_runtime is not None:
        input_["compatible_runtime"] = compatible_runtime
    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