本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
定義網路服務描述項 (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 節點包括: