diff --git a/adaptation_layer/driver/osm.py b/adaptation_layer/driver/osm.py index 8c92fdb..53a79e4 100644 --- a/adaptation_layer/driver/osm.py +++ b/adaptation_layer/driver/osm.py @@ -283,20 +283,15 @@ def instantiate_ns(self, nsId: str, args=None) -> Tuple[None, Headers]: args_payload = args['payload'] if args_payload and 'additionalParamsForNs' in args_payload: - additional_params = args_payload['additionalParamsForNs'] - if 'vnf' in additional_params: + instantiate_payload.update(args_payload['additionalParamsForNs']) + if 'vnf' in instantiate_payload: mapping = {v: str(i+1) for i, v in enumerate(ns_res['constituent-vnfr-ref'])} - - for vnf in additional_params['vnf']: + for vnf in instantiate_payload['vnf']: if vnf.get('vnfInstanceId'): vnf['member-vnf-index'] = mapping[vnf.pop( 'vnfInstanceId')] - if len(additional_params['vnf']) > 0: - instantiate_payload['vnf'] = additional_params['vnf'] - if 'wim_account' in additional_params: - instantiate_payload['wimAccountId'] = additional_params['wim_account'] - else: + if 'wim_account' not in instantiate_payload: instantiate_payload['wimAccountId'] = False try: diff --git a/openapi/MSO-LO-swagger-resolved.yaml b/openapi/MSO-LO-swagger-resolved.yaml index bb9c682..5536491 100644 --- a/openapi/MSO-LO-swagger-resolved.yaml +++ b/openapi/MSO-LO-swagger-resolved.yaml @@ -1191,9 +1191,23 @@ definitions: type: string vimAccountId: type: string + NfvoNsInstantiateRequest_additionalParamsForNs_vld: + items: + type: object + properties: + name: + type: string + example: vldnet + vim-network-name: + type: string + example: netVIM1 NfvoNsInstantiateRequest_additionalParamsForNs: type: object properties: + vld: + type: array + items: + $ref: '#/definitions/NfvoNsInstantiateRequest_additionalParamsForNs_vld' vnf: type: array items: