code refactor for genericparser
[modeling/etsicatalog.git] / genericparser / packages / tests / const.py
1 # Copyright 2018 ZTE Corporation.
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 vnfd_data = {
16     "volume_storages": [
17         {
18             "properties": {
19                 "size_of_storage": {
20                     "factor": 10,
21                     "value": 10000000000,
22                     "unit": "GB",
23                     "unit_size": 1000000000
24                 },
25                 "type_of_storage": "volume",
26                 "rdma_enabled": False,
27                 "size": "10 GB"
28             },
29             "volume_storage_id": "vNAT_Storage_6wdgwzedlb6sq18uzrr41sof7",
30             "description": ""
31         }
32     ],
33     "inputs": {},
34     "vdus": [
35         {
36             "volume_storages": [
37                 "vNAT_Storage_6wdgwzedlb6sq18uzrr41sof7"
38             ],
39             "description": "",
40             "dependencies": [],
41             "vls": [],
42             "properties": {
43                 "name": "vNat",
44                 "configurable_properties": {
45                     "test": {
46                         "additional_vnfc_configurable_properties": {
47                             "aaa": "1",
48                             "bbb": "2",
49                             "ccc": "3"
50                         }
51                     }
52                 },
53                 "description": "the virtual machine of vNat",
54                 "nfvi_constraints": [
55                     "test"
56                 ],
57                 "boot_order": [
58                     "vNAT_Storage"
59                 ]
60             },
61             "vdu_id": "vdu_vNat",
62             "artifacts": [
63                 {
64                     "artifact_name": "vNatVNFImage",
65                     "type": "tosca.artifacts.nfv.SwImage",
66                     "properties": {
67                         "operating_system": "linux",
68                         "sw_image": "/swimages/vRouterVNF_ControlPlane.qcow2",
69                         "name": "vNatVNFImage",
70                         "container_format": "bare",
71                         "min_ram": "1 GB",
72                         "disk_format": "qcow2",
73                         "supported_virtualisation_environments": [
74                             "test_0"
75                         ],
76                         "version": "1.0",
77                         "checksum": "5000",
78                         "min_disk": "10 GB",
79                         "size": "10 GB"
80                     },
81                     "file": "/swimages/vRouterVNF_ControlPlane.qcow2"
82                 }
83             ],
84             "nfv_compute": {
85                 "flavor_extra_specs": {
86                     "hw:cpu_sockets": "2",
87                     "sw:ovs_dpdk": "true",
88                     "hw:cpu_threads": "2",
89                     "hw:numa_mem.1": "3072",
90                     "hw:numa_mem.0": "1024",
91                     "hw:numa_nodes": "2",
92                     "hw:numa_cpus.0": "0,1",
93                     "hw:numa_cpus.1": "2,3,4,5",
94                     "hw:cpu_cores": "2",
95                     "hw:cpu_threads_policy": "isolate"
96                 },
97                 "cpu_frequency": "2.4 GHz",
98                 "num_cpus": 2,
99                 "mem_size": "10 GB"
100             },
101             "local_storages": [],
102             "image_file": "vNatVNFImage",
103             "cps": []
104         }
105     ],
106     "image_files": [
107         {
108             "properties": {
109                 "operating_system": "linux",
110                 "sw_image": "/swimages/vRouterVNF_ControlPlane.qcow2",
111                 "name": "vNatVNFImage",
112                 "container_format": "bare",
113                 "min_ram": "1 GB",
114                 "disk_format": "qcow2",
115                 "supported_virtualisation_environments": [
116                     "test_0"
117                 ],
118                 "version": "1.0",
119                 "checksum": "5000",
120                 "min_disk": "10 GB",
121                 "size": "10 GB"
122             },
123             "image_file_id": "vNatVNFImage",
124             "description": ""
125         }
126     ],
127     "routers": [],
128     "local_storages": [],
129     "vnf_exposed": {
130         "external_cps": [
131             {
132                 "key_name": "sriov_plane",
133                 "cp_id": "SRIOV_Port"
134             }
135         ],
136         "forward_cps": []
137     },
138     "vls": [
139         {
140             "route_id": "",
141             "vl_id": "sriov_link",
142             "route_external": False,
143             "description": "",
144             "properties": {
145                 "vl_flavours": {
146                     "vl_id": "aaaa"
147                 },
148                 "connectivity_type": {
149                     "layer_protocol": "ipv4",
150                     "flow_pattern": "flat"
151                 },
152                 "description": "sriov_link",
153                 "test_access": [
154                     "test"
155                 ]
156             }
157         }
158     ],
159     "cps": [
160         {
161             "vl_id": "sriov_link",
162             "vdu_id": "vdu_vNat",
163             "description": "",
164             "cp_id": "SRIOV_Port",
165             "properties": {
166                 "address_data": [
167                     {
168                         "address_type": "ip_address",
169                         "l3_address_data": {
170                             "ip_address_type": "ipv4",
171                             "floating_ip_activated": False,
172                             "number_of_ip_address": 1,
173                             "ip_address_assignment": True
174                         }
175                     }
176                 ],
177                 "description": "sriov port",
178                 "layer_protocol": "ipv4",
179                 "virtual_network_interface_requirements": [
180                     {
181                         "requirement": {
182                             "SRIOV": "true"
183                         },
184                         "support_mandatory": False,
185                         "name": "sriov",
186                         "description": "sriov"
187                     },
188                     {
189                         "requirement": {
190                             "SRIOV": "False"
191                         },
192                         "support_mandatory": False,
193                         "name": "normal",
194                         "description": "normal"
195                     }
196                 ],
197                 "role": "root",
198                 "bitrate_requirement": 10
199             }
200         }
201     ],
202     "metadata": {
203         "vnfSoftwareVersion": "1.0.0",
204         "vnfProductName": "zte",
205         "localizationLanguage": [
206             "english",
207             "chinese"
208         ],
209         "vnfProvider": "zte",
210         "vnfmInfo": "zte",
211         "defaultLocalizationLanguage": "english",
212         "vnfdId": "zte-hss-1.0",
213         "id": "zte-hss-1.0",
214         "vnfProductInfoDescription": "hss",
215         "vnfdVersion": "1.0.0",
216         "vnfProductInfoName": "hss"
217     },
218     "vnf": {
219         "properties": {
220             "descriptor_id": "zte-hss-1.0",
221             "descriptor_verison": "1.0.0",
222             "software_version": "1.0.0",
223             "provider": "zte"
224         },
225         "metadata": {
226         }
227     }
228 }
229
230 nsd_data = {"vnffgs": [{"vnffg_id": "vnffg1",
231                         "description": "",
232                         "members": ["path1",
233                                     "path2"],
234                         "properties": {"vendor": "zte",
235                                        "connection_point": ["m6000_data_in",
236                                                             "m600_tunnel_cp",
237                                                             "m6000_data_out"],
238                                        "version": "1.0",
239                                        "constituent_vnfs": ["VFW",
240                                                             "VNAT"],
241                                        "number_of_endpoints": 3,
242                                        "dependent_virtual_link": ["sfc_data_network",
243                                                                   "ext_datanet_net",
244                                                                   "ext_mnet_net"]}}],
245             "inputs": {"sfc_data_network": {"type": "string",
246                                             "value": "sfc_data_network"},
247                        "externalDataNetworkName": {"type": "string",
248                                                    "value": "vlan_4004_tunnel_net"},
249                        "externalManageNetworkName": {"type": "string",
250                                                      "value": "vlan_4008_mng_net"},
251                        "NatIpRange": {"type": "string",
252                                       "value": "192.167.0.10-192.168.0.20"},
253                        "externalPluginManageNetworkName": {"type": "string",
254                                                            "value": "vlan_4007_plugin_net"}},
255             "pnfs": [{"pnf_id": "m6000_s",
256                       "cps": [],
257                       "description": "",
258                       "properties": {"vendor": "zte",
259                                      "request_reclassification": False,
260                                      "pnf_type": "m6000s",
261                                      "version": "1.0",
262                                      "management_address": "111111",
263                                      "id": "m6000_s",
264                                      "nsh_aware": False}}],
265             "fps": [{"properties": {"symmetric": False,
266                                     "policy": {"type": "ACL",
267                                                "criteria": {"dest_port_range": "1-100",
268                                                             "ip_protocol": "tcp",
269                                                             "source_ip_range": ["119.1.1.1-119.1.1.10"],
270                                                             "dest_ip_range": [{"get_input": "NatIpRange"}],
271                                                             "dscp": 0,
272                                                             "source_port_range": "1-100"}}},
273                      "forwarder_list": [{"capability": "",
274                                          "type": "cp",
275                                          "node_name": "m6000_data_out"},
276                                         {"capability": "",
277                                          "type": "cp",
278                                          "node_name": "m600_tunnel_cp"},
279                                         {"capability": "vnat_fw_inout",
280                                          "type": "vnf",
281                                          "node_name": "VNAT"}],
282                      "description": "",
283                      "fp_id": "path2"},
284                     {"properties": {"symmetric": True,
285                                     "policy": {"type": "ACL",
286                                                "criteria": {"dest_port_range": "1-100",
287                                                             "ip_protocol": "tcp",
288                                                             "source_ip_range": ["1-100"],
289                                                             "dest_ip_range": ["1-100"],
290                                                             "dscp": 4,
291                                                             "source_port_range": "1-100"}}},
292                      "forwarder_list": [{"capability": "",
293                                          "type": "cp",
294                                          "node_name": "m6000_data_in"},
295                                         {"capability": "",
296                                          "type": "cp",
297                                          "node_name": "m600_tunnel_cp"},
298                                         {"capability": "vfw_fw_inout",
299                                          "type": "vnf",
300                                          "node_name": "VFW"},
301                                         {"capability": "vnat_fw_inout",
302                                          "type": "vnf",
303                                          "node_name": "VNAT"},
304                                         {"capability": "",
305                                          "type": "cp",
306                                          "node_name": "m600_tunnel_cp"},
307                                         {"capability": "",
308                                          "type": "cp",
309                                          "node_name": "m6000_data_out"}],
310                      "description": "",
311                      "fp_id": "path1"}],
312             "routers": [],
313             "vnfs": [{"vnf_id": "VFW",
314                       "description": "",
315                       "properties": {"plugin_info": "vbrasplugin_1.0",
316                                      "vendor": "zte",
317                                      "is_shared": False,
318                                      "adjust_vnf_capacity": True,
319                                      "name": "VFW",
320                                      "vnf_extend_type": "driver",
321                                      "csarVersion": "v1.0",
322                                      "csarType": "NFAR",
323                                      "csarProvider": "ZTE",
324                                      "version": "1.0",
325                                      "nsh_aware": True,
326                                      "cross_dc": False,
327                                      "vnf_type": "VFW",
328                                      "vmnumber_overquota_alarm": True,
329                                      "vnfd_version": "1.0.0",
330                                      "externalPluginManageNetworkName": "vlan_4007_plugin_net",
331                                      "id": "vcpe_vfw_zte_1_0",
332                                      "request_reclassification": False},
333                       "dependencies": [{"key_name": "vfw_ctrl_by_manager_cp",
334                                         "vl_id": "ext_mnet_net"},
335                                        {"key_name": "vfw_data_cp",
336                                         "vl_id": "sfc_data_network"}],
337                       "type": "tosca.nodes.nfv.ext.zte.VNF.VFW",
338                       "networks": []}],
339             "ns_exposed": {"external_cps": [],
340                            "forward_cps": []},
341             "policies": [{"file_url": "policies/abc.drl",
342                           "name": "aaa"}],
343             "vls": [{"route_id": "",
344                      "vl_id": "ext_mnet_net",
345                      "route_external": False,
346                      "description": "",
347                      "properties": {"name": "vlan_4008_mng_net",
348                                     "mtu": 1500,
349                                     "location_info": {"tenant": "admin",
350                                                       "vimid": 2,
351                                                       "availability_zone": "nova"},
352                                     "ip_version": 4,
353                                     "dhcp_enabled": True,
354                                     "network_name": "vlan_4008_mng_net",
355                                     "network_type": "vlan"}},
356                     {"route_id": "",
357                      "vl_id": "ext_datanet_net",
358                      "route_external": False,
359                      "description": "",
360                      "properties": {"name": "vlan_4004_tunnel_net",
361                                     "mtu": 1500,
362                                     "location_info": {"tenant": "admin",
363                                                       "vimid": 2,
364                                                       "availability_zone": "nova"},
365                                     "ip_version": 4,
366                                     "dhcp_enabled": True,
367                                     "network_name": "vlan_4004_tunnel_net",
368                                     "network_type": "vlan"}},
369                     {"route_id": "",
370                      "vl_id": "sfc_data_network",
371                      "route_external": False,
372                      "description": "",
373                      "properties": {"name": "sfc_data_network",
374                                     "dhcp_enabled": True,
375                                     "is_predefined": False,
376                                     "location_info": {"tenant": "admin",
377                                                       "vimid": 2,
378                                                       "availability_zone": "nova"},
379                                     "ip_version": 4,
380                                     "mtu": 1500,
381                                     "network_name": "sfc_data_network",
382                                     "network_type": "vlan"}}],
383             "cps": [{"pnf_id": "m6000_s",
384                      "vl_id": "path2",
385                      "description": "",
386                      "cp_id": "m6000_data_out",
387                      "properties": {"direction": "bidirectional",
388                                     "vnic_type": "normal",
389                                     "bandwidth": 0,
390                                     "mac_address": "11-22-33-22-11-44",
391                                     "interface_name": "xgei-0/4/1/5",
392                                     "ip_address": "176.1.1.2",
393                                     "order": 0,
394                                     "sfc_encapsulation": "mac"}},
395                     {"pnf_id": "m6000_s",
396                      "vl_id": "ext_datanet_net",
397                      "description": "",
398                      "cp_id": "m600_tunnel_cp",
399                      "properties": {"direction": "bidirectional",
400                                     "vnic_type": "normal",
401                                     "bandwidth": 0,
402                                     "mac_address": "00-11-00-22-33-00",
403                                     "interface_name": "gei-0/4/0/13",
404                                     "ip_address": "191.167.100.5",
405                                     "order": 0,
406                                     "sfc_encapsulation": "mac"}},
407                     {"pnf_id": "m6000_s",
408                      "vl_id": "path2",
409                      "description": "",
410                      "cp_id": "m6000_data_in",
411                      "properties": {"direction": "bidirectional",
412                                     "vnic_type": "normal",
413                                     "bandwidth": 0,
414                                     "mac_address": "11-22-33-22-11-41",
415                                     "interface_name": "gei-0/4/0/7",
416                                     "ip_address": "1.1.1.1",
417                                     "order": 0,
418                                     "sfc_encapsulation": "mac",
419                                     "bond": "none"}},
420                     {"pnf_id": "m6000_s",
421                      "vl_id": "ext_mnet_net",
422                      "description": "",
423                      "cp_id": "m600_mnt_cp",
424                      "properties": {"direction": "bidirectional",
425                                     "vnic_type": "normal",
426                                     "bandwidth": 0,
427                                     "mac_address": "00-11-00-22-33-11",
428                                     "interface_name": "gei-0/4/0/1",
429                                     "ip_address": "10.46.244.51",
430                                     "order": 0,
431                                     "sfc_encapsulation": "mac",
432                                     "bond": "none"}}],
433             "metadata": {"invariant_id": "vcpe_ns_sff_1",
434                          "name": "VCPE_NS",
435                          "csarVersion": "v1.0",
436                          "csarType": "NSAR",
437                          "csarProvider": "ZTE",
438                          "version": 1,
439                          "vendor": "ZTE",
440                          "id": "VCPE_NS",
441                          "description": "vcpe_ns"},
442             "ns": {
443                 "properties": {
444                     "descriptor_id": "VCPE_NS",
445                     "version": 1,
446                     "name": "VCPE_NS",
447                     "desginer": "ZTE",
448                     "invariant_id": "vcpe_ns_sff_1"
449                 }
450 }
451 }
452
453 pnfd_data = {
454     "metadata": {
455         "id": "zte-1.0",
456     }
457 }
458
459 sd_data = {
460     "inputs": {
461         "sdwanvpnresource_list": [
462             {
463                 "sdwanvpn_topology": "",
464                 "required": True,
465                 "type": "string"
466             }
467         ]
468     },
469     "pnfs": [
470         {
471             "pnf_id": "m6000_s",
472             "cps": [],
473             "description": "",
474             "properties": {
475                 "vendor": "zte",
476                 "request_reclassification": False,
477                 "pnf_type": "m6000s",
478                 "version": "1.0",
479                 "management_address": "111111",
480                 "id": "m6000_s",
481                 "nsh_aware": False
482             }
483         }
484     ],
485     "description": "",
486     "vnfs": [
487         {
488             "vnf_id": "sdwansiteresource",
489             "description": "",
490             "properties": {
491                 "sdwandevice_type": "",
492                 "sdwandevice_class": "PNF",
493                 "multi_stage_design": "false",
494                 "min_instances": "1",
495                 "sdwansite_controlPoint": "",
496                 "id": "cd557883-ac4b-462d-aa01-421b5fa606b1",
497                 "sdwansite_longitude": "",
498                 "sdwansite_latitude": "",
499                 "sdwansite_postcode": "",
500                 "sdwansite_type": "",
501                 "nf_naming": {
502                     "ecomp_generated_naming": True
503                 },
504                 "sdwansite_emails": "",
505                 "sdwansite_role": "",
506                 "vnfm_info": "",
507                 "sdwansite_address": "",
508                 "sdwansite_description": "",
509                 "availability_zone_max_count": "1",
510                 "sdwansite_name": ""
511             }
512         }
513     ],
514     "service": {
515         "type": "org.openecomp.service.EnhanceService",
516         "properties": {
517             "descriptor_id": "49ee73f4-1e31-4054-b871-eb9b1c29999b",
518             "designer": "",
519             "invariant_id": "5de07996-7ff0-4ec1-b93c-e3a00bb3f207",
520             "name": "Enhance_Service",
521             "verison": ""
522         },
523         "metadata": {
524             "category": "E2E Service",
525             "serviceType": "",
526             "description": "Enhance_Service",
527             "instantiationType": "A-la-carte",
528             "type": "Service",
529             "environmentContext": "General_Revenue-Bearing",
530             "serviceEcompNaming": True,
531             "UUID": "49ee73f4-1e31-4054-b871-eb9b1c29999b",
532             "ecompGeneratedNaming": True,
533             "serviceRole": "",
534             "invariantUUID": "5de07996-7ff0-4ec1-b93c-e3a00bb3f207",
535             "namingPolicy": "",
536             "name": "Enhance_Service"
537         }
538     },
539     "metadata": {
540         "category": "E2E Service",
541         "serviceType": "",
542         "description": "Enhance_Service",
543         "instantiationType": "A-la-carte",
544         "type": "Service",
545         "environmentContext": "General_Revenue-Bearing",
546         "serviceEcompNaming": True,
547         "UUID": "49ee73f4-1e31-4054-b871-eb9b1c29999b",
548         "ecompGeneratedNaming": True,
549         "serviceRole": "",
550         "invariantUUID": "5de07996-7ff0-4ec1-b93c-e3a00bb3f207",
551         "namingPolicy": "",
552         "name": "Enhance_Service"
553     }
554 }
555
556 vnf_subscription_data = {
557     "filters": {
558         "notificationTypes": [
559             "VnfPackageOnboardingNotification"
560         ],
561         "vnfProductsFromProviders": {
562             "vnfProvider": "string",
563             "vnfProducts": {
564                 "vnfProductName": "string",
565                 "versions": {
566                     "vnfSoftwareVersion": "string",
567                     "vnfdVersions": [
568                         "string"
569                     ]
570                 }
571             }
572         },
573         "vnfdId": [
574             "3fa85f64-5717-4562-b3fc-2c963f66afa6"
575         ],
576         "vnfPkgId": [
577             "3fa85f64-5717-4562-b3fc-2c963f66afa6"
578         ],
579         "operationalState": [
580             "ENABLED"
581         ],
582         "usageState": [
583             "IN_USE"
584         ]
585     },
586     "callbackUri": "http://www.vnf1.com/notification",
587     "authentication": {
588         "authType": [
589             "BASIC"
590         ],
591         "paramsBasic": {
592             "userName": "string",
593             "password": "string"
594         }
595     }
596 }