the below python code lets me obtain data from REST API
source /opt/rh/python27/enable
python
import json, requests
userid = ‘administrator’
passwd = ‘Networker@9’
url = ‘https://NMC_HOSTNAME:9090/nwrestapi/v1/global/clients’
r = requests.get(url, verify=False, auth=(‘nmcuser’, ‘pwd_of_nmc_user’))
for row in r.json()[‘clients’]:
print json.dumps(row, indent=4)
This is for client objects; like wise, you can change the object name in the above URL to one of the below to get the rest of the details; put them up in a database and then run queries.
FYI..
the below python code lets me obtain data from REST API
source /opt/rh/python27/enable
python
import json, requests
userid = ‘administrator’
passwd = ‘Networker@9’
url = ‘https://NMC_HOSTNAME:9090/nwrestapi/v1/global/clients’
r = requests.get(url, verify=False, auth=(‘nmcuser’, ‘pwd_of_nmc_user’))
for row in r.json()[‘clients’]:
print json.dumps(row, indent=4)
This is for client objects; like wise, you can change the object name in the above URL to one of the below to get the rest of the details; put them up in a database and then run queries.
https://nmc-hostname:9090/nwrestapi/v1/global/alerts
List of alert messages
https://nmc-hostname:9090/nwrestapi/v1/global/auditlogconfig
Audit log configuration
https://nmc-hostname:9090/nwrestapi/v1/global/backups
List of backups
https://nmc-hostname:9090/nwrestapi/v1/global/clients
List of clients
https://nmc-hostname:9090/nwrestapi/v1/global/devices
List of storage devices
https://nmc-hostname:9090/nwrestapi/v1/global/directives
List of backup directives
https://nmc-hostname:9090/nwrestapi/v1/global/jobgroups
List of job groups
https://nmc-hostname:9090/nwrestapi/v1/global/jobindications
List of job indications
https://nmc-hostname:9090/nwrestapi/v1/global/jobs
List of jobs
https://nmc-hostname:9090/nwrestapi/v1/global/labels
List of volume label templates
https://nmc-hostname:9090/nwrestapi/v1/global/notifications
List of notification settings
https://nmc-hostname:9090/nwrestapi/v1/global/pools
List of pools
https://nmc-hostname:9090/nwrestapi/v1/global/probes
List of probes
https://nmc-hostname:9090/nwrestapi/v1/global/protectiongroups
List of protection groups
https://nmc-hostname:9090/nwrestapi/v1/global/protectionpolicies
List of protection policies
https://nmc-hostname:9090/nwrestapi/v1/global/serverconfig
Server configuration
https://nmc-hostname:9090/nwrestapi/v1/global/servermessages
List of server messages
https://nmc-hostname:9090/nwrestapi/v1/global/serverstatistics
Server statistics
https://nmc-hostname:9090/nwrestapi/v1/global/sessions
List of save/recover sessions
https://nmc-hostname:9090/nwrestapi/v1/global/storagenodes
List of storage nodes
https://nmc-hostname:9090/nwrestapi/v1/global/volumes
List of volumes