

# ListEventSourceMappings
<a name="API_ListEventSourceMappings"></a>

列出事件源映射。指定 `EventSourceArn` 以仅显示单个事件源的事件源映射。

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

```
GET /2015-03-31/event-source-mappings/?EventSourceArn=EventSourceArn&FunctionName=FunctionName&Marker=Marker&MaxItems=MaxItems HTTP/1.1
```

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

请求使用以下 URI 参数。

 ** [EventSourceArn](#API_ListEventSourceMappings_RequestSyntax) **   <a name="lambda-ListEventSourceMappings-request-EventSourceArn"></a>
事件源的 Amazon 资源名称（ARN）。  
+  **Amazon Kinesis** – 数据流或流使用者的 ARN。
+  **Amazon DynamoDB Streams** – 流的 ARN。
+  **Amazon Simple Queue Service** – 队列的 ARN。
+  **Amazon Managed Streaming for Apache Kafka** – 集群的 ARN 或 VPC 连接的 ARN（用于[跨账户事件源映射](https://docs.amazonaws.cn/lambda/latest/dg/with-msk.html#msk-multi-vpc)）。
+  **Amazon MQ** – 代理的 ARN。
+  **Amazon DocumentDB** – DocumentDB 更改流的 ARN。
模式：`arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)`

 ** [FunctionName](#API_ListEventSourceMappings_RequestSyntax) **   <a name="lambda-ListEventSourceMappings-request-FunctionName"></a>
Lambda 函数的名称。  

**名称格式**
+  **函数名称** – `MyFunction`。
+  **函数 ARN** – `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`。
+  **版本或别名 ARN** – `arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD`。
+  **部分 ARN** – `123456789012:function:MyFunction`。
长度约束仅适用于完整 ARN。如果您仅指定函数名称，它的长度将限制为 64 个字符。  
长度限制：最小长度为 1。长度上限为 140。  
模式：`(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?`

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

 ** [MaxItems](#API_ListEventSourceMappings_RequestSyntax) **   <a name="lambda-ListEventSourceMappings-request-MaxItems"></a>
要返回的事件源映射最大数量。请注意，即使您设置的数字较高，ListEventSourceMappings 在每个响应中最多返回 100 个项目。  
有效范围：最小值为 1。最大值为 10000。

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

该请求没有请求正文。

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

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

{
   "EventSourceMappings": [ 
      { 
         "AmazonManagedKafkaEventSourceConfig": { 
            "ConsumerGroupId": "string"
         },
         "BatchSize": number,
         "BisectBatchOnFunctionError": boolean,
         "DestinationConfig": { 
            "OnFailure": { 
               "Destination": "string"
            },
            "OnSuccess": { 
               "Destination": "string"
            }
         },
         "DocumentDBEventSourceConfig": { 
            "CollectionName": "string",
            "DatabaseName": "string",
            "FullDocument": "string"
         },
         "EventSourceArn": "string",
         "FilterCriteria": { 
            "Filters": [ 
               { 
                  "Pattern": "string"
               }
            ]
         },
         "FunctionArn": "string",
         "FunctionResponseTypes": [ "string" ],
         "LastModified": number,
         "LastProcessingResult": "string",
         "MaximumBatchingWindowInSeconds": number,
         "MaximumRecordAgeInSeconds": number,
         "MaximumRetryAttempts": number,
         "ParallelizationFactor": number,
         "Queues": [ "string" ],
         "ScalingConfig": { 
            "MaximumConcurrency": number
         },
         "SelfManagedEventSource": { 
            "Endpoints": { 
               "string" : [ "string" ]
            }
         },
         "SelfManagedKafkaEventSourceConfig": { 
            "ConsumerGroupId": "string"
         },
         "SourceAccessConfigurations": [ 
            { 
               "Type": "string",
               "URI": "string"
            }
         ],
         "StartingPosition": "string",
         "StartingPositionTimestamp": number,
         "State": "string",
         "StateTransitionReason": "string",
         "Topics": [ "string" ],
         "TumblingWindowInSeconds": number,
         "UUID": "string"
      }
   ],
   "NextMarker": "string"
}
```

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

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

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

 ** [EventSourceMappings](#API_ListEventSourceMappings_ResponseSyntax) **   <a name="lambda-ListEventSourceMappings-response-EventSourceMappings"></a>
事件源映射的列表。  
类型：[EventSourceMappingConfiguration](API_EventSourceMappingConfiguration.md) 对象数组

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

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

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

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

 ** ResourceNotFoundException **   
请求中指定的资源不存在。  
HTTP 状态代码：404

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

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

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

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