__author__ = 'sbaksh' #!/usr/bin/python # -*- coding: utf-8 -*- import requests import json # Declare the IP Address NetMRI is configured on netmri = "https://netmriIP/api/2.9/" # The SysAdmin user account we are using to login username = "sbaksh" password = "mypassword" requests.packages.urllib3.disable_warnings() def run_adhoc(): object_type = "scripts/run?name=Ad Hoc Command Batch&$commands_to_be_executed=sh version&device_ids=24607" data = requests.get(netmri + object_type, verify=False, auth=(username, password)) json_input = data.text print json_input run_adhoc() print "Completed" #http://demo-netmri.infoblox.com/api/2.10/scripts/run?name=sif_adhoc&$test=sh%20version&device_ids=24607