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
8 Resource ../asdc_interface.robot
10 Variables ../../assets/service_mappings.py
13 ${ASDC_BASE_PATH} /sdc1
14 ${ASDC_DESIGNER_PATH} /proxy-designer1#/dashboard
15 ${ASDC_ASSETS_DIRECTORY} ${GLOBAL_HEAT_TEMPLATES_FOLDER}
16 ${ASDC_ZIP_DIRECTORY} ${ASDC_ASSETS_DIRECTORY}/temp
18 #***************** Test Case Variables *********************
19 ${CATALOG_RESOURCE_IDS}
24 Model Distribution For Directory
25 [Arguments] ${service} ${catalog_service_name}= ${cds}=
26 ${directory_list}= Get From Dictionary ${GLOBAL_SERVICE_FOLDER_MAPPING} ${service}
27 ${ziplist}= Create List
28 ${uuid}= Get Current Date
29 ${service_name}= Catenate ${service} ${uuid}
30 ${shortened_uuid}= Evaluate str("${service_name}")[:23]
31 ${catalog_service_name}= Set Variable If '${catalog_service_name}' =='' ${shortened_uuid} ${catalog_service_name}
32 :FOR ${directory} IN @{directory_list}
33 \ ${zipname}= Replace String ${directory} / _
34 \ ${zip}= Catenate ${ASDC_ZIP_DIRECTORY}/${zipname}.zip
35 \ ${folder}= Catenate ${ASDC_ASSETS_DIRECTORY}/${directory}
36 \ OperatingSystem.Create Directory ${ASDC_ASSETS_DIRECTORY}/temp
37 \ Create Zip From Files In Directory ${folder} ${zip}
38 \ Append To List ${ziplist} ${zip}
39 ${catalog_service_name} ${catalog_resource_name} ${vf_modules} ${catalog_resource_ids} ${catalog_service_id} ${catalog_resources} Distribute Model From ASDC ${ziplist} ${catalog_service_name} ${cds} ${service}
40 Set Test Variable ${CATALOG_RESOURCE_IDS} ${catalog_resource_ids}
41 Set Test Variable ${CATALOG_SERVICE_ID} ${catalog_service_id}
42 Set Test Variable ${CATALOG_RESOURCES} ${catalog_resources}
43 Download CSAR ${catalog_service_id}
44 [Return] ${catalog_service_name} ${catalog_resource_name} ${vf_modules} ${catalog_resources}
49 Teardown Model Distribution
50 [Documentation] Clean up at the end of the test
51 Log ${CATALOG_SERVICE_ID} ${CATALOG_RESOURCE_IDS}
52 Teardown Models ${CATALOG_SERVICE_ID} ${CATALOG_RESOURCE_IDS}
55 [Documentation] Clean up at the end of the test
56 [Arguments] ${catalog_service_id} ${catalog_resource_ids}
57 Return From Keyword If '${catalog_service_id}' == ''
58 :FOR ${catalog_resource_id} IN @{catalog_resource_ids}
59 \ ${resourece_json}= Mark ASDC Catalog Resource Inactive ${catalog_resource_id}
60 ${service_json}= Mark ASDC Catalog Service Inactive ${catalog_service_id}
61 ${services_json}= Delete Inactive ASDC Catalog Services
62 ${resources_json}= Delete Inactive ASDC Catalog Resources