data["affectedVirtualStorage"] = []
data["affectedCp"] = []
- affectedvnfcs = ignorcase_get(ignorcase_get(request.data, "extension"), "affectedvnfc")
- affectedvls = ignorcase_get(ignorcase_get(request.data, "extension"), "affectedvl")
- affectedcps = ignorcase_get(ignorcase_get(request.data, "extension"), "affectedcp")
- vnfdmodule = ignorcase_get(ignorcase_get(request.data, "extension"), "vnfdmodule")
+ extension = ignorcase_get(request.data, "extension")
+ openo_notification = ignorcase_get(extension, "openo_notification")
+ if openo_notification:
+ affectedvnfcs = ignorcase_get(openo_notification, "affectedVnfc")
+ affectedvls = ignorcase_get(openo_notification, "affectedvirtuallink")
+ affectedcps = ignorcase_get(openo_notification, "affectedCp")
+ vnfdmodule = ignorcase_get(openo_notification, "vnfdmodule")
+ else:
+ affectedvnfcs = ignorcase_get(ignorcase_get(request.data, "extension"), "affectedvnfc")
+ affectedvls = ignorcase_get(ignorcase_get(request.data, "extension"), "affectedvl")
+ affectedcps = ignorcase_get(ignorcase_get(request.data, "extension"), "affectedcp")
+ vnfdmodule = ignorcase_get(ignorcase_get(request.data, "extension"), "vnfdmodule")
data["vnfdmodule"] = vnfdmodule
for affectedvnfc in affectedvnfcs:
data["affectedVnfc"].append({
- "vnfcInstanceId": ignorcase_get(affectedvnfc, "vnfcinstanceid"),
+ "vnfcInstanceId": ignorcase_get(affectedvnfc, "vnfcInstanceId"),
"vduId": ignorcase_get(affectedvnfc, "vduId"),
"changeType": ignorcase_get(affectedvnfc, "changeType"),
- "vimid": ignorcase_get(ignorcase_get(affectedvnfc, "computeresource"), "vimid"),
- "vmId": ignorcase_get(ignorcase_get(affectedvnfc, "computeresource"), "resourceid"),
- "vmName": ignorcase_get(ignorcase_get(affectedvnfc, "computeresource"), "resourcename")
+ "vimid": ignorcase_get(ignorcase_get(affectedvnfc, "computeResource"), "vimId"),
+ "vmId": ignorcase_get(ignorcase_get(affectedvnfc, "computeResource"), "resourceId"),
+ "vmName": ignorcase_get(ignorcase_get(affectedvnfc, "computeResource"), "resourceName")
})
for affectedvl in affectedvls:
return Response(data={'error': ret[1]}, status=ret[2])
except Exception as e:
logger.error("Error occurred in LCM notification.")
+ logger.error(traceback.format_exc())
raise e
return Response(data=None, status=ret[2])
if ret[0] != 0:
return Response(data={'error': ret[1]}, status=ret[2])
vnfm_info = json.JSONDecoder().decode(ret[1])
- data = request.data
+ data = {}
+ data['action'] = ignorcase_get(request.data, 'action')
+ affectedvm = ignorcase_get(request.data, 'affectedvm')
+ data['affectedvm'] = []
+ if isinstance(affectedvm, list):
+ data['affectedvm'] = affectedvm
+ else:
+ data['affectedvm'].append(affectedvm)
data['lifecycleoperation'] = 'operate'
data['isgrace'] = 'force'
passwd=ignorcase_get(vnfm_info, "password"),
auth_type=restcall.rest_no_auth,
resource=nf_healing_url.format(vnfInstanceID=nf_instance_id),
- method='put', # POST
+ method='post',
content=json.JSONEncoder().encode(data))
logger.info("ret=%s", ret)
if ret[0] != 0: