push addional code
[sdc.git] / openecomp-be / lib / openecomp-sdc-translator-lib / openecomp-sdc-translator-core / src / test / resources / mock / heat / resources / OS_Contrail_Network_Rule / expectedoutputfiles / MainServiceTemplate.yaml
1 tosca_definitions_version: tosca_simple_yaml_1_0_0
2 metadata:
3   template_name: Main
4 imports:
5   ContrailComputeGlobalTypes:
6     file: ContrailComputeGlobalTypesServiceTemplate.yaml
7   CinderVolumeGlobalTypes:
8     file: CinderVolumeGlobalTypesServiceTemplate.yaml
9   ContrailVirtualNetworkGlobalType:
10     file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml
11   AbstractSubstituteGlobalTypes:
12     file: AbstractSubstituteGlobalTypesServiceTemplate.yaml
13   ContrailPortGlobalTypes:
14     file: ContrailPortGlobalTypesServiceTemplate.yaml
15   NeutronPortGlobalTypes:
16     file: NeutronPortGlobalTypesServiceTemplate.yaml
17   NeutronNetGlobalTypes:
18     file: NeutronNetGlobalTypesServiceTemplate.yaml
19   CommonGlobalTypes:
20     file: CommonGlobalTypesServiceTemplate.yaml
21   ContrailAbstractSubstituteGlobalTypes:
22     file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml
23   ContrailNetworkRuleGlobalType:
24     file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml
25   NeutronSecurityRulesGlobalTypes:
26     file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml
27   NovaServerGlobalTypes:
28     file: NovaServerGlobalTypesServiceTemplate.yaml
29   ContrailV2VirtualMachineInterfaceGlobalType:
30     file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml
31 topology_template:
32   inputs:
33     start_src_ports:
34       hidden: false
35       immutable: false
36       type: float
37       description: Start of src port
38     private_net_1_gateway:
39       hidden: false
40       immutable: false
41       type: string
42       description: Private network gateway address
43     private_net_2_name:
44       hidden: false
45       immutable: false
46       type: string
47       description: Name of private network to be created
48     private_net_2_gateway:
49       hidden: false
50       immutable: false
51       type: string
52       description: Private network gateway address
53     policy_name:
54       hidden: false
55       immutable: false
56       type: string
57       description: Virtual network id
58     private_net_1_name:
59       hidden: false
60       immutable: false
61       type: string
62       description: Name of private network to be created
63     private_net_2_pool_start:
64       hidden: false
65       immutable: false
66       type: string
67       description: Start of private network IP address allocation pool
68     private_net_2_cidr:
69       hidden: false
70       immutable: false
71       type: string
72       description: Private network address (CIDR notation)
73     private_net_1_pool_end:
74       hidden: false
75       immutable: false
76       type: string
77       description: End of private network IP address allocation pool
78     end_src_ports:
79       hidden: false
80       immutable: false
81       type: float
82       description: End of src port
83     apply_service:
84       hidden: false
85       immutable: false
86       type: string
87       description: service to apply
88     start_dst_ports:
89       hidden: false
90       immutable: false
91       type: float
92       description: Start of dst port
93     end_dst_ports:
94       hidden: false
95       immutable: false
96       type: float
97       description: End of dst port
98     private_net_1_cidr:
99       hidden: false
100       immutable: false
101       type: string
102       description: Private network address (CIDR notation)
103     private_net_1_pool_start:
104       hidden: false
105       immutable: false
106       type: string
107       description: Start of private network IP address allocation pool
108     private_net_2_pool_end:
109       hidden: false
110       immutable: false
111       type: string
112       description: End of private network IP address allocation pool
113     direction:
114       hidden: false
115       immutable: false
116       type: string
117       description: Direction of Policy
118   node_templates:
119     private_net_1:
120       type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
121       properties:
122         network_name:
123           get_input: private_net_1_name
124         subnets:
125           private_subnet_1:
126             cidr:
127               get_input: private_net_1_cidr
128             gateway_ip:
129               get_input: private_net_1_gateway
130             allocation_pools:
131             - start:
132                 get_input: private_net_1_pool_start
133               end:
134                 get_input: private_net_1_pool_end
135     private_policy:
136       type: org.openecomp.resource.vfc.rules.nodes.heat.network.contrail.NetworkRules
137       properties:
138         entries:
139           policy_rule:
140           - src_ports:
141             - start_port:
142                 get_input: start_src_ports
143               end_port:
144                 get_input: end_src_ports
145             protocol: any
146             action_list:
147               apply_service:
148               - get_input: apply_service
149             dst_addresses:
150             - virtual_network: private_net_1
151             dst_ports:
152             - start_port:
153                 get_input: start_dst_ports
154               end_port:
155                 get_input: end_dst_ports
156             src_addresses:
157             - virtual_network: private_net_2
158             direction:
159               get_input: direction
160         name:
161           get_input: policy_name
162       requirements:
163       - network:
164           capability: tosca.capabilities.Attachment
165           node: private_net_1
166           relationship: org.openecomp.relationships.AttachesTo
167       - network:
168           capability: tosca.capabilities.Attachment
169           node: private_net_2
170           relationship: org.openecomp.relationships.AttachesTo
171     private_net_2:
172       type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
173       properties:
174         network_name:
175           get_input: private_net_2_name
176         subnets:
177           private_subnet_2:
178             cidr:
179               get_input: private_net_2_cidr
180             gateway_ip:
181               get_input: private_net_2_gateway
182             allocation_pools:
183             - start:
184                 get_input: private_net_2_pool_start
185               end:
186                 get_input: private_net_2_pool_end
187   groups:
188     network_policy_chain:
189       type: org.openecomp.groups.heat.HeatStack
190       properties:
191         heat_file: ../Artifacts/network_policy_chain.yaml
192         description: |
193           HOT template to creates two virtual network with one subnet each.  Creates a network policy for applying service between two VNs created before. Attach the network policy to two virtual networks
194       members:
195       - private_net_1
196       - private_policy
197       - private_net_2