本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
定义网络服务描述文件(NSD)模板。
语法
tosca_definitions_version: tnb_simple_yaml_1_0
vnfds:
- descriptor_id: String
namespace: String
topology_template:
inputs:
SampleInputParameter:
type: String
description: "Sample parameter description"
default: "DefaultSampleValue"
node_templates:
SampleNode1: tosca.nodes.AWS.NS
使用已定义的参数
当您想要动态传递参数(例如 VPC 节点的 CIDR 块)时,可以使用 { get_input:
语法在 NSD 模板中定义参数。然后即可在同一 NSD 模板中重复使用该参数。input-parameter-name
}
以下示例演示了如何定义和使用参数:
tosca_definitions_version: tnb_simple_yaml_1_0 topology_template: inputs: cidr_block: type: String description: "CIDR Block for VPC" default: "10.0.0.0/24" node_templates: ExampleSingleClusterNS: type: tosca.nodes.AWS.NS properties: descriptor_id: "
a1b2c3d4-5678-90ab-cdef-EXAMPLE11111
" ..... ExampleVPC: type: tosca.nodes.AWS.Networking.VPC properties: cidr_block: { get_input: cidr_block }
VNFD 导入
-
descriptor_id
-
描述文件的 UUID。
必需:是
类型:字符串
模式:
[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}
-
namespace
-
唯一名称。
必需:是
类型:字符串
拓扑模板
-
node_templates
-
可能的 TOSCA AWS 节点有: