diff options
author | 2018-08-15 08:47:06 +0000 | |
---|---|---|
committer | 2018-08-15 08:47:06 +0000 | |
commit | 544ef161be0968467631aa48a82b37a3964039af (patch) | |
tree | 88013df1c083ef5147afb3d1e2ff338c64960947 /gvnfmadapter | |
parent | e65f7b227b393f6e245d95fe510ff7f86067e2ae (diff) | |
parent | b50daffdf6d356000caa2e21f596b5948d55c916 (diff) |
Merge "Deal with gvnfm adapter stuffs."
Diffstat (limited to 'gvnfmadapter')
-rw-r--r-- | gvnfmadapter/driver/interfaces/tests.py | 106 | ||||
-rw-r--r-- | gvnfmadapter/driver/interfaces/views.py | 6 |
2 files changed, 90 insertions, 22 deletions
diff --git a/gvnfmadapter/driver/interfaces/tests.py b/gvnfmadapter/driver/interfaces/tests.py index 39c2009..8a0bf3e 100644 --- a/gvnfmadapter/driver/interfaces/tests.py +++ b/gvnfmadapter/driver/interfaces/tests.py @@ -356,28 +356,94 @@ class InterfacesTest(TestCase): r2 = [0, json.JSONEncoder().encode(vim_info), "200"] mock_call_req.side_effect = [r2] req_data = { - "nfvoid": "1", - "vnfmid": "876543211", - "vimid": "6543211", - "timestamp": "1234567890", - "vnfinstanceid": "1", - "eventtype": "0", - "vmlist": [ - { - "vmflavor": "SMP", - "vmnumber": "3", - "vmidlist ": [ - "vmuuid" - ] + "vnfmInstId": "876543211", + "notificationType": "string", + "subscriptionId": "string", + "timeStamp": "1234567890", + "notificationStatus": "START", + "operationState": "STARTING", + "vnfInstanceId": "string", + "operation": "INSTANTIATE", + "isAutomaticInvocation": True, + "vnfLcmOpOccId": "string", + "affectedVnfcs": [{ + "id": "string", + "vduId": "string", + "changeType": "ADDED", + "computeResource": { + "vimConnectionId": "string", + "resourceProviderId": "string", + "resourceId": "string", + "vimLevelResourceType": "string" }, - { - "vmflavor": "CMP", - "vmnumber": "3", - "vmidlist ": [ - "vmuuid" - ] + "metadata": {}, + "affectedVnfcCpIds": [], + "addedStorageResourceIds": [], + "removedStorageResourceIds": [], + }], + "affectedVirtualLinks": [{ + "id": "string", + "virtualLinkDescId": "string", + "changeType": "ADDED", + "networkResource": { + "vimConnectionId": "string", + "resourceProviderId": "string", + "resourceId": "string", + "vimLevelResourceType": "network", } - ] + }], + "affectedVirtualStorages": [{ + "id": "string", + "virtualStorageDescId": "string", + "changeType": "ADDED", + "storageResource": { + "vimConnectionId": "string", + "resourceProviderId": "string", + "resourceId": "string", + "vimLevelResourceType": "network", + }, + "metadata": {} + }], + "changedInfo": { + "vnfInstanceName": "string", + "vnfInstanceDescription": "string", + "vnfConfigurableProperties": {}, + "metadata": {}, + "extensions": {}, + "vimConnectionInfo": [{ + "id": "string", + "vimId": "string", + "vimType": "string", + "interfaceInfo": {}, + "accessInfo": {}, + "extra": {} + }], + "vnfPkgId": "string", + "vnfdId": "string", + "vnfProvider": "string", + "vnfProductName": "string", + "vnfSoftwareVersion": "string", + "vnfdVersion": "string" + }, + "changedExtConnectivity": [{ + "id": "string", + "resourceHandle": { + "vimConnectionId": "string", + "resourceProviderId": "string", + "resourceId": "string", + "vimLevelResourceType": "string" + }, + "extLinkPorts": [{ + "id": "string", + "resourceHandle": { + "vimConnectionId": "string", + "resourceProviderId": "string", + "resourceId": "string", + "vimLevelResourceType": "string" + }, + "cpInstanceId": "string" + }] + }] } response = self.client.post("/api/gvnfmdriver/v1/vnfs/lifecyclechangesnotification", data=json.dumps(req_data), diff --git a/gvnfmadapter/driver/interfaces/views.py b/gvnfmadapter/driver/interfaces/views.py index 1b0f027..e3c107f 100644 --- a/gvnfmadapter/driver/interfaces/views.py +++ b/gvnfmadapter/driver/interfaces/views.py @@ -271,8 +271,10 @@ class VnfNotifyInfo(APIView): def post(self, request, vnfmtype): try: logger.debug("[%s]req_data = %s", fun_name(), request.data) - vnfinstanceid = ignorcase_get(request.data, 'vnfinstanceid') - ret = req_by_msb("api/nslcm/v1/vnfs/%s/Notify" % vnfinstanceid, "POST", + vnfminstid = ignorcase_get(request.data, 'vnfmInstId') + vnfinstanceid = ignorcase_get(request.data, 'vnfInstanceId') + request.data.pop("vnfmInstId") + ret = req_by_msb("api/nslcm/v2/ns/%s/vnfs/%s/Notify" % (vnfminstid, vnfinstanceid), "POST", json.JSONEncoder().encode(request.data)) logger.debug("[%s]data = %s", fun_name(), ret) if ret[0] != 0: |