DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Create A&AI Customer API. |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 3 | |
| 4 | Resource aai_interface.robot |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 5 | Library Collections |
DR695H | 3bb6cf4 | 2019-06-20 15:04:04 -0400 | [diff] [blame^] | 6 | Library ONAPLibrary.Templating |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 7 | |
| 8 | *** Variables *** |
Jerry Flood | 8a6b0b5 | 2017-11-12 15:44:21 -0500 | [diff] [blame] | 9 | ${INDEX PATH} /aai/v11 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 10 | ${ROOT_CUSTOMER_PATH} /business/customers/customer/ |
| 11 | ${SYSTEM USER} robot-ete |
DR695H | 3bb6cf4 | 2019-06-20 15:04:04 -0400 | [diff] [blame^] | 12 | ${A&AI ADD CUSTOMER BODY} aai/add_customer.jinja |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 13 | |
Jerry Flood | 8a6b0b5 | 2017-11-12 15:44:21 -0500 | [diff] [blame] | 14 | *** Keywords *** |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 15 | Create Customer |
Jerry Flood | 8a6b0b5 | 2017-11-12 15:44:21 -0500 | [diff] [blame] | 16 | [Documentation] Creates a customer in A&AI |
| 17 | [Arguments] ${customer_name} ${customer_id} ${customer_type} ${service_type} ${clouder_owner} ${cloud_region_id} ${tenant_id} |
Jerry Flood | 8a6b0b5 | 2017-11-12 15:44:21 -0500 | [diff] [blame] | 18 | ${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} |
DR695H | 3bb6cf4 | 2019-06-20 15:04:04 -0400 | [diff] [blame^] | 19 | Create Environment aai ${GLOBAL_TEMPLATE_FOLDER} |
| 20 | ${data}= Apply Template aai ${A&AI ADD CUSTOMER BODY} ${arguments} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 21 | ${put_resp}= Run A&AI Put Request ${INDEX PATH}${ROOT_CUSTOMER_PATH}${customer_id} ${data} |
| 22 | Should Be Equal As Strings ${put_resp.status_code} 201 |
| 23 | [Return] ${put_resp.status_code} |
| 24 | |
Jerry Flood | 8a6b0b5 | 2017-11-12 15:44:21 -0500 | [diff] [blame] | 25 | *** Keywords *** |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 26 | Delete Customer |
Jerry Flood | 8a6b0b5 | 2017-11-12 15:44:21 -0500 | [diff] [blame] | 27 | [Documentation] Deletes a customer in A&AI |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 28 | [Arguments] ${customer_id} |
Jerry Flood | 8a6b0b5 | 2017-11-12 15:44:21 -0500 | [diff] [blame] | 29 | ${get_resp}= Run A&AI Get Request ${INDEX PATH}${ROOT_CUSTOMER_PATH}${customer_id} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 30 | Run Keyword If '${get_resp.status_code}' == '200' Delete Customer Exists ${customer_id} ${get_resp.json()['resource-version']} |
Jerry Flood | 8a6b0b5 | 2017-11-12 15:44:21 -0500 | [diff] [blame] | 31 | |
| 32 | *** Keywords *** |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 33 | Delete Customer Exists |
Jerry Flood | 8a6b0b5 | 2017-11-12 15:44:21 -0500 | [diff] [blame] | 34 | [Documentation] Deletes a customer in A&AI |
| 35 | [Arguments] ${customer_id} ${resource_version_id} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 36 | ${put_resp}= Run A&AI Delete Request ${INDEX PATH}${ROOT_CUSTOMER_PATH}${customer_id} ${resource_version_id} |
Jerry Flood | 8a6b0b5 | 2017-11-12 15:44:21 -0500 | [diff] [blame] | 37 | Should Be Equal As Strings ${put_resp.status_code} 204 |