summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlaili <lai.li@zte.com.cn>2018-09-07 17:32:51 +0800
committerlaili <lai.li@zte.com.cn>2018-09-07 17:32:51 +0800
commit70bb01f730b2586821d7d231906d1e1f6f090cb8 (patch)
treefb05e1c7f8885d7b0628573b74fa83c04e3c4d70
parent16c4a5ff577f27c6ff404059612ecf68eb044b1f (diff)
Align grant request with SOL003.
-Align grant request. -Rename resouceid to resourceid. Change-Id: I1a933ba6248911984500a06f3fd031fddec06880 Issue-ID: VFC-1101 Signed-off-by: laili <lai.li@zte.com.cn>
-rw-r--r--lcm/lcm/nf/biz/grant_vnf.py53
-rw-r--r--lcm/lcm/nf/biz/instantiate_vnf.py20
-rw-r--r--lcm/lcm/nf/biz/operate_vnf.py6
-rw-r--r--lcm/lcm/nf/biz/query_vnf.py6
-rw-r--r--lcm/lcm/nf/biz/terminate_vnf.py9
-rw-r--r--lcm/lcm/nf/const.py2
-rw-r--r--lcm/lcm/nf/tests/test_delete_vnf.py12
-rw-r--r--lcm/lcm/nf/tests/test_operate_vnf.py16
-rw-r--r--lcm/lcm/nf/tests/test_query_vnf.py4
-rw-r--r--lcm/lcm/nf/tests/test_terminate_vnf.py12
-rw-r--r--lcm/lcm/pub/database/models.py12
-rw-r--r--lcm/lcm/pub/msapi/gvnfmdriver.py8
12 files changed, 93 insertions, 67 deletions
diff --git a/lcm/lcm/nf/biz/grant_vnf.py b/lcm/lcm/nf/biz/grant_vnf.py
index fe3cb530..a92f365e 100644
--- a/lcm/lcm/nf/biz/grant_vnf.py
+++ b/lcm/lcm/nf/biz/grant_vnf.py
@@ -25,38 +25,53 @@ logger = logging.getLogger(__name__)
def grant_resource(data, nf_inst_id, job_id, grant_type, vdus):
logger.info("Grant resource begin")
- lifecycleOperration = grant_type
content_args = {
'vnfInstanceId': nf_inst_id,
- 'vnfDescriptorId': '',
- 'lifecycleOperation': lifecycleOperration,
'vnfLcmOpOccId': job_id,
+ 'vnfdId': None, # TODO
+ 'flavourId': None, # TODO
+ 'operate': grant_type,
+ 'isAutomaticInvocation': True, # TODO
+ 'instantiationLevelId': None, # TODO
'addResources': [],
+ 'tmpResources': [],
'updateResources': [],
'removeResources': [],
'placementConstraints': [],
- 'additionalParams': {}
+ 'vimConstraints': [],
+ 'additionalParams': {},
+ '_links': None # TODO
}
- if grant_type == "Terminate":
+ if grant_type == GRANT_TYPE.TERMINATE:
res_index = 1
for vdu in vdus:
res_def = {
- 'type': 'VDU',
- 'resDefId': str(res_index),
- 'resDesId': vdu.resouceid}
+ 'id': str(res_index),
+ 'type': 'COMPUTE',
+ 'vduId': None,
+ 'resourceTemplateId': None,
+ 'resource': {
+ 'vimConnectionId': None,
+ 'resourceProviderId': None,
+ 'resourceid': vdu.resourceid,
+ 'vimLevelResourceType': None
+ }
+ }
content_args['removeResources'].append(res_def)
res_index += 1
content_args['additionalParams']['vimid'] = vdus[0].vimid
- elif grant_type == "Instantiate":
+ elif grant_type == GRANT_TYPE.INSTANTIATE:
vim_id = ignore_case_get(ignore_case_get(data, "additionalParams"), "vimId")
res_index = 1
for vdu in vdus:
res_def = {
- 'type': 'VDU',
- 'resDefId': str(res_index),
- 'resDesId': ignore_case_get(vdu, "vdu_id")
+ 'id': str(res_index),
+ 'type': 'COMPUTE',
+ 'vduId': None,
+ 'resourceTemplateId': None, # TODO: shall be present for the planned creation of new resources.
+ 'resource': None
}
content_args['addResources'].append(res_def)
res_index += 1
@@ -65,9 +80,17 @@ def grant_resource(data, nf_inst_id, job_id, grant_type, vdus):
res_index = 1
for vdu in vdus:
res_def = {
- 'type': 'VDU',
- 'resDefId': str(res_index),
- 'resDesId': vdu.resouceid}
+ 'id': str(res_index),
+ 'type': 'COMPUTE',
+ 'vduId': None,
+ 'resourceTemplateId': None,
+ 'resource': {
+ 'vimConnectionId': None,
+ 'resourceProviderId': None,
+ 'resourceid': vdu.resourceid,
+ 'vimLevelResourceType': None
+ }
+ }
content_args['updateResources'].append(res_def)
res_index += 1
content_args['additionalParams']['vimid'] = vdus[0].vimid
diff --git a/lcm/lcm/nf/biz/instantiate_vnf.py b/lcm/lcm/nf/biz/instantiate_vnf.py
index 161cd7d1..1c9a66bf 100644
--- a/lcm/lcm/nf/biz/instantiate_vnf.py
+++ b/lcm/lcm/nf/biz/instantiate_vnf.py
@@ -28,6 +28,7 @@ from lcm.pub.utils.timeutil import now_time
from lcm.pub.utils.values import ignore_case_get, get_none, get_boolean, get_integer
from lcm.pub.vimapi import adaptor
from lcm.nf.biz.grant_vnf import grant_resource
+from lcm.nf.const import GRANT_TYPE
logger = logging.getLogger(__name__)
@@ -39,7 +40,7 @@ class InstantiateVnf(Thread):
self.nf_inst_id = nf_inst_id
self.job_id = job_id
self.vim_id = ignore_case_get(ignore_case_get(self.data, "additionalParams"), "vimId")
- self.grant_type = "Instantiate"
+ self.grant_type = GRANT_TYPE.INSTANTIATE
def run(self):
try:
@@ -73,8 +74,9 @@ class InstantiateVnf(Thread):
inputs = json.loads(inputs)
for key, val in inputs.items():
input_parameters.append({"key": key, "value": val})
- vnf_package_info = query_vnfpackage_by_id(self.vnfd_id)
- self.vnfd_info = json.loads(ignore_case_get(ignore_case_get(vnf_package_info, "packageInfo"), "vnfdModel"))
+ vnf_package = query_vnfpackage_by_id(self.vnfd_id)
+ pkg_info = ignore_case_get(vnf_package, "packageInfo")
+ self.vnfd_info = json.loads(ignore_case_get(pkg_info, "vnfdModel"))
self.update_cps()
metadata = ignore_case_get(self.vnfd_info, "metadata")
@@ -180,7 +182,7 @@ def volume_save(job_id, nf_inst_id, ret):
StorageInstModel.objects.create(
storageid=str(uuid.uuid4()),
vimid=ignore_case_get(ret, "vimId"),
- resouceid=ignore_case_get(ret, "id"),
+ resourceid=ignore_case_get(ret, "id"),
name=ignore_case_get(ret, "name"),
tenant=ignore_case_get(ret, "tenantId"),
create_time=ignore_case_get(ret, "createTime"),
@@ -198,7 +200,7 @@ def network_save(job_id, nf_inst_id, ret):
networkid=str(uuid.uuid4()),
name=ignore_case_get(ret, "name"),
vimid=ignore_case_get(ret, "vimId"),
- resouceid=ignore_case_get(ret, "id"),
+ resourceid=ignore_case_get(ret, "id"),
tenant=ignore_case_get(ret, "tenantId"),
segmentid=str(ignore_case_get(ret, "segmentationId")),
network_type=ignore_case_get(ret, "networkType"),
@@ -218,7 +220,7 @@ def subnet_save(job_id, nf_inst_id, ret):
subnetworkid=str(uuid.uuid4()),
name=ignore_case_get(ret, "name"),
vimid=ignore_case_get(ret, "vimId"),
- resouceid=ignore_case_get(ret, "id"),
+ resourceid=ignore_case_get(ret, "id"),
tenant=ignore_case_get(ret, "tenantId"),
networkid=ignore_case_get(ret, "networkId"),
cidr=ignore_case_get(ret, "cidr"),
@@ -241,7 +243,7 @@ def port_save(job_id, nf_inst_id, ret):
subnetworkid=ignore_case_get(ret, "subnetId"),
name=ignore_case_get(ret, "name"),
vimid=ignore_case_get(ret, "vimId"),
- resouceid=ignore_case_get(ret, "id"),
+ resourceid=ignore_case_get(ret, "id"),
tenant=ignore_case_get(ret, "tenantId"),
macaddress=ignore_case_get(ret, "macAddress"),
ipaddress=ignore_case_get(ret, "ip"),
@@ -259,7 +261,7 @@ def flavor_save(job_id, nf_inst_id, ret):
flavourid=str(uuid.uuid4()),
name=ignore_case_get(ret, "name"),
vimid=ignore_case_get(ret, "vimId"),
- resouceid=ignore_case_get(ret, "id"),
+ resourceid=ignore_case_get(ret, "id"),
tenant=ignore_case_get(ret, "tenantId"),
vcpu=get_integer(ignore_case_get(ret, "vcpu")),
memory=get_integer(ignore_case_get(ret, "memory")),
@@ -279,7 +281,7 @@ def vm_save(job_id, nf_inst_id, ret):
vmid=vm_id,
vmname=ignore_case_get(ret, "name"),
vimid=ignore_case_get(ret, "vimId"),
- resouceid=ignore_case_get(ret, "id"),
+ resourceid=ignore_case_get(ret, "id"),
tenant=ignore_case_get(ret, "tenantId"),
nic_array=ignore_case_get(ret, "nicArray"),
metadata=ignore_case_get(ret, "metadata"),
diff --git a/lcm/lcm/nf/biz/operate_vnf.py b/lcm/lcm/nf/biz/operate_vnf.py
index 5f6499d6..99c1e6d9 100644
--- a/lcm/lcm/nf/biz/operate_vnf.py
+++ b/lcm/lcm/nf/biz/operate_vnf.py
@@ -70,7 +70,7 @@ class OperateVnf(Thread):
resource_table = globals().get(resource_type + 'InstModel')
resource_insts = resource_table.objects.filter(instid=self.nf_inst_id)
for resource_inst in resource_insts:
- if not resource_inst.resouceid:
+ if not resource_inst.resourceid:
continue
self.inst_resource[RESOURCE_MAP.get(resource_type)].append(self.get_resource(resource_inst))
logger.info('Query resource end, resource=%s' % self.inst_resource)
@@ -79,7 +79,7 @@ class OperateVnf(Thread):
return {
"vim_id": resource.vimid,
"tenant_id": resource.tenant,
- "id": resource.resouceid
+ "id": resource.resourceid
}
def operate_resource(self):
@@ -100,4 +100,4 @@ class OperateVnf(Thread):
def do_notify_op(self, status, resid):
logger.error('VNF resource %s updated to: %s' % (resid, status))
- VmInstModel.objects.filter(instid=self.nf_inst_id, resouceid=resid).update(operationalstate=status)
+ VmInstModel.objects.filter(instid=self.nf_inst_id, resourceid=resid).update(operationalstate=status)
diff --git a/lcm/lcm/nf/biz/query_vnf.py b/lcm/lcm/nf/biz/query_vnf.py
index 09fab6ca..380d455a 100644
--- a/lcm/lcm/nf/biz/query_vnf.py
+++ b/lcm/lcm/nf/biz/query_vnf.py
@@ -51,7 +51,7 @@ class QueryVnf:
"id": s.storageid,
"storageResource": {
"vimConnectionId": s.vimid,
- "resourceId": s.resouceid
+ "resourceId": s.resourceid
}
}
arr.append(storage)
@@ -67,7 +67,7 @@ class QueryVnf:
"virtualLinkDescId": v.vldid,
"networkResource": {
"vimConnectionId": net[0].vimid,
- "resourceId": net[0].resouceid
+ "resourceId": net[0].resourceid
}
}
vl_arr.append(v_dic)
@@ -87,7 +87,7 @@ class QueryVnf:
"vduId": vnfc.vduid,
"computeResource": {
"vimConnectionId": vm[0].vimid,
- "resourceId": vm[0].resouceid
+ "resourceId": vm[0].resourceid
},
"storageResourceIds": [s.storageid for s in storage]
}
diff --git a/lcm/lcm/nf/biz/terminate_vnf.py b/lcm/lcm/nf/biz/terminate_vnf.py
index d63cdfa9..5b299f20 100644
--- a/lcm/lcm/nf/biz/terminate_vnf.py
+++ b/lcm/lcm/nf/biz/terminate_vnf.py
@@ -30,6 +30,7 @@ from lcm.pub.utils.timeutil import now_time
from lcm.pub.utils.values import ignore_case_get
from lcm.pub.vimapi import adaptor
from lcm.nf.biz.grant_vnf import grant_resource
+from lcm.nf.const import GRANT_TYPE
logger = logging.getLogger(__name__)
@@ -43,7 +44,7 @@ class TerminateVnf(Thread):
self.terminationType = ignore_case_get(self.data, "terminationType")
self.gracefulTerminationTimeout = ignore_case_get(self.data, "gracefulTerminationTimeout")
self.inst_resource = {'volumn': [], 'network': [], 'subnet': [], 'port': [], 'flavor': [], 'vm': []}
- self.grant_type = "Terminate"
+ self.grant_type = GRANT_TYPE.TERMINATE
def run(self):
try:
@@ -83,7 +84,7 @@ class TerminateVnf(Thread):
resource_table = globals().get(resource_type + 'InstModel')
resource_insts = resource_table.objects.filter(instid=self.nf_inst_id)
for resource_inst in resource_insts:
- if not resource_inst.resouceid:
+ if not resource_inst.resourceid:
continue
self.inst_resource[RESOURCE_MAP.get(resource_type)].append(self.get_resource(resource_inst))
logger.info('Query resource end, resource=%s' % self.inst_resource)
@@ -92,7 +93,7 @@ class TerminateVnf(Thread):
return {
"vim_id": resource.vimid,
"tenant_id": resource.tenant,
- "res_id": resource.resouceid,
+ "res_id": resource.resourceid,
"is_predefined": resource.is_predefined
}
@@ -114,7 +115,7 @@ class TerminateVnf(Thread):
logger.error('Deleting [%s] resource, resourceid [%s]' % (res_type, res_id))
resource_type = RESOURCE_MAP.keys()[RESOURCE_MAP.values().index(res_type)]
resource_table = globals().get(resource_type + 'InstModel')
- resource_table.objects.filter(instid=self.nf_inst_id, resouceid=res_id).delete()
+ resource_table.objects.filter(instid=self.nf_inst_id, resourceid=res_id).delete()
def lcm_notify(self):
NfInstModel.objects.filter(nfinstid=self.nf_inst_id).update(status='NOT_INSTANTIATED', lastuptime=now_time())
diff --git a/lcm/lcm/nf/const.py b/lcm/lcm/nf/const.py
index f45e9f68..af0df0d8 100644
--- a/lcm/lcm/nf/const.py
+++ b/lcm/lcm/nf/const.py
@@ -17,7 +17,7 @@ from lcm.pub.utils.jobutil import enum
HEAL_ACTION_TYPE = enum(START="vmCreate", RESTART="vmReset")
ACTION_TYPE = enum(START=1, STOP=2, REBOOT=3)
-GRANT_TYPE = enum(INSTANTIATE="Instantiate", TERMINATE="Terminate", HEAL_CREATE="Heal Create", HEAL_RESTART="Heal Restart", OPERATE="Operate")
+GRANT_TYPE = enum(INSTANTIATE="INSTANTIATE", TERMINATE="TERMINATE", HEAL_CREATE="Heal Create", HEAL_RESTART="Heal Restart", OPERATE="OPERATE")
VNF_STATUS = enum(NULL='null', INSTANTIATING="instantiating", INACTIVE='inactive', ACTIVE="active",
FAILED="failed", TERMINATING="terminating", SCALING="scaling", OPERATING="operating",
UPDATING="updating", HEALING="healing")
diff --git a/lcm/lcm/nf/tests/test_delete_vnf.py b/lcm/lcm/nf/tests/test_delete_vnf.py
index 26679231..62ed0dfd 100644
--- a/lcm/lcm/nf/tests/test_delete_vnf.py
+++ b/lcm/lcm/nf/tests/test_delete_vnf.py
@@ -26,13 +26,13 @@ class TestNFTerminate(TestCase):
self.client = Client()
StorageInstModel.objects.create(storageid="1",
vimid="1",
- resouceid="11",
+ resourceid="11",
insttype=0,
instid="1111",
is_predefined=1)
NetworkInstModel.objects.create(networkid='1',
vimid='1',
- resouceid='1',
+ resourceid='1',
name='pnet_network',
is_predefined=1,
tenant='admin',
@@ -40,7 +40,7 @@ class TestNFTerminate(TestCase):
instid='1111')
SubNetworkInstModel.objects.create(subnetworkid='1',
vimid='1',
- resouceid='1',
+ resourceid='1',
networkid='1',
is_predefined=1,
name='sub_pnet',
@@ -51,7 +51,7 @@ class TestNFTerminate(TestCase):
networkid='1',
subnetworkid='1',
vimid='1',
- resouceid='1',
+ resourceid='1',
is_predefined=1,
name='aaa_pnet_cp',
tenant='admin',
@@ -59,12 +59,12 @@ class TestNFTerminate(TestCase):
instid='1111')
FlavourInstModel.objects.create(flavourid="1",
vimid="1",
- resouceid="11",
+ resourceid="11",
instid="1111",
is_predefined=1)
VmInstModel.objects.create(vmid="1",
vimid="1",
- resouceid="11",
+ resourceid="11",
insttype=0,
instid="1111",
vmname="test_01",
diff --git a/lcm/lcm/nf/tests/test_operate_vnf.py b/lcm/lcm/nf/tests/test_operate_vnf.py
index 2071472c..625d40a3 100644
--- a/lcm/lcm/nf/tests/test_operate_vnf.py
+++ b/lcm/lcm/nf/tests/test_operate_vnf.py
@@ -87,7 +87,7 @@ class TestNFOperate(TestCase):
VmInstModel.objects.create(vmid="1",
vimid="1",
- resouceid="11",
+ resourceid="11",
insttype=0,
instid="1111",
vmname="test_01",
@@ -105,7 +105,7 @@ class TestNFOperate(TestCase):
self.job_id = JobUtil.create_job('NF', 'OPERATE', self.nf_inst_id)
JobUtil.add_job_status(self.job_id, 0, "OPERATE_VNF_READY")
OperateVnf(req_data, nf_inst_id=self.nf_inst_id, job_id=self.job_id).run()
- vm = VmInstModel.objects.filter(vmid="1", vimid="1", resouceid="11")
+ vm = VmInstModel.objects.filter(vmid="1", vimid="1", resourceid="11")
self.assertEqual("ACTIVE", vm[0].operationalstate)
self.assert_job_result(self.job_id, 100, "Operate Vnf success.")
@@ -130,7 +130,7 @@ class TestNFOperate(TestCase):
VmInstModel.objects.create(vmid="1",
vimid="1",
- resouceid="11",
+ resourceid="11",
insttype=0,
instid="1111",
vmname="test_01",
@@ -148,7 +148,7 @@ class TestNFOperate(TestCase):
self.job_id = JobUtil.create_job('NF', 'OPERATE', self.nf_inst_id)
JobUtil.add_job_status(self.job_id, 0, "OPERATE_VNF_READY")
OperateVnf(req_data, nf_inst_id=self.nf_inst_id, job_id=self.job_id).run()
- vm = VmInstModel.objects.filter(vmid="1", vimid="1", resouceid="11")
+ vm = VmInstModel.objects.filter(vmid="1", vimid="1", resourceid="11")
self.assertEqual("INACTIVE", vm[0].operationalstate)
self.assert_job_result(self.job_id, 100, "Operate Vnf success.")
@@ -173,7 +173,7 @@ class TestNFOperate(TestCase):
VmInstModel.objects.create(vmid="1",
vimid="1",
- resouceid="11",
+ resourceid="11",
insttype=0,
instid="1111",
vmname="test_01",
@@ -193,7 +193,7 @@ class TestNFOperate(TestCase):
self.job_id = JobUtil.create_job('NF', 'OPERATE', self.nf_inst_id)
JobUtil.add_job_status(self.job_id, 0, "OPERATE_VNF_READY")
OperateVnf(req_data, nf_inst_id=self.nf_inst_id, job_id=self.job_id).run()
- vm = VmInstModel.objects.filter(vmid="1", vimid="1", resouceid="11")
+ vm = VmInstModel.objects.filter(vmid="1", vimid="1", resourceid="11")
self.assertEqual("INACTIVE", vm[0].operationalstate)
self.assert_job_result(self.job_id, 100, "Operate Vnf success.")
@@ -218,7 +218,7 @@ class TestNFOperate(TestCase):
VmInstModel.objects.create(vmid="1",
vimid="1",
- resouceid="11",
+ resourceid="11",
insttype=0,
instid="1111",
vmname="test_01",
@@ -237,6 +237,6 @@ class TestNFOperate(TestCase):
self.job_id = JobUtil.create_job('NF', 'OPERATE', self.nf_inst_id)
JobUtil.add_job_status(self.job_id, 0, "OPERATE_VNF_READY")
OperateVnf(req_data, nf_inst_id=self.nf_inst_id, job_id=self.job_id).run()
- vm = VmInstModel.objects.filter(vmid="1", vimid="1", resouceid="11")
+ vm = VmInstModel.objects.filter(vmid="1", vimid="1", resourceid="11")
self.assertEqual("INACTIVE", vm[0].operationalstate)
self.assert_job_result(self.job_id, 100, "Operate Vnf success.")
diff --git a/lcm/lcm/nf/tests/test_query_vnf.py b/lcm/lcm/nf/tests/test_query_vnf.py
index 95f387b9..e0ecddb5 100644
--- a/lcm/lcm/nf/tests/test_query_vnf.py
+++ b/lcm/lcm/nf/tests/test_query_vnf.py
@@ -116,7 +116,7 @@ class ResourceTest(TestCase):
NfInstModel(nfinstid=vnf_inst_id, nf_name='VNF1', status='INSTANTIATED').save()
StorageInstModel(storageid='s02',
vimid='vim01',
- resouceid='resource01',
+ resourceid='resource01',
insttype=1,
instid=vnf_inst_id).save()
response = self.client.get("/api/vnflcm/v1/vnf_instances/%s" % vnf_inst_id, format='json')
@@ -161,7 +161,7 @@ class ResourceTest(TestCase):
status='INSTANTIATED').save()
StorageInstModel(storageid='s0%s' % i,
vimid='vim0%s' % i,
- resouceid='resource0%s' % i,
+ resourceid='resource0%s' % i,
insttype=1,
instid='%s' % i).save()
response = self.client.get("/api/vnflcm/v1/vnf_instances", format='json')
diff --git a/lcm/lcm/nf/tests/test_terminate_vnf.py b/lcm/lcm/nf/tests/test_terminate_vnf.py
index 23b246d7..97330b6c 100644
--- a/lcm/lcm/nf/tests/test_terminate_vnf.py
+++ b/lcm/lcm/nf/tests/test_terminate_vnf.py
@@ -34,13 +34,13 @@ class TestNFTerminate(TestCase):
self.client = Client()
StorageInstModel.objects.create(storageid="1",
vimid="1",
- resouceid="11",
+ resourceid="11",
insttype=0,
instid="1111",
is_predefined=1)
NetworkInstModel.objects.create(networkid='1',
vimid='1',
- resouceid='1',
+ resourceid='1',
name='pnet_network',
is_predefined=1,
tenant='admin',
@@ -48,7 +48,7 @@ class TestNFTerminate(TestCase):
instid='1111')
SubNetworkInstModel.objects.create(subnetworkid='1',
vimid='1',
- resouceid='1',
+ resourceid='1',
networkid='1',
is_predefined=1,
name='sub_pnet',
@@ -59,7 +59,7 @@ class TestNFTerminate(TestCase):
networkid='1',
subnetworkid='1',
vimid='1',
- resouceid='1',
+ resourceid='1',
is_predefined=1,
name='aaa_pnet_cp',
tenant='admin',
@@ -67,12 +67,12 @@ class TestNFTerminate(TestCase):
instid='1111')
FlavourInstModel.objects.create(flavourid="1",
vimid="1",
- resouceid="11",
+ resourceid="11",
instid="1111",
is_predefined=1)
VmInstModel.objects.create(vmid="1",
vimid="1",
- resouceid="11",
+ resourceid="11",
insttype=0,
instid="1111",
vmname="test_01",
diff --git a/lcm/lcm/pub/database/models.py b/lcm/lcm/pub/database/models.py
index cbdd85cc..47a22fdd 100644
--- a/lcm/lcm/pub/database/models.py
+++ b/lcm/lcm/pub/database/models.py
@@ -105,7 +105,7 @@ class StorageInstModel(models.Model):
storageid = models.CharField(db_column='STORAGEID', primary_key=True, max_length=255)
vimid = models.CharField(db_column='VIMID', max_length=255)
- resouceid = models.CharField(db_column='RESOURCEID', max_length=255)
+ resourceid = models.CharField(db_column='RESOURCEID', max_length=255)
insttype = models.IntegerField(db_column='INSTTYPE')
instid = models.CharField(db_column='INSTID', max_length=255)
name = models.CharField(db_column='NAME', max_length=255, null=True)
@@ -130,7 +130,7 @@ class VmInstModel(models.Model):
vmid = models.CharField(db_column='VMID', primary_key=True, max_length=255)
vimid = models.CharField(db_column='VIMID', max_length=255)
tenant = models.CharField(db_column='TENANT', max_length=255, null=True)
- resouceid = models.CharField(db_column='RESOURCEID', max_length=255)
+ resourceid = models.CharField(db_column='RESOURCEID', max_length=255)
vmname = models.CharField(db_column='VMNAME', max_length=255)
nic_array = models.CharField(db_column='NICARRAY', max_length=255)
metadata = models.CharField(db_column='METADATA', max_length=255)
@@ -165,7 +165,7 @@ class FlavourInstModel(models.Model):
flavourid = models.CharField(db_column='FLAVOURID', max_length=255, primary_key=True)
vimid = models.CharField(db_column='VIMID', max_length=255)
- resouceid = models.CharField(db_column='RESOURCEID', max_length=255)
+ resourceid = models.CharField(db_column='RESOURCEID', max_length=255)
name = models.CharField(db_column='NAME', max_length=255)
tenant = models.CharField(db_column='TENANT', max_length=255, null=True)
vcpu = models.IntegerField(db_column='VCPU', null=True)
@@ -186,7 +186,7 @@ class NetworkInstModel(models.Model):
networkid = models.CharField(db_column='NETWORKID', primary_key=True, max_length=255)
vimid = models.CharField(db_column='VIMID', max_length=255)
- resouceid = models.CharField(db_column='RESOURCEID', max_length=255)
+ resourceid = models.CharField(db_column='RESOURCEID', max_length=255)
insttype = models.IntegerField(db_column='INSTTYPE')
instid = models.CharField(db_column='INSTID', max_length=255)
name = models.CharField(db_column='NAME', max_length=255)
@@ -213,7 +213,7 @@ class SubNetworkInstModel(models.Model):
subnetworkid = models.CharField(db_column='SUBNETWORKID', primary_key=True, max_length=255)
vimid = models.CharField(db_column='VIMID', max_length=255)
- resouceid = models.CharField(db_column='RESOURCEID', max_length=255)
+ resourceid = models.CharField(db_column='RESOURCEID', max_length=255)
networkid = models.CharField(db_column='NETWORKID', max_length=255)
insttype = models.IntegerField(db_column='INSTTYPE')
instid = models.CharField(db_column='INSTID', max_length=255)
@@ -256,7 +256,7 @@ class PortInstModel(models.Model):
networkid = models.CharField(db_column='NETWORKID', max_length=255)
subnetworkid = models.CharField(db_column='SUBNETWORKID', max_length=255, null=True)
vimid = models.CharField(db_column='VIMID', max_length=255)
- resouceid = models.CharField(db_column='RESOURCEID', max_length=255)
+ resourceid = models.CharField(db_column='RESOURCEID', max_length=255)
name = models.CharField(db_column='NAME', max_length=255, null=True)
insttype = models.IntegerField(db_column='INSTTYPE')
instid = models.CharField(db_column='INSTID', max_length=255)
diff --git a/lcm/lcm/pub/msapi/gvnfmdriver.py b/lcm/lcm/pub/msapi/gvnfmdriver.py
index 4b2b304a..763b1974 100644
--- a/lcm/lcm/pub/msapi/gvnfmdriver.py
+++ b/lcm/lcm/pub/msapi/gvnfmdriver.py
@@ -60,7 +60,7 @@ def prepare_notification_data(nfinstid, jobid, changetype):
if vm:
vm_resource = {
'vimId': vm[0].vimid,
- 'resourceId': vm[0].resouceid,
+ 'resourceId': vm[0].resourceid,
'resourceProviderId': vm[0].vmname, # TODO: is resourceName mapped to resourceProviderId?
'vimLevelResourceType': 'vm'
}
@@ -75,7 +75,7 @@ def prepare_notification_data(nfinstid, jobid, changetype):
for network in networks:
network_resource = {
'vimConnectionId': network.vimid,
- 'resourceId': network.resouceid,
+ 'resourceId': network.resourceid,
'resourceProviderId': network.name, # TODO: is resourceName mapped to resourceProviderId?
'vimLevelResourceType': 'network'
}
@@ -92,7 +92,7 @@ def prepare_notification_data(nfinstid, jobid, changetype):
'id': port.portid, # TODO: port.portid or port.nodeid?
'resourceHandle': {
'vimConnectionId': port.vimid,
- 'resourceId': port.resouceid,
+ 'resourceId': port.resourceid,
'resourceProviderId': port.name, # TODO: is resourceName mapped to resourceProviderId?
'vimLevelResourceType': 'port'
},
@@ -107,7 +107,7 @@ def prepare_notification_data(nfinstid, jobid, changetype):
'changeType': changetype,
'storageResource': {
'vimConnectionId': vs.vimid,
- 'resourceId': vs.resouceid,
+ 'resourceId': vs.resourceid,
'resourceProviderId': vs.name, # TODO: is resourceName mapped to resourceProviderId?
'vimLevelResourceType': 'volume'
}