2 Library OperatingSystem
3 Library RequestsLibrary
8 ${GENERICVNFKEYVALUE} generic-vnf-integration-test1
9 ${PSERVERKEYVALUE} pserver-integration-test1
10 ${GENERICVNFURL} https://${HOST_IP}:8443/aai/v11/network/generic-vnfs/generic-vnf/${GENERICVNFKEYVALUE}
11 ${PSERVERURL} https://${HOST_IP}:8443/aai/v11/cloud-infrastructure/pservers/pserver/${PSERVERKEYVALUE}
12 ${RELATIONSHIPURL} https://${HOST_IP}:8443/aai/v11/network/generic-vnfs/generic-vnf/${GENERICVNFKEYVALUE}/relationship-list/relationship
13 ${CUSTOMQUERYURL} https://${HOST_IP}:8443/aai/v11/query?format=simple
14 ${CUSTOMQUERYURL_GRAPHSON} https://${HOST_IP}:8443/aai/v11/query?format=graphson
15 ${CUSTOMQUERYURL_ID} https://${HOST_IP}:8443/aai/v11/query?format=id
16 ${CUSTOMQUERYURL_PATHED} https://${HOST_IP}:8443/aai/v11/query?format=pathed
17 ${CUSTOMQUERYURL_RESOURCE} https://${HOST_IP}:8443/aai/v11/query?format=resource
18 ${CUSTOMQUERYURL_RESOURCE_URL} https://${HOST_IP}:8443/aai/v11/query?format=resource_and_url
19 ${CUSTOMQUERYURL_RAW} https://${HOST_IP}:8443/aai/v11/query?format=raw
20 ${GENERICVNFDATA} {"vnf-id":"${GENERICVNFKEYVALUE}","vnf-name":"example-vnf-name-val-51663","vnf-name2":"example-vnf-name2-val-15450","vnf-type":"example-vnf-type-val-32726"}
21 ${PSERVERDATA} { "hostname": "${PSERVERKEYVALUE}", "ptnii-equip-name": "example-ptnii-equip-name-val-91724", "number-of-cpus": 56461, "disk-in-gigabytes": 13534, "ram-in-megabytes": 66589, "equip-type": "example-equip-type-val-94149", "equip-vendor": "example-equip-vendor-val-91811", "equip-model": "example-equip-model-val-26157", "fqdn": "example-fqdn-val-19743", "pserver-selflink": "example-pserver-selflink-val-67676", "ipv4-oam-address": "example-ipv4-oam-address-val-12819", "serial-number": "example-serial-number-val-33384", "ipaddress-v4-loopback-0": "example-ipaddress-v4-loopback0-val-63311", "ipaddress-v6-loopback-0": "example-ipaddress-v6-loopback0-val-70485", "ipaddress-v4-aim": "example-ipaddress-v4-aim-val-23497", "ipaddress-v6-aim": "example-ipaddress-v6-aim-val-24473", "ipaddress-v6-oam": "example-ipaddress-v6-oam-val-38196", "inv-status": "example-inv-status-val-10016", "pserver-id": "example-pserver-id-val-90123", "internet-topology": "example-internet-topology-val-17042", "in-maint": true, "pserver-name2": "example-pserver-name2-val-12304", "purpose": "example-purpose-val-86719", "prov-status": "example-prov-status-val-68126", "management-option": "example-management-option-val-86521", "host-profile": "example-host-profile-val-48679" }
22 ${CUSTOMQUERYDATA} {"gremlin":"g.V().has(\\'hostname\\', \\'${PSERVERKEYVALUE}\\')"}
23 ${PSERVER_GENERIC_VNF_RELATIONSHIPDATA} {"related-to":"pserver","relationship-data":[{"relationship-key":"pserver.hostname","relationship-value":"${PSERVERKEYVALUE}"}]}
26 Run AAI Put generic-vnf
27 [Documentation] Create an generic-vnf object
28 ${resp}= PutWithCert ${GENERICVNFURL} ${GENERICVNFDATA}
31 Should Be Equal As Strings ${resp.status_code} 201
34 [Documentation] Create an pserver object
35 ${resp}= PutWithCert ${PSERVERURL} ${PSERVERDATA}
38 Should Be Equal As Strings ${resp.status_code} 201
40 Run AAI Put relationship of pserver and generic-vnf
41 [Documentation] Create relationship of pserver and generic-vnf
42 ${resp}= PutWithCert ${RELATIONSHIPURL} ${PSERVER_GENERIC_VNF_RELATIONSHIPDATA}
43 log ${RELATIONSHIPURL}
45 Should Be Equal As Strings ${resp.status_code} 200
48 [Documentation] Get the pserver object just relationship
49 ${resp} GetWithCert ${PSERVERURL}
52 Should Be Equal As Strings ${resp.status_code} 200
54 Run AAI Get generic-vnf
55 [Documentation] Get the generic-vnf object just relationship
56 ${resp} GetWithCert ${GENERICVNFURL}
59 Should Be Equal As Strings ${resp.status_code} 200
61 Run AAI Put custom query simple format
62 [Documentation] custom query simple format
63 log ${CUSTOMQUERYDATA}
64 ${resp}= PutWithCert ${CUSTOMQUERYURL} ${CUSTOMQUERYDATA}
68 Should Be Equal As Strings ${resp.status_code} 200
70 Run AAI Put custom query graphson format
71 [Documentation] custom query graphson format
72 log ${CUSTOMQUERYDATA}
73 ${resp}= PutWithCert ${CUSTOMQUERYURL_GRAPHSON} ${CUSTOMQUERYDATA}
74 log ${CUSTOMQUERYURL_GRAPHSON}
77 Should Be Equal As Strings ${resp.status_code} 200
79 Run AAI Put custom query id format
80 [Documentation] custom query id format
81 log ${CUSTOMQUERYDATA}
82 ${resp}= PutWithCert ${CUSTOMQUERYURL_ID} ${CUSTOMQUERYDATA}
83 log ${CUSTOMQUERYURL_ID}
86 Should Be Equal As Strings ${resp.status_code} 200
88 Run AAI Put custom query pathed format
89 [Documentation] custom query pathed format
90 log ${CUSTOMQUERYDATA}
91 ${resp}= PutWithCert ${CUSTOMQUERYURL_PATHED} ${CUSTOMQUERYDATA}
92 log ${CUSTOMQUERYURL_PATHED}
95 Should Be Equal As Strings ${resp.status_code} 200
97 Run AAI Put custom query resource format
98 [Documentation] custom query resource format
99 log ${CUSTOMQUERYDATA}
100 ${resp}= PutWithCert ${CUSTOMQUERYURL_RESOURCE} ${CUSTOMQUERYDATA}
101 log ${CUSTOMQUERYURL_RESOURCE}
104 Should Be Equal As Strings ${resp.status_code} 200
106 Run AAI Put custom query resource url format
107 [Documentation] custom query resource url format
108 log ${CUSTOMQUERYDATA}
109 ${resp}= PutWithCert ${CUSTOMQUERYURL_RESOURCE_URL} ${CUSTOMQUERYDATA}
110 log ${CUSTOMQUERYURL_RESOURCE_URL}
113 Should Be Equal As Strings ${resp.status_code} 200
115 Run AAI Put custom query raw format
116 [Documentation] custom query raw format
117 log ${CUSTOMQUERYDATA}
118 ${resp}= PutWithCert ${CUSTOMQUERYURL_RAW} ${CUSTOMQUERYDATA}
119 log ${CUSTOMQUERYURL_RAW}
122 Should Be Equal As Strings ${resp.status_code} 200
124 Run AAI Get generic-vnf to delete
125 [Documentation] Get the generic-vnf object to delete
126 ${resp} GetWithCert ${GENERICVNFURL}
129 Should Be Equal As Strings ${resp.status_code} 200
130 ${resource_version}= Evaluate $resp.json().get('resource-version')
131 Set Global Variable ${resource_version}
133 Run AAI Delete generic-vnf
134 [Documentation] Delete the generic-vnf
135 ${resp}= DeleteWithCert ${GENERICVNFURL}?resource-version=${resource_version}
137 Should Be Equal As Strings ${resp.status_code} 204
139 Run AAI Get pserver to delete
140 [Documentation] Get the pserver object to delete
141 ${resp} GetWithCert ${PSERVERURL}
144 Should Be Equal As Strings ${resp.status_code} 200
145 ${resource_version}= Evaluate $resp.json().get('resource-version')
146 Set Global Variable ${resource_version}
148 Run AAI Delete pserver
149 [Documentation] Delete the pserver
150 ${resp}= DeleteWithCert ${PSERVERURL}?resource-version=${resource_version}
152 Should Be Equal As Strings ${resp.status_code} 204
156 [Arguments] ${url} ${data}
157 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=integration-aai X-FromAppId=integration-aai Authorization=Basic QUFJOkFBSQ==
158 ${certinfo}= Evaluate ('${CURDIR}/aai.crt', '${CURDIR}/aai.key')
159 ${resp}= Evaluate requests.put('${url}', data='${data}', headers=${headers}, cert=${certinfo}, verify=False) requests
163 [Arguments] ${url} ${data}
164 ${headers}= Create Dictionary Accept=application/json Content-Type=application/merge-patch+json X-TransactionId=integration-aai X-FromAppId=integration-aai Authorization=Basic QUFJOkFBSQ==
165 ${certinfo}= Evaluate ('${CURDIR}/aai.crt', '${CURDIR}/aai.key')
166 ${resp}= Evaluate requests.patch('${url}', data='${data}', headers=${headers}, cert=${certinfo}, verify=False) requests
170 [Arguments] ${url} ${data}
171 ${auth}= Create List AAI AAI
172 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=integration-aai X-FromAppId=integration-aai Authorization=Basic QUFJOkFBSQ==
173 ${certinfo}= Evaluate ('${CURDIR}/aai.crt', '${CURDIR}/aai.key')
174 ${resp}= Evaluate requests.post('${url}', data='${data}', headers=${headers}, cert=${certinfo}, verify=False) requests
179 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=integration-aai X-FromAppId=integration-aai Authorization=Basic QUFJOkFBSQ==
180 ${certinfo}= Evaluate ('${CURDIR}/aai.crt', '${CURDIR}/aai.key')
181 ${resp}= Evaluate requests.get('${url}', headers=${headers}, cert=${certinfo}, verify=False) requests
186 ${auth}= Create List AAI AAI
187 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=integration-aai X-FromAppId=integration-aai Authorization=Basic QUFJOkFBSQ==
188 ${certinfo}= Evaluate ('${CURDIR}/aai.crt', '${CURDIR}/aai.key')
189 ${resp}= Evaluate requests.delete('${url}', headers=${headers}, cert=${certinfo}, verify=False) requests