AWS::ApiGateway::DocumentationPart - AWS CloudFormation
AWS 文档中描述的 AWS 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 AWS 服务入门

AWS::ApiGateway::DocumentationPart

AWS::ApiGateway::DocumentationPart 资源创建 API 的文档部分。有关更多信息,请参阅 API Gateway 开发人员指南中的 API Gateway 中的 API 文档表示形式

语法

要在 AWS CloudFormation 模板中声明此实体,请使用以下语法:

JSON

{ "Type" : "AWS::ApiGateway::DocumentationPart", "Properties" : { "Location" : Location, "Properties" : String, "RestApiId" : String } }

YAML

Type: AWS::ApiGateway::DocumentationPart Properties: Location: Location Properties: String RestApiId: String

属性

Location

文档适用于的 API 实体的位置。

必需:是

类型Location

Update requires: Replacement

Properties

目标 API 实体的文档内容映射。

必需:是

类型:字符串

Update requires: No interruption

RestApiId

目标 API 实体的标识符。

必需:是

类型:字符串

Update requires: Replacement

返回值

Ref

在将此资源的逻辑 ID 传递给内部 Ref 函数时,Ref 返回 文档部分的 ID,例如 abc123

For more information about using the Ref function, see Ref.

示例

将文档部分与文档版本关联

以下示例将 API 实体的文档部件与文档版本相关联。

JSON

{ "Parameters": { "apiName": { "Type": "String" }, "description": { "Type": "String" }, "version": { "Type": "String" }, "type": { "Type": "String" }, "property": { "Type": "String" } }, "Resources": { "RestApi": { "Type": "AWS::ApiGateway::RestApi", "Properties": { "Name": { "Ref": "apiName" } } }, "DocumentationPart": { "Type": "AWS::ApiGateway::DocumentationPart", "Properties": { "Location": { "Type": { "Ref": "type" } }, "RestApiId": { "Ref": "RestApi" }, "Property": { "Ref": "property" } } }, "DocumentationVersion": { "Type": "AWS::ApiGateway::DocumentationVersion", "Properties": { "Description": { "Ref": "description" }, "DocumentationVersion": { "Ref": "version" }, "RestApiId": { "Ref": "RestApi" } }, "DependsOn": "DocumentationPart" } } }

YAML

Parameters: apiName: Type: String description: Type: String version: Type: String type: Type: String property: Type: String Resources: RestApi: Type: AWS::ApiGateway::RestApi Properties: Name: !Ref apiName DocumentationPart: Type: AWS::ApiGateway::DocumentationPart Properties: Location: Type: !Ref type RestApiId: !Ref RestApi Property: !Ref property DocumentationVersion: Type: AWS::ApiGateway::DocumentationVersion Properties: Description: !Ref description DocumentationVersion: !Ref version RestApiId: !Ref RestApi DependsOn: DocumentationPart

另请参阅