

# ListLayers
<a name="API_ListLayers"></a>

列出 [AWS Lambda 层](https://docs.aws.amazon.com/lambda/latest/dg/invocation-layers.html)并显示有关每个函数层的最新版本的信息。指定[运行时标识符](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)，以仅列出指示它们与该运行时兼容的层。指定兼容架构以仅包含与该[指令集架构](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)兼容的层。

## 请求语法
<a name="API_ListLayers_RequestSyntax"></a>

```
GET /2018-10-31/layers?CompatibleArchitecture=CompatibleArchitecture&CompatibleRuntime=CompatibleRuntime&Marker=Marker&MaxItems=MaxItems HTTP/1.1
```

## URI 请求参数
<a name="API_ListLayers_RequestParameters"></a>

请求使用以下 URI 参数。

 ** [CompatibleArchitecture](#API_ListLayers_RequestSyntax) **   <a name="lambda-ListLayers-request-CompatibleArchitecture"></a>
兼容[指令集架构](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)。  
有效值：`x86_64 | arm64`

 ** [CompatibleRuntime](#API_ListLayers_RequestSyntax) **   <a name="lambda-ListLayers-request-CompatibleRuntime"></a>
运行时标识符。例如，`java21`。  
以下列表包括已弃用的运行时。有关更多信息，请参阅[运行时弃用策略](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-support-policy)。  
有效值：`nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2 | nodejs18.x | python3.10 | java17 | ruby3.2 | python3.11 | nodejs20.x | provided.al2023 | python3.12 | java21`

 ** [Marker](#API_ListLayers_RequestSyntax) **   <a name="lambda-ListLayers-request-Marker"></a>
由上一次调用返回的分页令牌。

 ** [MaxItems](#API_ListLayers_RequestSyntax) **   <a name="lambda-ListLayers-request-MaxItems"></a>
要返回的层最大数量。  
有效范围：最小值为 1。最大值为 50。

## 请求正文
<a name="API_ListLayers_RequestBody"></a>

该请求没有请求正文。

## 响应语法
<a name="API_ListLayers_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "Layers": [ 
      { 
         "LatestMatchingVersion": { 
            "CompatibleArchitectures": [ "string" ],
            "CompatibleRuntimes": [ "string" ],
            "CreatedDate": "string",
            "Description": "string",
            "LayerVersionArn": "string",
            "LicenseInfo": "string",
            "Version": number
         },
         "LayerArn": "string",
         "LayerName": "string"
      }
   ],
   "NextMarker": "string"
}
```

## 响应元素
<a name="API_ListLayers_ResponseElements"></a>

如果此操作成功，则该服务将会发送回 HTTP 200 响应。

服务以 JSON 格式返回以下数据。

 ** [Layers](#API_ListLayers_ResponseSyntax) **   <a name="lambda-ListLayers-response-Layers"></a>
函数层的列表。  
类型：[LayersListItem](API_LayersListItem.md) 对象数组

 ** [NextMarker](#API_ListLayers_ResponseSyntax) **   <a name="lambda-ListLayers-response-NextMarker"></a>
当响应不包含所有层时返回的分页令牌。  
类型：字符串

## 错误
<a name="API_ListLayers_Errors"></a>

有关所有操作返回的常见错误的信息，请参阅 [常见错误](CommonErrors.md)。

 ** InvalidParameterValueException **   
请求中的参数之一无效。  
HTTP 状态代码：400

 ** ServiceException **   
AWS Lambda 服务遇到了内部错误。  
HTTP 状态代码：500

 ** TooManyRequestsException **   
超出了请求吞吐量限制。有关更多信息，请参阅 [Lambda 限额](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html#api-requests)。  
HTTP 状态代码：429

## 另请参阅
<a name="API_ListLayers_SeeAlso"></a>

有关在特定语言的 AWS SDK 中使用此 API 的更多信息，请参阅以下内容：
+  [AWS 命令行界面](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListLayers) 
+  [适用于 .NET 的 AWS SDK](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListLayers) 
+  [适用于 C\$1\$1 的 AWS SDK](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListLayers) 
+  [适用于 Go 的 AWS SDK](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListLayers) 
+  [适用于 Java V2 的 AWS SDK](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListLayers) 
+  [AWS 适用于 JavaScript 的开发工具包 V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/lambda-2015-03-31/ListLayers) 
+  [适用于 PHP V3 的 AWS SDK](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListLayers) 
+  [适用于 Python 的 AWS SDK](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListLayers) 
+  [适用于 Ruby V3 的 AWS SDK](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListLayers) 