I have list of monitoring points and need help using API queries to get the DNS server(s) configured on these Appneta and
change them.
Release : SAAS
The API Calls can be obtained via the Monitoring Point's swagger interface.
Using HTTPS access the Swagger interface of the monitoring point
https://<monitoringPointIP>/
An example of getting the DNS info for interface eth0 of MP 10.10.10.27 would be
Note: The commands will need to authenticate to the monitoring point admin / <password>, (-u admin:<password>)
GET
curl -X 'GET' \ 'https://10.10.10.27/api/v1/interface/eth0/dns_nameserver/?config_state=active&family=inet' \ -H 'accept: application/json'
POST (to update)(Setting 1.1.1.1 and 8.8.8.8 as DNS Servers)
curl -X 'POST' \ 'https://10.10.10.27/api/v1/interface/eth0/dns_nameserver/' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "family": "inet", "dns_nameservers": [ "1.1.1.1","8.8.8.8" ]}'
DELETE
curl -X 'DELETE' \ 'https://10.10.10.27/api/v1/interface/eth0/dns_nameserver/?family=inet' \ -H 'accept: application/json'
Networking will need to be restarted for the changes to take effect
curl -X 'PUT' \ 'https://10.10.10.27/api/v1/service/networking/?action=restart' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "body": "string"}'