

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 应用程序 applicationID 版本语义版本
<a name="applications-applicationid-versions-semanticversion"></a>

## URI
<a name="applications-applicationid-versions-semanticversion-url"></a>

`/applications/{{applicationId}}/versions/{{semanticVersion}}`

## HTTP 方法
<a name="applications-applicationid-versions-semanticversion-http-methods"></a>

### PUT
<a name="applications-applicationid-versions-semanticversionput"></a>

**操作 ID：**`CreateApplicationVersion`

创建应用程序版本。


**路径参数**  

| Name | Type | 必需 | 描述 | 
| --- |--- |--- |--- |
| {{applicationId}} | 字符串 | True | 应用程序的 Amazon 资源名称（ARN）。 | 
| {{semanticVersion}} | 字符串 | True | 新版本的语义版本。 | 


**响应**  

| 状态代码 | 响应模型 | 说明 | 
| --- |--- |--- |
| 201 | Version | 成功 | 
| 400 | BadRequestException | 请求中的参数之一无效。 | 
| 403 | ForbiddenException | 客户端未通过身份验证。 | 
| 409 | ConflictException | 该资源已存在。 | 
| 429 | TooManyRequestsException | 客户端每单位时间发送的请求数超过了允许的请求数。 | 
| 500 | InternalServerErrorException | 该 Amazon Serverless Application Repository 服务遇到了内部错误。 | 

### OPTIONS
<a name="applications-applicationid-versions-semanticversionoptions"></a>


**路径参数**  

| Name | Type | 必需 | 描述 | 
| --- |--- |--- |--- |
| {{applicationId}} | 字符串 | True | 应用程序的 Amazon 资源名称（ARN）。 | 
| {{semanticVersion}} | 字符串 | True | 新版本的语义版本。 | 


**响应**  

| 状态代码 | 响应模型 | 说明 | 
| --- |--- |--- |
| 200 | 无 | 200 条回复 | 

## 架构
<a name="applications-applicationid-versions-semanticversion-schemas"></a>

### 请求正文
<a name="applications-applicationid-versions-semanticversion-request-examples"></a>

#### PUT 架构
<a name="applications-applicationid-versions-semanticversion-request-body-put-example"></a>

```
{
  "templateBody": "string",
  "templateUrl": "string",
  "sourceCodeUrl": "string",
  "sourceCodeArchiveUrl": "string"
}
```

### 响应正文
<a name="applications-applicationid-versions-semanticversion-response-examples"></a>

#### Version 架构
<a name="applications-applicationid-versions-semanticversion-response-body-version-example"></a>

```
{
  "applicationId": "string",
  "semanticVersion": "string",
  "sourceCodeUrl": "string",
  "sourceCodeArchiveUrl": "string",
  "templateUrl": "string",
  "creationTime": "string",
  "parameterDefinitions": [
    {
      "name": "string",
      "defaultValue": "string",
      "description": "string",
      "type": "string",
      "noEcho": boolean,
      "allowedPattern": "string",
      "constraintDescription": "string",
      "minValue": integer,
      "maxValue": integer,
      "minLength": integer,
      "maxLength": integer,
      "allowedValues": [
        "string"
      ],
      "referencedByResources": [
        "string"
      ]
    }
  ],
  "requiredCapabilities": [
    enum
  ],
  "resourcesSupported": boolean
}
```

#### BadRequestException 架构
<a name="applications-applicationid-versions-semanticversion-response-body-badrequestexception-example"></a>

```
{
  "message": "string",
  "errorCode": "string"
}
```

#### ForbiddenException 架构
<a name="applications-applicationid-versions-semanticversion-response-body-forbiddenexception-example"></a>

```
{
  "message": "string",
  "errorCode": "string"
}
```

#### ConflictException 架构
<a name="applications-applicationid-versions-semanticversion-response-body-conflictexception-example"></a>

```
{
  "message": "string",
  "errorCode": "string"
}
```

#### TooManyRequestsException 架构
<a name="applications-applicationid-versions-semanticversion-response-body-toomanyrequestsexception-example"></a>

```
{
  "message": "string",
  "errorCode": "string"
}
```

#### InternalServerErrorException 架构
<a name="applications-applicationid-versions-semanticversion-response-body-internalservererrorexception-example"></a>

```
{
  "message": "string",
  "errorCode": "string"
}
```

## Properties
<a name="applications-applicationid-versions-semanticversion-properties"></a>

### BadRequestException
<a name="applications-applicationid-versions-semanticversion-model-badrequestexception"></a>

请求中的参数之一无效。


| 属性 | Type | 必需 | 描述 | 
| --- |--- |--- |--- |
| errorCode | 字符串 | False | 400 | 
| message | 字符串 | False | 请求中的参数之一无效。 | 

