Add vnfd validity check
[vfc/gvnfm/vnflcm.git] / lcm / lcm / pub / verifyvnfd / const.py
1 # Copyright (C) 2019 ZTE. All Rights Reserved.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #       http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15
16 vnfd_model1 = {
17     'metadata': {
18         'vendor': 'zte',
19         'is_shared': False,
20         'description': '',
21         'domain_type': 'CN',
22         'version': 'v4.14.10',
23         'vmnumber_overquota_alarm': False,
24         'cross_dc': False,
25         'vnf_type': 'SSS',
26         'vnfd_version': 'V00000001',
27         'id': 'sss-vnf-template',
28         'name': 'sss-vnf-template'
29     },
30     'vdus': [
31         {
32             "vdu_id": "vdu1Id",
33             "description": "vdu description",
34             "properties": {
35                 "name": "vduinstname",
36                 "vdu_type": "OMP",
37                 "key_vdu": True,
38                 "support_scaling": True,
39                 "location_info": {
40                     "vimid": "vimid",
41                     "tenant": "tenantname",
42                     "availability_zone": "zone1",
43                     "host": "host1"
44                 },
45                 "local_affinity_antiaffinity_rule": [
46                     {
47                         "affinity_antiaffinity": "anti-affinity",
48                         "scope": "node"
49                     },
50                     {
51                         "affinity_antiaffinity": "affinity",
52                         "scope": "zone"
53                     }
54                 ],
55                 "inject_data_list": [
56                     {
57                         "file_name": "abc.xml",
58                         "file_data": "<a>xxx</a><b>ssss</b>"
59                     }
60                 ],
61                 "storage_policy": "HIGH",
62                 "template_id": "26",
63                 "manual_scale_select_vim": False,
64                 "watchdog": {
65                     "enabledelay": 600000,
66                     "action": "reset"
67                 },
68                 "is_predefined": False,
69                 "allow_scale_updown": False,
70                 "inject_network_address": True,
71                 "inner_hugepage_num": 100,
72                 "inner_hugepage_size": "2048",
73                 "action": "add"
74             },
75             "image_file": 'sss',
76             "local_storages": [
77                 "local_storage_id1",
78                 "local_storage_id2"
79             ],
80             "virtual_storages": [
81                 {
82                     "virtual_storage_id": "volume_storage1",
83                     "location": "/usr/data",
84                     "device": "/dev/hda1"
85                 }
86             ],
87             "dependencies": [
88                 "vdu1Id",
89                 "vduNId"
90             ],
91             "nfv_compute": {
92                 "num_cpus": 4,
93                 "mem_size": "1 GB",
94                 "cpu_frequency": "1GHz",
95                 "flavor_extra_specs": {
96                     "hw: cpu_policy": "shared",
97                     "hw: cpu_max_threads": 50,
98                     "hw: cpu_sockets": 10,
99                     "hw: cpu_max_sockets": 20,
100                     "hw: cpu_max_cores": 8,
101                     "hw: cpu_threads": 30,
102                     "hw: numa_mem.0": 12288,
103                     "hw: hugepage_num": 100,
104                     "hw: high_performance": "dvs_high",
105                     "hw: numa_nodes": 1,
106                     "hw: numa_cpus.0": "2,4,8",
107                     "hw: numa_pci": True,
108                     "hw: cpu_cores": 4,
109                     "pci_passthrough: alias": "ColetoCreek: 1",
110                     "hw: mem_page_size": "large",
111                     "hw: mem_paging_mechanism": "EPT"
112                 }
113             },
114             "vls": [
115                 "vlId1",
116             ],
117             "cps": [
118                 "cpId1",
119             ],
120             "scalable": {
121                 "min_instances": 1,
122                 "max_instances": 2,
123                 "default_instances": 1
124             },
125             "interfaces": {
126                 "Standard": {
127                     "create": {
128                         "implementation": "<implementationScript>",
129                         "inputs": {
130                             "param1Name": "value1",
131                             "paramNName": "valueN"
132                         }
133                     },
134                     "configure": {
135                         "implementation": "<implementationScript>",
136                         "inputs": {
137                             "param1Name": "value1",
138                             "paramNName": "valueN"
139                         }
140                     },
141                     "start": {
142                         "implementation": "<implementationScript>",
143                         "inputs": {
144                             "param1Name": "value1",
145                             "paramNName": "valueN"
146                         }
147                     },
148                     "stop": {
149                         "implementation": "<implementationScript>",
150                         "inputs": {
151                             "param1Name": "value1",
152                             "paramNName": "valueN"
153                         }
154                     },
155                     "delete": {
156                         "implementation": "<implementationScript>",
157                         "inputs": {
158                             "param1Name": "value1",
159                             "paramNName": "valueN"
160                         }
161                     }
162                 }
163             },
164             "artifacts": [
165             ]
166         }
167     ],
168     'volume_storages': [
169         {
170             "volume_storage_id": "volume_storage1",
171             "description": "",
172             "properties": {
173                 "size": "\"100 GB\"",
174                 "volume_id": "",
175                 "volume_name": "volumeStorage1",
176                 "custom_volume_type": "type1",
177                 "disk_type": "data",
178                 "delete_on_termination_vm": True,
179                 "location_info": {
180                     "vimid": "vimid_1",
181                     "tenant": "tenantname_1",
182                     "availability_zone": "zone1"
183                 },
184                 "is_predefined": False,
185                 "is_shared": False
186             },
187             "image_file": [
188                 "volume_image"
189             ]
190         }
191     ],
192     'policies': {
193         'scaling': {
194             'targets': {
195
196             },
197             'policy_id': 'policy_scale_sss-vnf-template',
198             'properties': {
199                 'policy_file': '*-vnfd.zip/*-vnf-policy.xml'
200             },
201             'description': ''
202         }
203     },
204     'image_files': [
205         {
206             'description': '',
207             'properties': {
208                 'name': 'opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
209                 'checksum': '',
210                 'disk_format': 'VMDK',
211                 'file_url': './zte-cn-sss-main-image/OMM/opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
212                 'container_type': 'vm',
213                 'version': '',
214                 'hypervisor_type': 'kvm'
215             },
216             'image_file_id': 'opencos_sss_omm_img_release_20150723-1-disk1'
217         },
218         {
219             'description': '',
220             'properties': {
221                 'name': 'sss.vmdk',
222                 'checksum': '',
223                 'disk_format': 'VMDK',
224                 'file_url': './zte-cn-sss-main-image/NE/sss.vmdk',
225                 'container_type': 'vm',
226                 'version': '',
227                 'hypervisor_type': 'kvm'
228             },
229             'image_file_id': 'sss'
230         }
231     ],
232     'vls': [
233         {
234             "vl_id": "vldId1",
235             "description": "",
236             "properties": {
237                 "name": "umac_241_control",
238                 "network_name": "umac_control",
239                 "is_predefined": False,
240                 "vendor": "zte",
241                 "netmask": "255.255.255.0",
242                 "mtu": 1500,
243                 "network_type": "vlan",
244                 "physical_network": "phynet01",
245                 "segmentation_id": "30",
246                 "vlan_transparent": False,
247                 "vds_name": "vds1",
248                 "cidr": "192.168.199.0/24",
249                 "ip_version": 4,
250                 "gateway_ip": "192.168.199.1",
251                 "dhcp_enabled": False,
252                 "dns_nameservers": [
253                     "192.168.0.4",
254                     "192.168.0.10"
255                 ],
256                 "start_ip": "192.168.199.2",
257                 "end_ip": "192.168.199.254",
258                 "host_routes": [
259                     {
260                         "destination": "10.43.26.0/24",
261                         "nexthop": "10.41.23.1"
262                     }
263                 ],
264                 "location_info": {
265                     "vimid": "vimid_1",
266                     "tenant": "tenantname_1"
267                 },
268                 "cloud_type": "IaaS",
269                 "vl_profile": {"networkName": "test"},
270                 "connectivity_type": {}
271             },
272             "route_id": "router01",
273             "route_external": False
274         }
275     ],
276     'cps': [
277         {
278             "cp_id": "cpId1",
279             "description": "",
280             "properties": {
281                 "name": "",
282                 "mac_address": "00:d9:00:82:11:e1",
283                 "ip_address:": "192.168.1.21",
284                 "ip_range_start": "192.168.1.20",
285                 "ip_range_end": "192.168.1.29",
286                 "floating_ip_address": {
287                     "external_network": "extnet01",
288                     "ip_address": "10.43.53.23"
289                 },
290                 "service_ip_address": "192.168.1.23",
291                 "order": 1,
292                 "bandwidth": 1000,
293                 "vnic_type": "normal",
294                 "allowed_address_pairs": [
295                     {
296                         "ip": "192.168.1.13",
297                         "mac": "00:f3:43:20:a2:a3"
298                     }
299                 ],
300                 "bond": "none",
301                 "bond_index": 1,
302                 "macbond": "00:d9:00:82:11:d1",
303                 "sfc_encapsulation": "",
304                 "direction": "",
305                 "gateway_ip": "192.168.199.1",
306                 "netmask": "255.255.255.0",
307                 "interface_name": "fe-01-02",
308                 "is_virtual": False,
309                 "function": "control",
310                 "protocol_data": [
311                     {
312                         "address_data": {
313                             "l3_address_data": {
314                                 "fixed_ip_address": "test"
315                             },
316                         },
317                     },
318                 ]
319
320             },
321             "vl_id": "vldId1",
322             "vdu_id": "vdu1Id"
323         }
324     ],
325     'local_storages': [
326
327     ],
328 }