blob: 8762d4151f3a4e4f9f092f2f5f248eeaf3e51f3d [file] [log] [blame]
Brian Freemanadaa2372018-10-24 12:25:22 -05001*** Settings ***
2Documentation Create Cloud Config
3
4Resource ../json_templater.robot
5Resource ../so_interface.robot
6Library OperatingSystem
7Library 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 Freeman0789aef2019-04-15 16:57:18 -050015${SO_ADD_CLOUD_CONFIG_V3}= robot/assets/templates/so/cloud_config_v3.template
Brian Freemanadaa2372018-10-24 12:25:22 -050016
17*** Keywords ***
18Create 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 Freeman0789aef2019-04-15 16:57:18 -050028
29Create 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 Freemanadaa2372018-10-24 12:25:22 -050039Update 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
48Get 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