DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation The main interface for interacting with ASDC. It handles low level stuff like managing the http request library and DCAE required fields |
| 3 | Library OperatingSystem |
| 4 | Library ArchiveLibrary |
| 5 | Library Collections |
| 6 | Resource ../asdc_interface.robot |
| 7 | |
| 8 | Variables ../../assets/service_mappings.py |
| 9 | |
| 10 | *** Variables *** |
| 11 | ${ASDC_BASE_PATH} /sdc1 |
| 12 | ${ASDC_DESIGNER_PATH} /proxy-designer1#/dashboard |
| 13 | ${ASDC_ASSETS_DIRECTORY} robot/assets/asdc |
| 14 | ${VFW_DIRECTORY} base_vfw |
| 15 | ${VLB_DIRECTORY} base_vlb |
| 16 | ${VVG_DIRECTORY} base_vvg |
| 17 | ${SCALING_DIRECTORY} dns_scaling |
| 18 | ${ASDC_ZIP_DIRECTORY} ${ASDC_ASSETS_DIRECTORY}/temp |
| 19 | |
| 20 | ${CATALOG_RESOURCE_IDS} |
| 21 | ${CATALOG_SERVICE_ID} |
| 22 | |
| 23 | *** Keywords *** |
| 24 | |
| 25 | Model Distribution For Directory |
| 26 | [Arguments] ${service} |
| 27 | ${directory_list}= Get From Dictionary ${GLOBAL_SERVICE_FOLDER_MAPPING} ${service} |
| 28 | ${ziplist}= Create List |
| 29 | :for ${directory} in @{directory_list} |
| 30 | \ ${zip}= Catenate ${ASDC_ZIP_DIRECTORY}/${directory}.zip |
| 31 | \ ${folder}= Catenate ${ASDC_ASSETS_DIRECTORY}/${directory} |
| 32 | \ OperatingSystem.Create Directory ${ASDC_ASSETS_DIRECTORY}/temp |
| 33 | \ Create Zip From Files In Directory ${folder} ${zip} |
| 34 | \ Append To List ${ziplist} ${zip} |
| 35 | ${catalog_service_name} ${catalog_resource_name} ${vf_modules} ${catalog_resource_ids} ${catalog_service_id} Distribute Model From ASDC ${ziplist} |
| 36 | Set Test Variable ${CATALOG_RESOURCE_IDS} ${catalog_resource_ids} |
| 37 | Set Test Variable ${CATALOG_SERVICE_ID} ${catalog_service_id} |
| 38 | [Return] ${catalog_service_name} ${catalog_resource_name} ${vf_modules} |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | Teardown Model Distribution |
| 44 | [Documentation] Clean up at the end of the test |
| 45 | Log ${CATALOG_SERVICE_ID} ${CATALOG_RESOURCE_IDS} |
| 46 | Teardown Models ${CATALOG_SERVICE_ID} ${CATALOG_RESOURCE_IDS} |
| 47 | |
| 48 | Teardown Models |
| 49 | [Documentation] Clean up at the end of the test |
| 50 | [Arguments] ${catalog_service_id} ${catalog_resource_ids} |
| 51 | Return From Keyword If '${catalog_service_id}' == '' |
| 52 | :for ${catalog_resource_id} in @{catalog_resource_ids} |
| 53 | \ ${resourece_json}= Mark ASDC Catalog Resource Inactive ${catalog_resource_id} |
| 54 | ${service_json}= Mark ASDC Catalog Service Inactive ${catalog_service_id} |
| 55 | ${services_json}= Delete Inactive ASDC Catalog Services |
| 56 | ${resources_json}= Delete Inactive ASDC Catalog Resources |
| 57 | |