blob: 785477587947c8cf5d4c9860159bf6850f2e8c43 [file] [log] [blame]
DR695Hccff30b2017-02-17 18:44:24 -05001*** Settings ***
2Documentation Create A&AI Customer API.
3...
4... Create A&AI Customer API
5
6Resource aai_interface.robot
7Resource ../json_templater.robot
8Library Collections
DR695Hccff30b2017-02-17 18:44:24 -05009
10
11*** Variables ***
Jerry Flood8a6b0b52017-11-12 15:44:21 -050012${INDEX PATH} /aai/v11
DR695Hccff30b2017-02-17 18:44:24 -050013${ROOT_CUSTOMER_PATH} /business/customers/customer/
14${SYSTEM USER} robot-ete
15${A&AI ADD CUSTOMER BODY} robot/assets/templates/aai/add_customer.template
16
Jerry Flood8a6b0b52017-11-12 15:44:21 -050017*** Keywords ***
DR695Hccff30b2017-02-17 18:44:24 -050018Create Customer
Jerry Flood8a6b0b52017-11-12 15:44:21 -050019 [Documentation] Creates a customer in A&AI
20 [Arguments] ${customer_name} ${customer_id} ${customer_type} ${service_type} ${clouder_owner} ${cloud_region_id} ${tenant_id}
Jerry Flood8a6b0b52017-11-12 15:44:21 -050021 ${arguments}= Create Dictionary subscriber_name=${customer_name} global_customer_id=${customer_id} subscriber_type=${customer_type} cloud_owner1=${clouder_owner} cloud_region_id1=${cloud_region_id} tenant_id1=${tenant_id} service1=${service_type}
DR695Hdaec16c2019-06-19 17:40:26 -040022 ${data}= Fill JSON Template File ${A&AI ADD CUSTOMER BODY} ${arguments}
DR695Hccff30b2017-02-17 18:44:24 -050023 ${put_resp}= Run A&AI Put Request ${INDEX PATH}${ROOT_CUSTOMER_PATH}${customer_id} ${data}
24 Should Be Equal As Strings ${put_resp.status_code} 201
25 [Return] ${put_resp.status_code}
26
Jerry Flood8a6b0b52017-11-12 15:44:21 -050027*** Keywords ***
DR695Hccff30b2017-02-17 18:44:24 -050028Delete Customer
Jerry Flood8a6b0b52017-11-12 15:44:21 -050029 [Documentation] Deletes a customer in A&AI
DR695Hccff30b2017-02-17 18:44:24 -050030 [Arguments] ${customer_id}
Jerry Flood8a6b0b52017-11-12 15:44:21 -050031 ${get_resp}= Run A&AI Get Request ${INDEX PATH}${ROOT_CUSTOMER_PATH}${customer_id}
DR695Hccff30b2017-02-17 18:44:24 -050032 Run Keyword If '${get_resp.status_code}' == '200' Delete Customer Exists ${customer_id} ${get_resp.json()['resource-version']}
Jerry Flood8a6b0b52017-11-12 15:44:21 -050033
34*** Keywords ***
DR695Hccff30b2017-02-17 18:44:24 -050035Delete Customer Exists
Jerry Flood8a6b0b52017-11-12 15:44:21 -050036 [Documentation] Deletes a customer in A&AI
37 [Arguments] ${customer_id} ${resource_version_id}
DR695Hccff30b2017-02-17 18:44:24 -050038 ${put_resp}= Run A&AI Delete Request ${INDEX PATH}${ROOT_CUSTOMER_PATH}${customer_id} ${resource_version_id}
Jerry Flood8a6b0b52017-11-12 15:44:21 -050039 Should Be Equal As Strings ${put_resp.status_code} 204