diff --git a/SOL002/VNFLifecycleManagement-API/VnfLcmOperationKeywords.robot b/SOL002/VNFLifecycleManagement-API/VnfLcmOperationKeywords.robot index 89da192369487113c4e963dfb4196fc33aaeef62..421a8d71cc0a15d931d2a003b8d12ddd2623e9ae 100644 --- a/SOL002/VNFLifecycleManagement-API/VnfLcmOperationKeywords.robot +++ b/SOL002/VNFLifecycleManagement-API/VnfLcmOperationKeywords.robot @@ -80,15 +80,9 @@ POST Create a new vnfInstance Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Set Headers {"Authorization":"${AUTHORIZATION}"} - 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} + Run Keyword If ${check_descriptors} == 1 Add VNF Descriptor Content to VNF Instance Post ${template} = Get File jsons/createVnfRequest.json - ${body}= Format String ${template} vnfdId=${descriptor_id} vnfProvider=${provider} vnfProductName=${product_name} vnfSoftwareVersion=${software_version} vnfdVersion= ${descriptor_version} flavourId=${flavour_id} + ${body}= Format String ${template} vnfdId=${descriptor_id} vnfProvider=${provider} vnfProductName=${product_name} vnfSoftwareVersion=${software_version} vnfdVersion= ${descriptor_version} Post ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_instances ${body} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} @@ -1057,7 +1051,6 @@ Parse SOL001 Should Be Equal As Strings ${response['body']['instantiatedVnfInfo']['flavourId']} ${flavour_id} Parse SOL006 - #Log SOL006 code ${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} @@ -1070,3 +1063,20 @@ Parse SOL006 Should Be Equal As Strings ${response['body']['vnfSoftwareVesion']} ${software_version} Should Be Equal As Strings ${response['body']['vnfdVersion']} ${descriptor_version} +Add VNF Descriptor Content to VNF Instance Post + Run Keyword If '${descriptorType}'=='SOL001' Parse SOL001 VNF Instance ELSE Parse SOL006 VNF Instance + +Parse SOL001 VNF 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} + +Parse SOL006 VNF 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} \ No newline at end of file diff --git a/SOL002/VNFLifecycleManagement-API/environment/variables.txt b/SOL002/VNFLifecycleManagement-API/environment/variables.txt index af7f6a479cbce7ca9870f594d38e73ce71d1f4bd..f0679b13bc05f6cce6f293c1b63ed80f0fd67f1d 100644 --- a/SOL002/VNFLifecycleManagement-API/environment/variables.txt +++ b/SOL002/VNFLifecycleManagement-API/environment/variables.txt @@ -81,4 +81,11 @@ ${callbackResp} localhost ${descriptorType} SOL001 ${vnfKey} {} -${check_descriptors} 1 \ No newline at end of file +${check_descriptors} 1 + +${descriptor_id} +${provider} +${product_name} +${software_version} +${descriptor_version} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_instances ${body} \ No newline at end of file