### Capability
<a name="applications-applicationid-versions-semanticversion-model-capability"></a>

部署某些应用程序时必须指定的值。
+ `CAPABILITY_IAM`
+ `CAPABILITY_NAMED_IAM`
+ `CAPABILITY_AUTO_EXPAND`
+ `CAPABILITY_RESOURCE_POLICY`

### ConflictException
<a name="applications-applicationid-versions-semanticversion-model-conflictexception"></a>

该资源已存在。


| 属性 | Type | 必需 | 描述 | 
| --- |--- |--- |--- |
| errorCode | 字符串 | False | 409 | 
| message | 字符串 | False | 该资源已存在。 | 

### CreateApplicationVersionInput
<a name="applications-applicationid-versions-semanticversion-model-createapplicationversioninput"></a>

创建版本请求。


| 属性 | Type | 必需 | 描述 | 
| --- |--- |--- |--- |
| sourceCodeArchiveUrl | 字符串 | False | 指向 S3 对象的链接，其中包含此版本应用程序的源代码的 ZIP 存档。<br />最大大小 50 MB | 
| sourceCodeUrl | 字符串 | False | 指向应用程序源代码的公共存储库的链接，例如特定 GitHub 提交的 URL。 | 
| templateBody | 字符串 | False | 应用程序的原始打包 Amazon SAM 模板。 | 
| templateUrl | 字符串 | False | 指向应用程序打包 Amazon SAM 模板的链接。 | 

### ForbiddenException
<a name="applications-applicationid-versions-semanticversion-model-forbiddenexception"></a>

客户端未通过身份验证。


| 属性 | Type | 必需 | 描述 | 
| --- |--- |--- |--- |
| errorCode | 字符串 | False | 403 | 
| message | 字符串 | False | 客户端未通过身份验证。 | 

### InternalServerErrorException
<a name="applications-applicationid-versions-semanticversion-model-internalservererrorexception"></a>

该 Amazon Serverless Application Repository 服务遇到了内部错误。


| 属性 | Type | 必需 | 描述 | 
| --- |--- |--- |--- |
| errorCode | 字符串 | False | 500 | 
| message | 字符串 | False | 该 Amazon Serverless Application Repository 服务遇到了内部错误。 | 

### ParameterDefinition
<a name="applications-applicationid-versions-semanticversion-model-parameterdefinition"></a>

应用程序支持的参数。


| 属性 | Type | 必需 | 描述 | 
| --- |--- |--- |--- |
| allowedPattern | 字符串 | False | 一个正则表达式，表示要允许 `String` 类型使用的模式。 | 
| allowedValues | string 类型的数组 | False | 包含参数允许值列表的阵列。 | 
| constraintDescription | 字符串 | False | 用于在违反约束时说明该约束的字符串。例如，在没有约束条件描述的情况下，具有允许的 `[A-Za-z0-9]+` 模式的参数会在用户指定无效值时显示以下错误消息：<br /> `Malformed input-Parameter MyParameter must match pattern [A-Za-z0-9]+` <br />通过添加约束条件描述（例如 “必须仅包含大写和小写字母和数字”），可以显示以下自定义错误消息：<br /> `Malformed input-Parameter MyParameter must contain only uppercase and lowercase letters and numbers.`  | 
| defaultValue | 字符串 | False | 模板适当类型的值，用于在创建堆栈时未指定值的情况下。如果您定义参数的约束，则必须指定一个符合这些约束的值。 | 
| description | 字符串 | False | 描述参数的字符串，最多 4,000 个字符。 | 
| maxLength | 整数 | False | 一个整数值，用于确定要允许的`String`类型的最大字符数。 | 
| maxValue | 整数 | False | 一个数值，用于确定要允许`Number`类型使用的最大数值。 | 
| minLength | 整数 | False | 一个整数值，用于确定要允许`String`类型使用的最小字符数。 | 
| minValue | 整数 | False | 一个数值，用于确定要允许`Number`类型使用的最小数值。 | 
| name | 字符串 | True | 参数的名称。 | 
| noEcho | 布尔值 | False | 每当有人调用描述堆栈时，是否要屏蔽参数值。如果将该值设置为 true，则使用星号 (\*\*\*\*\*) 掩盖参数值。 | 
| referencedByResources | string 类型的数组 | True | 使用此参数的 Amazon SAM 资源列表。 | 
| type | 字符串 | False | 参数的类型。<br />有效值：`String \| Number \| List<Number> \| CommaDelimitedList`<br /> `String`: 一个字面字符串。<br />例如，用户可以指定`"MyUserName"`。<br /> `Number`: 整数或浮点数。 Amazon CloudFormation 将参数值验证为数字。但是，当您在模板的其他地方使用该参数时（例如，通过使用`Ref`内部函数），参数值将变为字符串。<br />例如，用户可以指定`"8888"`。<br /> `List<Number>`: 用逗号分隔的整数或浮点数组。 Amazon CloudFormation 将参数值验证为数字。但是，当您在模板的其他地方使用该参数时（例如，通过使用`Ref`内部函数），参数值将变成字符串列表。<br />例如，用户可以指定 “80,20”，然后`Ref`得出结果。`["80","20"]`<br /> `CommaDelimitedList`：用逗号分隔的文字字符串数组。字符串的总数应比逗号总数多 1。此外，每个成员字符串都经过空格修剪。<br />例如，用户可以指定 “测试、开发、生产”，然后输入`Ref`结果。`["test","dev","prod"]` | 

