summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorying.yunlong <ying.yunlong@zte.com.cn>2017-02-21 09:50:40 +0800
committerying.yunlong <ying.yunlong@zte.com.cn>2017-02-21 09:50:40 +0800
commitf979f5a1b5021fd0f264239933f5c5cd916b69ec (patch)
tree4b6cc757b5098f196c08b7a5cf5241ff97ebf463
parent2b7749ec69c06af3431bf9666c7c175a38762866 (diff)
Modify const file of gvnfm
Change-Id: I26a60a733c3040226b32d6675ac6857f73118195 Issue-Id: GVNFM-12 Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
-rw-r--r--lcm/lcm/nf/vnfs/const.py440
-rw-r--r--lcm/lcm/nf/vnfs/tests/test_vnf_create.py3
2 files changed, 196 insertions, 247 deletions
diff --git a/lcm/lcm/nf/vnfs/const.py b/lcm/lcm/nf/vnfs/const.py
index f197294a..89c5d4ba 100644
--- a/lcm/lcm/nf/vnfs/const.py
+++ b/lcm/lcm/nf/vnfs/const.py
@@ -287,19 +287,42 @@ vnfd_rawdata = {
vnfd_model_dict = {
- 'local_storages': [],
+ 'metadata': {
+ 'vendor': u'zte',
+ 'is_shared': False,
+ 'description': '',
+ 'domain_type': u'CN',
+ 'version': u'v4.14.10',
+ 'vmnumber_overquota_alarm': False,
+ 'cross_dc': False,
+ 'vnf_type': u'SSS',
+ 'vnfd_version': u'V00000001',
+ 'id': u'sss-vnf-template',
+ 'name': u'sss-vnf-template'
+ },
'vdus': [
{
- 'volumn_storages': [],
+ 'volumn_storages': [
+
+ ],
'nfv_compute': {
'mem_size': '',
- 'num_cpus': u'2'},
- 'local_storages': [],
+ 'num_cpus': u'2'
+ },
+ 'local_storages': [
+
+ ],
'vdu_id': u'vdu_omm.001',
'image_file': u'opencos_sss_omm_img_release_20150723-1-disk1',
- 'dependencies': [],
- 'vls': [],
- 'cps': [],
+ 'dependencies': [
+
+ ],
+ 'vls': [
+
+ ],
+ 'cps': [
+
+ ],
'properties': {
'key_vdu': '',
'support_scaling': False,
@@ -312,186 +335,45 @@ vnfd_model_dict = {
'region': '',
'dc': '',
'host': '',
- 'tenant': ''},
- 'inject_data_list': [],
+ 'tenant': ''
+ },
+ 'inject_data_list': [
+
+ ],
'watchdog': {
'action': '',
- 'enabledelay': ''},
- 'local_affinity_antiaffinity_rule': {},
+ 'enabledelay': ''
+ },
+ 'local_affinity_antiaffinity_rule': {
+
+ },
'template_id': u'omm.001',
- 'manual_scale_select_vim': False},
- 'description': u'singleommvm'},
- {
- 'volumn_storages': [],
- 'nfv_compute': {
- 'mem_size': '',
- 'num_cpus': u'4'},
- 'local_storages': [],
- 'vdu_id': u'vdu_1',
- 'image_file': u'sss',
- 'dependencies': [],
- 'vls': [],
- 'cps': [],
- 'properties': {
- 'key_vdu': '',
- 'support_scaling': False,
- 'vdu_type': '',
- 'name': '',
- 'storage_policy': '',
- 'location_info': {
- 'vimId': '',
- 'availability_zone': '',
- 'region': '',
- 'dc': '',
- 'host': '',
- 'tenant': ''},
- 'inject_data_list': [],
- 'watchdog': {
- 'action': '',
- 'enabledelay': ''},
- 'local_affinity_antiaffinity_rule': {},
- 'template_id': u'1',
- 'manual_scale_select_vim': False},
- 'description': u'ompvm'},
- {
- 'volumn_storages': [],
- 'nfv_compute': {
- 'mem_size': '',
- 'num_cpus': u'14'},
- 'local_storages': [],
- 'vdu_id': u'vdu_2',
- 'image_file': u'sss',
- 'dependencies': [],
- 'vls': [],
- 'cps': [],
- 'properties': {
- 'key_vdu': '',
- 'support_scaling': False,
- 'vdu_type': '',
- 'name': '',
- 'storage_policy': '',
- 'location_info': {
- 'vimId': '',
- 'availability_zone': '',
- 'region': '',
- 'dc': '',
- 'host': '',
- 'tenant': ''},
- 'inject_data_list': [],
- 'watchdog': {
- 'action': '',
- 'enabledelay': ''},
- 'local_affinity_antiaffinity_rule': {},
- 'template_id': u'2',
- 'manual_scale_select_vim': False},
- 'description': u'ompvm'},
- {
- 'volumn_storages': [],
- 'nfv_compute': {
- 'mem_size': '',
- 'num_cpus': u'14'},
- 'local_storages': [],
- 'vdu_id': u'vdu_3',
- 'image_file': u'sss',
- 'dependencies': [],
- 'vls': [],
- 'cps': [],
- 'properties': {
- 'key_vdu': '',
- 'support_scaling': False,
- 'vdu_type': '',
- 'name': '',
- 'storage_policy': '',
- 'location_info': {
- 'vimId': '',
- 'availability_zone': '',
- 'region': '',
- 'dc': '',
- 'host': '',
- 'tenant': ''},
- 'inject_data_list': [],
- 'watchdog': {
- 'action': '',
- 'enabledelay': ''},
- 'local_affinity_antiaffinity_rule': {},
- 'template_id': u'3',
- 'manual_scale_select_vim': False},
- 'description': u'ompvm'},
- {
- 'volumn_storages': [],
- 'nfv_compute': {
- 'mem_size': '',
- 'num_cpus': u'4'},
- 'local_storages': [],
- 'vdu_id': u'vdu_10',
- 'image_file': u'sss',
- 'dependencies': [],
- 'vls': [],
- 'cps': [],
- 'properties': {
- 'key_vdu': '',
- 'support_scaling': False,
- 'vdu_type': '',
- 'name': '',
- 'storage_policy': '',
- 'location_info': {
- 'vimId': '',
- 'availability_zone': '',
- 'region': '',
- 'dc': '',
- 'host': '',
- 'tenant': ''},
- 'inject_data_list': [],
- 'watchdog': {
- 'action': '',
- 'enabledelay': ''},
- 'local_affinity_antiaffinity_rule': {},
- 'template_id': u'10',
- 'manual_scale_select_vim': False},
- 'description': u'ppvm'},
- {
- 'volumn_storages': [],
- 'nfv_compute': {
- 'mem_size': '',
- 'num_cpus': u'14'},
- 'local_storages': [],
- 'vdu_id': u'vdu_11',
- 'image_file': u'sss',
- 'dependencies': [],
- 'vls': [],
- 'cps': [],
- 'properties': {
- 'key_vdu': '',
- 'support_scaling': False,
- 'vdu_type': '',
- 'name': '',
- 'storage_policy': '',
- 'location_info': {
- 'vimId': '',
- 'availability_zone': '',
- 'region': '',
- 'dc': '',
- 'host': '',
- 'tenant': ''},
- 'inject_data_list': [],
- 'watchdog': {
- 'action': '',
- 'enabledelay': ''},
- 'local_affinity_antiaffinity_rule': {},
- 'template_id': u'11',
- 'manual_scale_select_vim': False},
- 'description': u'ppvm'},
+ 'manual_scale_select_vim': False
+ },
+ 'description': u'singleommvm'
+ },
{
- 'volumn_storages': [],
+ 'volumn_storages': [
+
+ ],
'nfv_compute': {
'mem_size': '',
- 'num_cpus': u'14'},
- 'local_storages': [],
+ 'num_cpus': u'14'
+ },
+ 'local_storages': [
+
+ ],
'vdu_id': u'vdu_12',
'image_file': u'sss',
- 'dependencies': [],
- 'vls': [],
- 'cps': [],
+ 'dependencies': [
+
+ ],
+ 'vls': [
+
+ ],
+ 'cps': [
+
+ ],
'properties': {
'key_vdu': '',
'support_scaling': False,
@@ -504,23 +386,60 @@ vnfd_model_dict = {
'region': '',
'dc': '',
'host': '',
- 'tenant': ''},
- 'inject_data_list': [],
+ 'tenant': ''
+ },
+ 'inject_data_list': [
+
+ ],
'watchdog': {
'action': '',
- 'enabledelay': ''},
- 'local_affinity_antiaffinity_rule': {},
+ 'enabledelay': ''
+ },
+ 'local_affinity_antiaffinity_rule': {
+
+ },
'template_id': u'12',
- 'manual_scale_select_vim': False},
- 'description': u'ppvm'}],
- 'volumn_storages': [],
+ 'manual_scale_select_vim': False
+ },
+ 'description': u'ppvm'
+ }
+ ],
+ 'volumn_storages': [
+ {
+ "volume_storage_id": "volume_storage1",
+ "description": "",
+ "properties": {
+ "size": "100 GB",
+ "volume_id": "",
+ "volume_name": "volumeStorage1",
+ "custom_volume_type": "type1",
+ "disk_type": "data",
+ "delete_on_termination_vm": True,
+ "location_info": {
+ "vimid": "vimid",
+ "tenant": "tenantname",
+ "availability_zone": "zone1"
+ },
+ "is_predefined": False,
+ "is_shared": False
+ },
+ "image_file": [
+ "volume_image"
+ ]
+ }
+ ],
'policies': {
'scaling': {
- 'targets': {},
+ 'targets': {
+
+ },
'policy_id': u'policy_scale_sss-vnf-template',
'properties': {
- 'policy_file': '*-vnfd.zip/*-vnf-policy.xml'},
- 'description': ''}},
+ 'policy_file': '*-vnfd.zip/*-vnf-policy.xml'
+ },
+ 'description': ''
+ }
+ },
'image_files': [
{
'description': '',
@@ -531,8 +450,10 @@ vnfd_model_dict = {
'file_url': u'./zte-cn-sss-main-image/OMM/opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
'container_type': 'vm',
'version': '',
- 'hypervisor_type': 'kvm'},
- 'image_file_id': u'opencos_sss_omm_img_release_20150723-1-disk1'},
+ 'hypervisor_type': 'kvm'
+ },
+ 'image_file_id': u'opencos_sss_omm_img_release_20150723-1-disk1'
+ },
{
'description': '',
'properties': {
@@ -542,64 +463,93 @@ vnfd_model_dict = {
'file_url': u'./zte-cn-sss-main-image/NE/sss.vmdk',
'container_type': 'vm',
'version': '',
- 'hypervisor_type': 'kvm'},
- 'image_file_id': u'sss'}],
- 'vls': [],
- 'cps': [],
- 'metadata': {
- 'vendor': u'zte',
- 'is_shared': False,
- 'description': '',
- 'domain_type': u'CN',
- 'version': u'v4.14.10',
- 'vmnumber_overquota_alarm': False,
- 'cross_dc': False,
- 'vnf_type': u'SSS',
- 'vnfd_version': u'V00000001',
- 'id': u'sss-vnf-template',
- 'name': u'sss-vnf-template'},
- "flavourId": "flavour_1",
- "instantiationLevelId": "instantiationLevel_1",
- "extVirtualLinks": [
+ 'hypervisor_type': 'kvm'
+ },
+ 'image_file_id': u'sss'
+ }
+ ],
+ 'vls': [
{
- "vlInstanceId": "1",
- "vim": {
- "vimInfoId": "1",
- "vimId": "1",
- "interfaceInfo": {
- "vimType": "vim",
- "apiVersion": "v2",
- "protocolType": "http"
+ "vl_id": "vldId1",
+ "description": "",
+ "properties": {
+ "name": "umac_241_control",
+ "network_name": "umac_control",
+ "is_predefined": False,
+ "vendor": "zte",
+ "netmask": "255.255.255.0",
+ "mtu": 1500,
+ "network_type": "vlan",
+ "physical_network": "phynet01",
+ "segmentation_id": "30",
+ "vlan_transparent": False,
+ "vds_name": "vds1",
+ "cidr": "192.168.199.0/24",
+ "ip_version": 4,
+ "gateway_ip": "192.168.199.1",
+ "dhcp_enabled": False,
+ "dns_nameservers": [
+ "192.168.0.4",
+ "192.168.0.10"
+ ],
+ "start_ip": "192.168.199.2",
+ "end_ip": "192.168.199.254",
+ "host_routes": [
+ {
+ "destination": "10.43.26.0/24",
+ "nexthop": "10.41.23.1"
+ }
+ ],
+ "location_info": {
+ "vimid": "vimid",
+ "tenant": "tenantname"
},
- "accessInfo": {
- "tenant": "tenant_vCPE",
- "username": "vCPE",
- "password": "vCPE_321"
+ "cloud_type": "IaaS"
+ },
+ "route_id": "router01",
+ "route_external": False
+ }
+ ],
+ 'cps': [
+ {
+ "cp_id": "cpId",
+ "description": "",
+ "properties": {
+ "name": "",
+ "mac_address": "00:d9:00:82:11:e1",
+ "ip_address:": "192.168.1.21",
+ "ip_range_start": "192.168.1.20",
+ "ip_range_end": "192.168.1.29",
+ "floating_ip_address": {
+ "external_network": "extnet01",
+ "ip_address": "10.43.53.23"
},
- "interfaceEndpoint": "http://10.43.21.105:80/"
+ "service_ip_address": "192.168.1.23",
+ "order": 1,
+ "bandwidth": 1000,
+ "vnic_type": "normal",
+ "allowed_address_pairs": [
+ {
+ "ip": "192.168.1.13",
+ "mac": "00:f3:43:20:a2:a3"
+ }
+ ],
+ "bond": "none",
+ "bond_index": 1,
+ "macbond": "00:d9:00:82:11:d1",
+ "sfc_encapsulation": "",
+ "direction": "",
+ "gateway_ip": "192.168.199.1",
+ "netmask": "255.255.255.0",
+ "interface_name": "fe-01-02",
+ "is_virtual": False,
+ "function": "control"
},
- "resourceId": "1246",
- "extCps": [
- {
- "cpdId": "11",
- "addresses": [
- {
- "addressType": "MAC",
- "l2AddressData": "00:f3:43:20:a2:a3"
- },
- {
- "addressType": "IP",
- "l3AddressData": {
- "iPAddressType": "IPv4",
- "iPAddress": "192.168.104.2"
- }
- }
- ],
- "numDynamicAddresses": 0
- }
- ]
+ "vl_id": "vlid1",
+ "vdu_id": "vdu_id1"
}
],
- "localizationLanguage": "en_US",
- "additionalParams": {}
+ 'local_storages': [
+
+ ],
} \ No newline at end of file
diff --git a/lcm/lcm/nf/vnfs/tests/test_vnf_create.py b/lcm/lcm/nf/vnfs/tests/test_vnf_create.py
index b6287c52..e323f604 100644
--- a/lcm/lcm/nf/vnfs/tests/test_vnf_create.py
+++ b/lcm/lcm/nf/vnfs/tests/test_vnf_create.py
@@ -147,8 +147,7 @@ class TestNFInstantiate(TestCase):
# NfInstModel.objects.create(nfinstid='1111', nf_name='vFW_01', package_id='222',
# version='', vendor='', netype='', vnfd_model='', status='NOT_INSTANTIATED',
# nf_desc='vFW in Nanjing TIC Edge', vnfdid='111', create_time=now_time())
- # r1 = [0, json.JSONEncoder().encode({'package_id': '222', 'csar_id': '2222'}),
- # '200'] # get csar_id from nslcm by vnfd_id
+ # r1 = [0, json.JSONEncoder().encode({'package_id': '222', 'csar_id': '2222'}), '200'] # get csar_id from nslcm by vnfd_id
# r2 = [0, json.JSONEncoder().encode(vnfd_rawdata), '200'] # get rawdata from catalog by csar_id
# r3 = [0, json.JSONEncoder().encode({"vim":{"vimid": '1', "accessinfo": {"tenant": '2'}}}), '200'] # apply_grant_to_nfvo
# mock_call_req.side_effect = [r1, r2, r3]