diff options
Diffstat (limited to 'robot/resources/aai')
-rw-r--r-- | robot/resources/aai/aai_interface.robot | 2 | ||||
-rw-r--r-- | robot/resources/aai/create_complex.robot | 71 | ||||
-rw-r--r-- | robot/resources/aai/create_customer.robot | 30 | ||||
-rw-r--r-- | robot/resources/aai/create_service.robot | 40 | ||||
-rw-r--r-- | robot/resources/aai/create_tenant.robot | 2 | ||||
-rw-r--r-- | robot/resources/aai/create_zone.robot | 2 | ||||
-rw-r--r-- | robot/resources/aai/network.robot | 25 | ||||
-rw-r--r-- | robot/resources/aai/service_instance.robot | 2 | ||||
-rw-r--r-- | robot/resources/aai/volume_group.robot | 13 |
9 files changed, 128 insertions, 59 deletions
diff --git a/robot/resources/aai/aai_interface.robot b/robot/resources/aai/aai_interface.robot index 790fa66f..b72103d0 100644 --- a/robot/resources/aai/aai_interface.robot +++ b/robot/resources/aai/aai_interface.robot @@ -7,7 +7,7 @@ Resource ../global_properties.robot *** Variables *** ${AAI_HEALTH_PATH} /aai/util/echo?action=long -${VERSIONED_INDEX_PATH} /aai/v8 +${VERSIONED_INDEX_PATH} /aai/v11 ${AAI_FRONTEND_ENDPOINT} ${GLOBAL_AAI_SERVER_PROTOCOL}://${GLOBAL_INJECTED_AAI1_IP_ADDR}:${GLOBAL_AAI_SERVER_PORT} diff --git a/robot/resources/aai/create_complex.robot b/robot/resources/aai/create_complex.robot new file mode 100644 index 00000000..e1cc2271 --- /dev/null +++ b/robot/resources/aai/create_complex.robot @@ -0,0 +1,71 @@ +*** Settings *** +Documentation Create A&AI Customer API. +... +... Create A&AI Customer API + +Resource ../json_templater.robot +Resource aai_interface.robot +Library OperatingSystem +Library Collections + + + +*** Variables *** +${COMPLEX_INDEX_PATH} /aai/v11 +${ROOT_COMPLEXES_PATH} /cloud-infrastructure/complexes +${ROOT_COMPLEX_PATH} /cloud-infrastructure/complexes/complex + +${SYSTEM USER} robot-ete +${AAI_ADD_COMPLEX_BODY}= robot/assets/templates/aai/add_complex_body.template + +*** Keywords *** +Inventory Complex If Not Exists + [Documentation] Creates a service in A&AI if it doesn't exist + [Arguments] ${complex_name} ${physical_location_id} ${cloud_owner} ${region} ${owner_defined_type} + ${get_resp}= Run A&AI Get Request ${COMPLEX_INDEX_PATH}${ROOT_COMPLEX_PATH}/${physical_location_id} + Return From Keyword If '${get_resp.status_code}' == '200' + Inventory Complex ${complex_name} ${physical_location_id} ${cloud_owner} ${region} ${owner_defined_type} + +Inventory Complex + [Documentation] Inventorys a COmplex in A&AI + [Arguments] ${complex_name} ${physical_location_id} ${cloud_owner} ${region} ${owner_defined_type} + ${arguments}= Create Dictionary complex_name=${complex_name} + Set To Dictionary ${arguments} physical_location_id=${physical_location_id} + Set To Dictionary ${arguments} cloud_owner=${cloud_owner} + Set To Dictionary ${arguments} region=${region} + Set To Dictionary ${arguments} owner_defined_type=${owner_defined_type} + ${data}= Fill JSON Template File ${AAI_ADD_COMPLEX_BODY} ${arguments} + ${put_resp}= Run A&AI Put Request ${COMPLEX_INDEX_PATH}${ROOT_COMPLEX_PATH}/${physical_location_id} ${data} + ${status_string}= Convert To String ${put_resp.status_code} + Should Match Regexp ${status_string} ^(201|200)$ + +Delete Complex If Exists + [Documentation] Removes a complex + [Arguments] ${physical_location_id} + ${get_resp}= Run A&AI Get Request ${COMPLEX_INDEX_PATH}${ROOT_COMPLEX_PATH}/${physical_location_id} + Run Keyword If '${get_resp.status_code}' == '200' Delete Zone Exists ${physical_location_id} ${get_resp.json()} + +Delete Complex + [Arguments] ${physical_location_id} ${json} + ${resource_version}= Catenate ${json['resource-version']} + ${put_resp}= Run A&AI Delete Request ${COMPLEX_INDEX_PATH}${ROOT_COMPLEX_PATH}/${physical_location_id} ${resource_version} + Should Be Equal As Strings ${put_resp.status_code} 204 + +Get Complex + [Documentation] Return a complex + [Arguments] ${physical_location_id} + ${resp}= Run A&AI Get Request ${COMPLEX_INDEX_PATH}${ROOT_COMPLEX_PATH}/${physical_location_id} + Should Be Equal As Strings ${resp.status_code} 200 + [Return] ${resp.json()} + +Get Complexes + [Documentation] Return all complexes + [Arguments] + ${resp}= Run A&AI Get Request ${COMPLEX_INDEX_PATH}${ROOT_COMPLEXES_PATH} + Should Be Equal As Strings ${resp.status_code} 200 + Log ${resp.json()} + [Return] ${resp.json()} + + + + diff --git a/robot/resources/aai/create_customer.robot b/robot/resources/aai/create_customer.robot index 7ebda39d..fec58843 100644 --- a/robot/resources/aai/create_customer.robot +++ b/robot/resources/aai/create_customer.robot @@ -10,32 +10,32 @@ Library OperatingSystem *** Variables *** -${INDEX PATH} /aai/v8 +${INDEX PATH} /aai/v11 ${ROOT_CUSTOMER_PATH} /business/customers/customer/ ${SYSTEM USER} robot-ete ${A&AI ADD CUSTOMER BODY} robot/assets/templates/aai/add_customer.template -*** Keywords *** +*** Keywords *** Create Customer - [Documentation] Creates a customer in A&AI - [Arguments] ${customer_name} ${customer_id} ${customer_type} ${service_type} ${clouder_owner} ${cloud_region_id} ${tenant_id} - ${data_template}= OperatingSystem.Get File ${A&AI ADD CUSTOMER BODY} - ${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} - ${data}= Fill JSON Template ${data_template} ${arguments} + [Documentation] Creates a customer in A&AI + [Arguments] ${customer_name} ${customer_id} ${customer_type} ${service_type} ${clouder_owner} ${cloud_region_id} ${tenant_id} + ${data_template}= OperatingSystem.Get File ${A&AI ADD CUSTOMER BODY} + ${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} + ${data}= Fill JSON Template ${data_template} ${arguments} ${put_resp}= Run A&AI Put Request ${INDEX PATH}${ROOT_CUSTOMER_PATH}${customer_id} ${data} Should Be Equal As Strings ${put_resp.status_code} 201 [Return] ${put_resp.status_code} -*** Keywords *** +*** Keywords *** Delete Customer - [Documentation] Deletes a customer in A&AI + [Documentation] Deletes a customer in A&AI [Arguments] ${customer_id} - ${get_resp}= Run A&AI Get Request ${INDEX PATH}${ROOT_CUSTOMER_PATH}${customer_id} + ${get_resp}= Run A&AI Get Request ${INDEX PATH}${ROOT_CUSTOMER_PATH}${customer_id} Run Keyword If '${get_resp.status_code}' == '200' Delete Customer Exists ${customer_id} ${get_resp.json()['resource-version']} - -*** Keywords *** + +*** Keywords *** Delete Customer Exists - [Documentation] Deletes a customer in A&AI - [Arguments] ${customer_id} ${resource_version_id} + [Documentation] Deletes a customer in A&AI + [Arguments] ${customer_id} ${resource_version_id} ${put_resp}= Run A&AI Delete Request ${INDEX PATH}${ROOT_CUSTOMER_PATH}${customer_id} ${resource_version_id} - Should Be Equal As Strings ${put_resp.status_code} 204 + Should Be Equal As Strings ${put_resp.status_code} 204 diff --git a/robot/resources/aai/create_service.robot b/robot/resources/aai/create_service.robot index 38aef3f6..bcf14e3d 100644 --- a/robot/resources/aai/create_service.robot +++ b/robot/resources/aai/create_service.robot @@ -12,56 +12,56 @@ Library UUID *** Variables *** -${INDEX PATH} /aai/v8 +${INDEX PATH} /aai/v11 ${ROOT_SERVICE_PATH} /service-design-and-creation/services ${SYSTEM USER} robot-ete ${AAI_ADD_SERVICE_BODY}= robot/assets/templates/aai/add_service_body.template -*** Keywords *** +*** Keywords *** Create Service If Not Exists - [Documentation] Creates a service in A&AI if it doesn't exist + [Documentation] Creates a service in A&AI if it doesn't exist [Arguments] ${service_type} ${dict}= Get Services - ${status} ${value}= Run Keyword And Ignore Error Dictionary Should Contain Key ${dict} ${service_type} + ${status} ${value}= Run Keyword And Ignore Error Dictionary Should Contain Key ${dict} ${service_type} Run Keyword If '${status}' == 'FAIL' Create Service ${service_type} - + Create Service - [Documentation] Creates a service in A&AI + [Documentation] Creates a service in A&AI [Arguments] ${service_type} - ${uuid}= Generate UUID - ${data_template}= OperatingSystem.Get File ${AAI_ADD_SERVICE_BODY} - ${arguments}= Create Dictionary service_type=${service_type} UUID=${uuid} + ${uuid}= Generate UUID + ${data_template}= OperatingSystem.Get File ${AAI_ADD_SERVICE_BODY} + ${arguments}= Create Dictionary service_type=${service_type} UUID=${uuid} ${data}= Fill JSON Template ${data_template} ${arguments} ${fullpath}= Catenate ${INDEX PATH}${ROOT_SERVICE_PATH}/service/${uuid} ${put_resp}= Run A&AI Put Request ${fullpath} ${data} Should Be Equal As Strings ${put_resp.status_code} 201 [Return] ${put_resp.status_code} - + Delete Service If Exists - [Documentation] Deletes a service in A&AI if it exists + [Documentation] Deletes a service in A&AI if it exists [Arguments] ${service_type} ${dict}= Get Services - ${status} ${value}= Run Keyword And Ignore Error Dictionary Should Contain Key ${dict} ${service_type} + ${status} ${value}= Run Keyword And Ignore Error Dictionary Should Contain Key ${dict} ${service_type} Run Keyword If '${status}' == 'PASS' Delete Service ${dict['${service_type}']} Delete Service - [Documentation] Delete passed service in A&AI + [Documentation] Delete passed service in A&AI [Arguments] ${dict} - ${uuid}= Get From Dictionary ${dict} service-id + ${uuid}= Get From Dictionary ${dict} service-id ${resource_version}= Get From Dictionary ${dict} resource-version ${fullpath}= Catenate ${INDEX PATH}${ROOT_SERVICE_PATH}/service/${uuid} - ${resp}= Run A&AI Delete Request ${fullpath} ${resource_version} + ${resp}= Run A&AI Delete Request ${fullpath} ${resource_version} Should Be Equal As Strings ${resp.status_code} 204 - + Get Services - [Documentation] Creates a service in A&AI + [Documentation] Creates a service in A&AI ${resp}= Run A&AI Get Request ${INDEX PATH}${ROOT_SERVICE_PATH} - ${dict}= Create Dictionary + ${dict}= Create Dictionary ${status} ${value}= Run Keyword And Ignore Error Should Be Equal As Strings ${resp.status_code} 200 - Run Keyword If '${status}' == 'PASS' Update Service Dictionary ${dict} ${resp.json()} + Run Keyword If '${status}' == 'PASS' Update Service Dictionary ${dict} ${resp.json()} [Return] ${dict} Update Service Dictionary @@ -69,7 +69,7 @@ Update Service Dictionary ${list}= Evaluate ${json}['service'] :for ${map} in @{list} \ ${status} ${service_type}= Run Keyword And Ignore Error Get From Dictionary ${map} service-description - \ Run Keyword If '${status}' == 'PASS' Set To Dictionary ${dict} ${service_type}=${map} + \ Run Keyword If '${status}' == 'PASS' Set To Dictionary ${dict} ${service_type}=${map} Log ${dict} diff --git a/robot/resources/aai/create_tenant.robot b/robot/resources/aai/create_tenant.robot index 756882e7..95f1c25a 100644 --- a/robot/resources/aai/create_tenant.robot +++ b/robot/resources/aai/create_tenant.robot @@ -11,7 +11,7 @@ Library Collections *** Variables *** -${INDEX PATH} /aai/v8 +${INDEX PATH} /aai/v11 ${ROOT_TENANT_PATH} /cloud-infrastructure/cloud-regions/cloud-region/ ${SYSTEM USER} robot-ete diff --git a/robot/resources/aai/create_zone.robot b/robot/resources/aai/create_zone.robot index 995db3ee..09d6ea6e 100644 --- a/robot/resources/aai/create_zone.robot +++ b/robot/resources/aai/create_zone.robot @@ -48,7 +48,7 @@ Delete Zone Exists Get Zone [Documentation] Return zone - [Arguments] ${zone_id} + [Arguments] ${zone_id} ${resp}= Run A&AI Get Request ${ZONE_INDEX_PATH}${ROOT_ZONE_PATH}/${zone_id} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} diff --git a/robot/resources/aai/network.robot b/robot/resources/aai/network.robot index a42461e2..6bda4e27 100644 --- a/robot/resources/aai/network.robot +++ b/robot/resources/aai/network.robot @@ -13,30 +13,29 @@ Library HttpLibrary.HTTP Resource ../json_templater.robot *** Variables *** -${INDEX PATH} /aai/v8 +${INDEX PATH} /aai/v11 ${GENERIC_QUERY_PATH} /search/generic-query? ${SYSTEM USER} robot-ete ${CUSTOMER SPEC PATH} /business/customers/customer/ ${SERVICE SUBSCRIPTIONS} /service-subscriptions/service-subscription/ ${SERVICE INSTANCE} /service-instances?service-instance-name= -${SERVCE INSTANCE TEMPLATE} robot/assets/templates/aai/service_subscription.template +${SERVCE INSTANCE TEMPLATE} robot/assets/templates/aai/service_subscription.template -*** Keywords *** +*** Keywords *** Validate Network - [Documentation] Query and Validates A&AI Service Instance - [Arguments] ${service_instance_name} ${service_type} ${customer_id} + [Documentation] Query and Validates A&AI Service Instance + [Arguments] ${service_instance_name} ${service_type} ${customer_id} ${resp}= Run A&AI Get Request ${INDEX PATH}${CUSTOMER SPEC PATH}${CUSTOMER ID}${SERVICE SUBSCRIPTIONS}${service_type}${SERVICE INSTANCE}${service_instance_name} Dictionary Should Contain Value ${resp.json()['service-instance'][0]} ${service_instance_name} - - -*** Keywords *** + + +*** Keywords *** Create Network - [Documentation] Query and Validates A&AI Service Instance - [Arguments] ${CUSTOMER ID} + [Documentation] Query and Validates A&AI Service Instance + [Arguments] ${CUSTOMER ID} ${json_string}= Catenate { "service-type": "VDNS" , "service-subscriptions":[{"service-instance-id":"instanceid123","service-instance-name":"VDNS"}]} ${put_resp}= Run A&AI Put Request ${INDEX PATH}${CUSTOMER SPEC PATH}${CUSTOMER ID}${SERVICE SUBSCRIPTIONS}/VDNS ${json_string} Should Be Equal As Strings ${put_resp.status_code} 201 - [Return] ${put_resp.status_code} - -
\ No newline at end of file + [Return] ${put_resp.status_code} + diff --git a/robot/resources/aai/service_instance.robot b/robot/resources/aai/service_instance.robot index f2cf7d80..34ab1eab 100644 --- a/robot/resources/aai/service_instance.robot +++ b/robot/resources/aai/service_instance.robot @@ -17,7 +17,7 @@ Resource ../stack_validation/validate_vvg.robot Resource ../aai/aai_interface.robot *** Variables *** -${INDEX PATH} /aai/v8 +${INDEX PATH} /aai/v11 ${GENERIC_QUERY_PATH} /search/generic-query? ${SYSTEM USER} robot-ete ${CUSTOMER SPEC PATH} /business/customers/customer/ diff --git a/robot/resources/aai/volume_group.robot b/robot/resources/aai/volume_group.robot index 95822011..40674a5e 100644 --- a/robot/resources/aai/volume_group.robot +++ b/robot/resources/aai/volume_group.robot @@ -13,19 +13,18 @@ Library HttpLibrary.HTTP Resource ../json_templater.robot *** Variables *** -${INDEX PATH} /aai/v8 +${INDEX PATH} /aai/v11 ${GENERIC_QUERY_PATH} /search/generic-query? ${SYSTEM USER} robot-ete ${CUSTOMER SPEC PATH} /business/customers/customer/ ${SERVICE SUBSCRIPTIONS} /service-subscriptions/service-subscription/ ${SERVICE INSTANCE} /service-instances?service-instance-name= -${SERVCE INSTANCE TEMPLATE} robot/assets/templates/aai/service_subscription.template +${SERVCE INSTANCE TEMPLATE} robot/assets/templates/aai/service_subscription.template -*** Keywords *** -Validate Volume Group - [Arguments] ${service_instance_name} ${service_type} ${customer_id} +*** Keywords *** +Validate Volume Group + [Arguments] ${service_instance_name} ${service_type} ${customer_id} ${resp}= Run A&AI Get Request ${INDEX PATH}${CUSTOMER SPEC PATH}${CUSTOMER ID}${SERVICE SUBSCRIPTIONS}${service_type}${SERVICE INSTANCE}${service_instance_name} Dictionary Should Contain Value ${resp.json()['service-instance'][0]} ${service_instance_name} - -
\ No newline at end of file + |