diff --git a/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot b/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot index 10dffb4c9db02330727bd51eaae941ce7848717d..fa1bf6c29899ae437cc7b821857086b8cd04979b 100644 --- a/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot +++ b/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot @@ -558,12 +558,33 @@ POST Update NSInstance Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${template}= Get File jsons/UpdateNsRequest.json - ${body}= Format String ${template} vnfUpdateType=${vnfUpdateType} - Post ${apiRoot}/${apiName}/${apiMajorVersion}/ns_instances/${nsInstanceId}/update ${body} + Run Keyword If ${check_descriptors} == 1 Add VNF Descriptor Content to NS Instance + ${template} = Get File jsons/UpdateNsRequest.json + ${body}= Format String ${template} vnfdId=${descriptor_id} vnfFlavourId=${flavour_Id} newFlavourId=${flavour_Id} vnfVirtualLinkDescId=${virtualLink_id} instantiationLevelId=${instantiationLevel_id} vnfInstantiationLevelId=${instantiationLevel_id} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/ns_instances/${nsInstanceId}/update ${body} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} - + +Add VNF Descriptor Content to NS Instance + Run Keyword If '${descriptorType}'=='SOL001' Parse SOL001 NS Instance ELSE Parse SOL006 NS Instance + +Parse SOL001 NS Instance + Get key for VNF Descriptor + ${descriptor_id}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.descriptor_id} + ${provider}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.provider} + ${product_name}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.product_name} + ${software_version}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.software_version} + ${descriptor_version}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.descriptor_version} + ${flavour_Id}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.flavour_id} + +Parse SOL006 NS Instance + ${descriptor_id}= Get Variable Value ${nfv.vnfd[0].id} + ${provider}= Get Variable Value ${nfv.vnfd[0].provider} + ${product_name}= Get Variable Value ${nfv.vnfd[0].product-name} + ${software_version}= Get Variable Value ${nfv.vnfd[0].software-version} + ${descriptor_version}= Get Variable Value ${nfv.vnfd[0].version} + ${instantiationLevel_id}= Get Variable Value ${nfv.vnfd[0].df[0].instantiation-level[0].id} + DELETE Heal NSInstance log Trying to Delete an Heal NS instance. This method should not be implemented Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} diff --git a/SOL005/NSLifecycleManagement-API/descriptors/SOL001/vnf-b-1_VNF.yaml b/SOL005/NSLifecycleManagement-API/descriptors/SOL001/vnf-b-1_VNF.yaml index 1712e2b33317c38a21aecfaacf75bdecddb5ba7d..d9a374060f15a1857724ff859a0e25be8389f4f9 100644 --- a/SOL005/NSLifecycleManagement-API/descriptors/SOL001/vnf-b-1_VNF.yaml +++ b/SOL005/NSLifecycleManagement-API/descriptors/SOL001/vnf-b-1_VNF.yaml @@ -75,7 +75,7 @@ topology_template: virtual_link_left: virtual_binding: VDU-B-1 internal_vl: - type: tosca.nodes.nfv.VnfVirtualLink + type: "tosca.nodes.nfv.VnfVirtualLink" properties: connectivity_type: layer_protocols: [ ipv4 ] diff --git a/SOL005/NSLifecycleManagement-API/environment/variables.txt b/SOL005/NSLifecycleManagement-API/environment/variables.txt index 01df2b696b314d7c557bc924d7639c1a66167eb3..f13e6903c4acdacda7b97b3a53a3d59a36f0e91f 100644 --- a/SOL005/NSLifecycleManagement-API/environment/variables.txt +++ b/SOL005/NSLifecycleManagement-API/environment/variables.txt @@ -87,4 +87,7 @@ ${provider} ${product_name} ${software_version} ${descriptor_version} -${flavour_id} \ No newline at end of file +${flavour_id} + +${virtualLink_id} +${instantiationLevel_id} \ No newline at end of file diff --git a/SOL005/NSLifecycleManagement-API/jsons/UpdateNsRequest.json b/SOL005/NSLifecycleManagement-API/jsons/UpdateNsRequest.json index 336075de401be9e5b45d32555f44b27b3fa12fc0..756fa5756e5534024474dbb6b58003c73dd4fd3c 100644 --- a/SOL005/NSLifecycleManagement-API/jsons/UpdateNsRequest.json +++ b/SOL005/NSLifecycleManagement-API/jsons/UpdateNsRequest.json @@ -1,3 +1,15 @@ {{ - "updateType": "{vnfUpdateType}" + "updateType": "{vnfUpdateType}", + "instantiateVnfData": {{ + "vnfdId": "{vnfdId}", + "vnfFlavourId": "{vnfFlavourId}", + "vnfInstantiationLevelId": "{vnfInstantiationLevelId}" + "extManagedVirtualLinks": {{ + "vnfVirtualLinkDescId": "{vnfVirtualLinkDescId}" + }}, + "changeVnfFlavourData": {{ + "vnfInstanceId": {}, + "newFlavourId": "{newFlavourId}", + "instantiationLevelId": "{instantiationLevelId}" + }} }} \ No newline at end of file