/
Verify VNF Data is in A&AI
Verify VNF Data is in A&AI
In support of the Identity-URL requirement A&AI created a named-query for APPC to pull VNF data in one query. That query can be executed either via Postman or curl (curl is used in this example)
The verify.sh script is basically building and executing a curl command that hits the A&AI REST service.
verify.sh
#!/bin/bash
HEADERS='-H "X-FromAppId: AAI-Temp-Tool" -H "X-TransactionId: AAI-Temp-Tool" -H "Real-Time: true" -H "Content-Type: application/json" -H "Accept: application/json"';
if [ $# -eq 0 ]; then
echo "Invalid you need to provide the ip address or hostname of machine to run the requests";
exit 1;
fi;
RESOURCE_HOSTNAME=$1;
eval curl -k -u AAI:AAI -X POST -T named-query.json $HEADERS https://$RESOURCE_HOSTNAME:8443/aai/search/named-query
The named-query.json is required input for the verify.sh script and an example can be viewed below (The named query ID should remain constant throughout A&AI instances)
named-query.json
{
"query-parameters": {
"named-query": {
"named-query-uuid": "037eb932-edac-48f5-9782-c19c0aa5a031"
}
},
"instance-filters":{
"instance-filter":[ {
"generic-vnf": {
"vnf-id": "vCPE_Infrastructure_vGMUX_demo_app"
}
} ]
}
}
The verify.sh script can be executed by typing the command below (aai1 represents the hostname or IP of the A&AI instance)
The response should include VNF info, VNFC info, ESR info, tenant info as well as vserver info
verify.sh execution
$ ./verify.sh aai1 |python -m json.tool (NOTE the "|python -m json.tool" creates a nicely formatted json response but is not required)
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2848 0 2518 100 330 1053 138 0:00:02 0:00:02 --:--:-- 1053