Release image version 1.12.2
[testsuite.git] / robot / resources / aai / network.robot
1 *** Settings ***
2 Documentation     Validate A&AI Serivce Instance
3
4 Resource          aai_interface.robot
5 Library    Collections
6 Library    ONAPLibrary.AAI    WITH NAME    AAI
7
8 *** Variables ***
9 ${INDEX_PATH}     /aai/v11
10 ${CUSTOMER_SPEC_PATH}    /business/customers/customer/
11 ${SERVICE_SUBSCRIPTIONS}    /service-subscriptions/service-subscription/
12 ${SERVICE_INSTANCE}    /service-instances?service-instance-name=
13
14 *** Keywords ***
15 Validate Network
16     [Documentation]    Query and Validates A&AI Service Instance
17     [Arguments]    ${service_instance_name}    ${service_type}  ${customer_id}
18         ${resp}=    AAI.Run Get Request      ${AAI_FRONTEND_ENDPOINT}    ${INDEX_PATH}${CUSTOMER_SPEC_PATH}${customer_id}${SERVICE_SUBSCRIPTIONS}${service_type}${SERVICE_INSTANCE}${service_instance_name}        auth=${GLOBAL_AAI_AUTHENTICATION}
19     Dictionary Should Contain Value     ${resp.json()['service-instance'][0]}    ${service_instance_name}
20
21 Create Network
22     [Documentation]    Query and Validates A&AI Service Instance
23     [Arguments]    ${customer_id}
24     ${json_string}=    Catenate     { "service-type": "VDNS" , "service-subscriptions":[{"service-instance-id":"instanceid123","service-instance-name":"VDNS"}]}
25         ${put_resp}=    AAI.Run Put Request     ${AAI_FRONTEND_ENDPOINT}    ${INDEX_PATH}${CUSTOMER_SPEC_PATH}${customer_id}${SERVICE_SUBSCRIPTIONS}/VDNS    ${json_string}        auth=${GLOBAL_AAI_AUTHENTICATION}
26     Should Be Equal As Strings  ${put_resp.status_code}         201
27         [Return]  ${put_resp.status_code}