### TooManyRequestsException
<a name="applications-applicationid-versions-semanticversion-model-toomanyrequestsexception"></a>

客户端每单位时间发送的请求数超过了允许的请求数。


| 属性 | Type | 必需 | 描述 | 
| --- |--- |--- |--- |
| errorCode | 字符串 | False | 429 | 
| message | 字符串 | False | 客户端每单位时间发送的请求数超过了允许的请求数。 | 

### Version
<a name="applications-applicationid-versions-semanticversion-model-version"></a>

应用程序版本详情。


| 属性 | Type | 必需 | 描述 | 
| --- |--- |--- |--- |
| applicationId | 字符串 | True |  应用程序 Amazon 资源名称 (ARN)。 | 
| creationTime | 字符串 | True | 此资源的创建日期和时间。 | 
| parameterDefinitions | [ParameterDefinition](#applications-applicationid-versions-semanticversion-model-parameterdefinition) 类型的数组 | True | 应用程序支持的参数类型数组。 | 
| requiredCapabilities | [Capability](#applications-applicationid-versions-semanticversion-model-capability) 类型的数组 | True | 在部署某些应用程序之前必须指定的值列表。某些应用程序可能包含可能影响您 Amazon 账户权限的资源，例如，通过创建新 Amazon Identity and Access Management (IAM) 用户。对于这些应用程序，必须通过指定此参数来明确确认其功能。<br />唯一有效的值是`CAPABILITY_IAM`、`CAPABILITY_NAMED_IAM``CAPABILITY_RESOURCE_POLICY`、和`CAPABILITY_AUTO_EXPAND`。<br />以下资源需要您指定`CAPABILITY_IAM`或`CAPABILITY_NAMED_IAM`：[AWS::IAM::Group](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html)、[AWS::IAM::InstanceProfile[AWS::IAM::Policy](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/aws-resource-iam-policy.html)](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html)、和[AWS::IAM::Role](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html)。如果应用程序包含 IAM 资源，则可以指定`CAPABILITY_IAM`或`CAPABILITY_NAMED_IAM`。如果应用程序包含具有自定义名称的 IAM 资源，您必须指定 `CAPABILITY_NAMED_IAM`。<br />以下资源要求您指定`CAPABILITY_RESOURCE_POLICY`：[AWS::Lambda::Permission](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html)、[AWS:: iam: Policy](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/aws-resource-iam-policy.html)、、[AWS::ApplicationAutoScaling::ScalingPolicy](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/aws-resource-applicationautoscaling-scalingpolicy.html)、[AWS::S3::BucketPolicy](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/aws-properties-s3-policy.html)和。[AWS::SQS::QueuePolicy[AWS::SNS::TopicPolicy](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/aws-properties-sns-policy.html)](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/aws-properties-sqs-policy.html)<br />包含一个或多个嵌套应用程序的应用程序要求您指定 `CAPABILITY_AUTO_EXPAND`。<br />如果您的应用程序模板包含上述任何资源，我们建议您在部署之前查看与该应用程序关联的所有权限。如果您没有为需要功能的应用程序指定此参数，则调用将失败。 | 
| resourcesSupported | 布尔值 | True | 检索该应用程序所在的区域是否支持此应用程序中包含的所有 Amazon 资源。 | 
| semanticVersion | 字符串 | True | 应用程序的语义版本：<br /> [https://semver.org/](https://semver.org/)  | 
| sourceCodeArchiveUrl | 字符串 | False | 指向 S3 对象的链接，其中包含此版本应用程序的源代码的 ZIP 存档。<br />最大大小 50 MB | 
| sourceCodeUrl | 字符串 | False | 指向应用程序源代码的公共存储库的链接，例如特定 GitHub 提交的 URL。 | 
| templateUrl | 字符串 | True | 指向应用程序打包 Amazon SAM 模板的链接。 | 