Brian Freeman | adaa237 | 2018-10-24 12:25:22 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Create Cloud Config |
| 3 | |
| 4 | Resource ../json_templater.robot |
| 5 | Resource ../so_interface.robot |
| 6 | Library OperatingSystem |
| 7 | Library Collections |
| 8 | |
| 9 | |
| 10 | *** Variables *** |
| 11 | ${CLOUD_CONFIG_PATH} /cloudSite |
| 12 | |
| 13 | ${SYSTEM USER} robot-ete |
| 14 | ${SO_ADD_CLOUD_CONFIG}= robot/assets/templates/so/create_cloud_config.template |
Brian Freeman | 0789aef | 2019-04-15 16:57:18 -0500 | [diff] [blame] | 15 | ${SO_ADD_CLOUD_CONFIG_V3}= robot/assets/templates/so/cloud_config_v3.template |
Brian Freeman | adaa237 | 2018-10-24 12:25:22 -0500 | [diff] [blame] | 16 | |
| 17 | *** Keywords *** |
| 18 | Create Cloud Configuration |
| 19 | [Documentation] Creates a cloud configuration in SO, so it knows how to talk to an openstack cloud |
| 20 | [Arguments] ${site_name} ${region_id} ${clli} ${identity_id} ${identity_url} ${mso_id} ${mso_pass} ${admin_tenant} ${member_role} ${identity_server_type} ${authentication_type} |
| 21 | ${arguments}= Create Dictionary site_name=${site_name} region_id=${region_id} clli=${clli} identity_id=${identity_id} identity_url=${identity_url} mso_id=${mso_id} mso_pass=${mso_pass} admin_tenant=${admin_tenant} member_role=${member_role} identity_server_type=${identity_server_type} authentication_type=${authentication_type} |
| 22 | ${data}= Fill JSON Template File ${SO_ADD_CLOUD_CONFIG} ${arguments} |
| 23 | ${get_resp}= Run SO Catalog Post request ${CLOUD_CONFIG_PATH}/${site_name} ${data} |
| 24 | |
| 25 | ${get_resp}= Run Keyword If '${get_resp.status_code}'=='404' Update Cloud Configuration ${site_name} ${region_id} ${clli} ${identity_id} ${identity_url} ${mso_id} ${mso_pass} ${admin_tenant} ${member_role} ${identity_server_type} ${authentication_type} |
| 26 | Should Be Equal As Strings ${get_resp.status_code} 200 |
| 27 | |
Brian Freeman | 0789aef | 2019-04-15 16:57:18 -0500 | [diff] [blame] | 28 | |
| 29 | Create Cloud Configuration v3 |
| 30 | [Documentation] Creates a cloud configuration in SO, so it knows how to talk to an openstack cloud |
| 31 | [Arguments] ${site_name} ${region_id} ${clli} ${identity_id} ${identity_url} ${mso_id} ${mso_pass} ${admin_tenant} ${member_role} ${identity_server_type} ${authentication_type} ${project_domain_name} ${user_domain_Name} |
| 32 | ${arguments}= Create Dictionary site_name=${site_name} region_id=${region_id} clli=${clli} identity_id=${identity_id} identity_url=${identity_url} mso_id=${mso_id} mso_pass=${mso_pass} admin_tenant=${admin_tenant} member_role=${member_role} identity_server_type=${identity_server_type} authentication_type=${authentication_type} project_domain_name=${project_domain_name} user_domain_name=${user_domain_name} |
| 33 | Log ${arguments} |
| 34 | ${data}= Fill JSON Template File ${SO_ADD_CLOUD_CONFIG_V3} ${arguments} |
| 35 | ${get_resp}= Run SO Catalog Post request ${CLOUD_CONFIG_PATH} ${data} |
| 36 | ${status_string}= Convert To String ${get_resp.status_code} |
| 37 | Should Match Regexp ${status_string} ^(201|200)$ |
| 38 | |
Brian Freeman | adaa237 | 2018-10-24 12:25:22 -0500 | [diff] [blame] | 39 | Update Cloud Configuration |
| 40 | [Documentation] Updates a cloud configuration in SO |
| 41 | [Arguments] ${site_name} ${region_id} ${clli} ${identity_id} ${identity_url} ${mso_id} ${mso_pass} ${admin_tenant} ${member_role} ${identity_server_type} ${authentication_type} |
| 42 | ${arguments}= Create Dictionary site_name=${site_name} region_id=${region_id} clli=${clli} identity_id=${identity_id} identity_url=${identity_url} mso_id=${mso_id} mso_pass=${mso_pass} admin_tenant=${admin_tenant} member_role=${member_role} identity_server_type=${identity_server_type} authentication_type=${authentication_type} |
| 43 | ${data}= Fill JSON Template File ${SO_ADD_CLOUD_CONFIG} ${arguments} |
| 44 | ${get_resp}= Run SO Catalog Put request ${CLOUD_CONFIG_PATH}/${site_name} ${data} |
| 45 | Should Be Equal As Strings ${get_resp.status_code} 200 |
| 46 | [Return] ${get_resp} |
| 47 | |
| 48 | Get Cloud Configuration |
| 49 | [Documentation] Gets cloud configuration in SO |
| 50 | [Arguments] ${site_name} |
| 51 | ${get_resp}= Run MSO Catalog Get request ${CLOUD_CONFIG_PATH}/${site_name} |
| 52 | Should Be Equal As Strings ${get_resp.status_code} 200 |
| 53 | |
| 54 | |