diff options
author | Brian Freeman <bf1936@att.com> | 2019-12-05 16:21:20 -0500 |
---|---|---|
committer | Brian Freeman <bf1936@att.com> | 2019-12-06 12:02:01 -0500 |
commit | 026df1b5db881b1fa5af704fc1a8a6f16b1c664c (patch) | |
tree | ea46c736e5f25223c54b9ac08d899202745b628f /robot/resources/sdc_interface.robot | |
parent | 590721c5bdd9f00ed441e1ceba411d360bb41712 (diff) |
Reduce init duration
Return if service_name already exists
Issue-ID: INT-1397
Change-Id: I5d4da95501643d7fe21779e5f20aab26f05e873e
Signed-off-by: Brian Freeman <bf1936@att.com>
Diffstat (limited to 'robot/resources/sdc_interface.robot')
-rw-r--r-- | robot/resources/sdc_interface.robot | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/robot/resources/sdc_interface.robot b/robot/resources/sdc_interface.robot index 366e5f5e..25bd5167 100644 --- a/robot/resources/sdc_interface.robot +++ b/robot/resources/sdc_interface.robot @@ -73,10 +73,9 @@ ${SDC_BE_ONBOARD_ENDPOINT} ${GLOBAL_SDC_SERVER_PROTOCOL}://${GLOBAL_INJECTED Distribute Model From SDC [Documentation] Goes end to end creating all the SDC objects based ONAP model and distributing it to the systems. It then returns the service name, VF/PNF name and VF module name [Arguments] ${model_zip_path} ${catalog_service_name}= ${cds}=False ${service}= ${instantiationType}=A-la-carte ${resourceType}=VF - # For Testing use random service names - #${random}= Get Current Date - #${catalog_service_id}= Add SDC Catalog Service ${catalog_service_name}_${random} - ${catalog_service_id}= Add SDC Catalog Service ${catalog_service_name} ${instantiationType} + # add logic to handle service name already exists + ${status} ${catalog_service_id}= Run Keyword And Ignore Error Add SDC Catalog Service ${catalog_service_name} ${instantiationType} + Return From Keyword If '${status}' == 'FAIL' ${catalog_resource_ids}= Create List ${catalog_resources}= Create Dictionary ##### TODO: Support for Multiple resources of one type in a service ###### @@ -256,6 +255,7 @@ Create Allotted Resource Data File Download CSAR [Documentation] Download CSAR [Arguments] ${catalog_service_id} ${save_directory}=/tmp/csar + Return From Keyword If '${catalog_service_id}'=='None' # get meta data ${resp}= SDC.Run Get Request ${SDC_BE_ENDPOINT} ${SDC_CATALOG_SERVICES_PATH}/${catalog_service_id}/filteredDataByParams?include=toscaArtifacts ${SDC_DESIGNER_USER_ID} auth=${GLOBAL_SDC_AUTHENTICATION} ${csar_resource_id}= Set Variable ${resp.json()['toscaArtifacts']['assettoscacsar']['uniqueId']} @@ -811,6 +811,7 @@ Add SDC Catalog Service Templating.Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER} ${data}= Templating.Apply Template sdc ${SDC_CATALOG_SERVICE_TEMPLATE} ${map} ${resp}= SDC.Run Post Request ${SDC_BE_ENDPOINT} ${SDC_CATALOG_SERVICES_PATH} ${data} ${SDC_DESIGNER_USER_ID} auth=${GLOBAL_SDC_AUTHENTICATION} + Run Keyword If ('${resp.status_code}'=='409') Log ${\n} ${catalog_service_name} Service Already Exists console=yes Should Be Equal As Strings ${resp.status_code} 201 [Return] ${resp.json()['uniqueId']} |