Get the List of Monitored Organizations
Applies To
API Parameters
Sample XML Output
Sample Code
Applies To
Multitenant deployments
API Parameters
Methodology | REST API based: make an HTTP(S) request with an input XML (optional). An output XML is returned. |
Input URL | https:// |
Input Credentials | Username and password of Super account |
Output | An XML that contains Organization id, Organization name, Status, Included and Excluded IP range |
Sample XML Output
Sample Code
This sample python script takes the Super credentials as arguments and writes out the parsed XML output file in a comma separated value (CSV) format on the screen. The output can be redirected to a file if needed.
mapping={‘name’:”, ‘domainId’:”, ‘disabled’:”, ‘initialized’:”, ‘include’:”, ‘exclude’:”} for node2 in node1.getElementsByTagName(“domainId”): for node3 in node2.childNodes: if node3.nodeType==Node.TEXT_NODE: mapping[‘domainId’]=node3.data for node4 in node1.getElementsByTagName(“excludeRange”): for node5 in node4.childNodes: if node5.nodeType==Node.TEXT_NODE: mapping[‘exclude’]=node5.data for node6 in node1.getElementsByTagName(“includeRange”): for node7 in node6.childNodes: if node7.nodeType==Node.TEXT_NODE: mapping[‘include’]=node7.data for node8 in node1.getElementsByTagName(“name”): for node9 in node8.childNodes: if node9.nodeType==Node.TEXT_NODE: mapping[‘name’]=node9.data for node10 in node1.getElementsByTagName(“disabled”): for node11 in node10.childNodes: if node11.nodeType==Node.TEXT_NODE: mapping[‘disabled’]=node11.data for node12 in node1.getElementsByTagName(“initialized”): for node13 in node12.childNodes: if node13.nodeType==Node.TEXT_NODE: mapping[‘initialized’]=node13.data param.append(mapping) return param def generateResult(param): print “Org Name,Org Id,Disabled,Initialized,Include Range,Exclude Range\n\n” for item in param:
print “%s,%s,%s,%s,%s,%s\n” % (item[‘name’], item[‘domainId’], item[‘disabled’], item[‘initialized’], item[‘include’], item[‘exclude’]) if __name__==’__main__’:
import sys if len(sys.argv)!=4:
print “Usage: GetMonitoredOrganizations.py appServer user password” exit()
Having trouble configuring your Fortinet hardware or have some questions you need answered? Check Out The Fortinet Guru Youtube Channel! Want someone else to deal with it for you? Get some consulting from Fortinet GURU!