

# GetFunction
<a name="API_GetFunction"></a>

返回有关函数或函数版本的信息，其中包含部署包下载链接，有效时间 10 分钟。如果指定函数版本，则仅返回特定于该版本的详细信息。

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

```
GET /2015-03-31/functions/FunctionName?Qualifier=Qualifier HTTP/1.1
```

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

请求使用以下 URI 参数。

 ** [FunctionName](#API_GetFunction_RequestSyntax) **   <a name="lambda-GetFunction-request-FunctionName"></a>
Lambda 函数的名称、版本或别名。  

**名称格式**
+  **函数名称** – `my-function`（仅限名称）、`my-function:v1`（具有别名）。
+  **函数 ARN** – `arn:aws:lambda:us-west-2:123456789012:function:my-function`。
+  **部分 ARN** – `123456789012:function:my-function`。
您可以将一个版本号或别名附加到任何格式。长度约束仅适用于完整 ARN。如果您仅指定函数名称，它的长度限制为 64 个字符。  
长度限制：最小长度为 1。长度上限为 170。  
模式：`(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-_]+))?`  
必需：是

 ** [Qualifier](#API_GetFunction_RequestSyntax) **   <a name="lambda-GetFunction-request-Qualifier"></a>
指定版本或别名以获取有关函数发布版本的详细信息。  
长度限制：最小长度为 1。长度上限为 128。  
模式：`(|[a-zA-Z0-9$_-]+)`

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

该请求没有请求正文。

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

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

{
   "Code": { 
      "ImageUri": "string",
      "Location": "string",
      "RepositoryType": "string",
      "ResolvedImageUri": "string"
   },
   "Concurrency": { 
      "ReservedConcurrentExecutions": number
   },
   "Configuration": { 
      "Architectures": [ "string" ],
      "CodeSha256": "string",
      "CodeSize": number,
      "DeadLetterConfig": { 
         "TargetArn": "string"
      },
      "Description": "string",
      "Environment": { 
         "Error": { 
            "ErrorCode": "string",
            "Message": "string"
         },
         "Variables": { 
            "string" : "string" 
         }
      },
      "EphemeralStorage": { 
         "Size": number
      },
      "FileSystemConfigs": [ 
         { 
            "Arn": "string",
            "LocalMountPath": "string"
         }
      ],
      "FunctionArn": "string",
      "FunctionName": "string",
      "Handler": "string",
      "ImageConfigResponse": { 
         "Error": { 
            "ErrorCode": "string",
            "Message": "string"
         },
         "ImageConfig": { 
            "Command": [ "string" ],
            "EntryPoint": [ "string" ],
            "WorkingDirectory": "string"
         }
      },
      "KMSKeyArn": "string",
      "LastModified": "string",
      "LastUpdateStatus": "string",
      "LastUpdateStatusReason": "string",
      "LastUpdateStatusReasonCode": "string",
      "Layers": [ 
         { 
            "Arn": "string",
            "CodeSize": number,
            "SigningJobArn": "string",
            "SigningProfileVersionArn": "string"
         }
      ],
      "LoggingConfig": { 
         "ApplicationLogLevel": "string",
         "LogFormat": "string",
         "LogGroup": "string",
         "SystemLogLevel": "string"
      },
      "MasterArn": "string",
      "MemorySize": number,
      "PackageType": "string",
      "RevisionId": "string",
      "Role": "string",
      "Runtime": "string",
      "RuntimeVersionConfig": { 
         "Error": { 
            "ErrorCode": "string",
            "Message": "string"
         },
         "RuntimeVersionArn": "string"
      },
      "SigningJobArn": "string",
      "SigningProfileVersionArn": "string",
      "SnapStart": { 
         "ApplyOn": "string",
         "OptimizationStatus": "string"
      },
      "State": "string",
      "StateReason": "string",
      "StateReasonCode": "string",
      "Timeout": number,
      "TracingConfig": { 
         "Mode": "string"
      },
      "Version": "string",
      "VpcConfig": { 
         "Ipv6AllowedForDualStack": boolean,
         "SecurityGroupIds": [ "string" ],
         "SubnetIds": [ "string" ],
         "VpcId": "string"
      }
   },
   "Tags": { 
      "string" : "string" 
   }
}
```

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

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

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

 ** [Code](#API_GetFunction_ResponseSyntax) **   <a name="lambda-GetFunction-response-Code"></a>
函数或版本的部署包。  
类型：[FunctionCodeLocation](API_FunctionCodeLocation.md) 对象

 ** [Concurrency](#API_GetFunction_ResponseSyntax) **   <a name="lambda-GetFunction-response-Concurrency"></a>
函数的[预留并发](https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html)。  
类型：[Concurrency](API_Concurrency.md) 对象

 ** [Configuration](#API_GetFunction_ResponseSyntax) **   <a name="lambda-GetFunction-response-Configuration"></a>
函数或版本的配置。  
类型：[FunctionConfiguration](API_FunctionConfiguration.md) 对象

 ** [Tags](#API_GetFunction_ResponseSyntax) **   <a name="lambda-GetFunction-response-Tags"></a>
函数的[标签](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html)。  
类型：字符串到字符串映射

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

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

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

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

 ** 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_GetFunction_SeeAlso"></a>

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