Skip to content

Commit

Permalink
Merge pull request #2 from rday/master
Browse files Browse the repository at this point in the history
Add proxy.get and hostgroup.exists methods
  • Loading branch information
gescheit committed Aug 26, 2011
2 parents 00d88c3 + 195184a commit 33dea23
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions zabbix/zabbix_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ def __init__(self, server='http://localhost/zabbix', user=None, passwd=None, log
self.drule = ZabbixAPIDRule(self,**kwargs)
self.history = ZabbixAPIHistory(self,**kwargs)
self.maintenance = ZabbixAPIMaintenance(self,**kwargs)
self.proxy = ZabbixAPIProxy(self,**kwargs)
self.id = 0

self.debug(logging.INFO, "url: "+ self.url)
Expand Down Expand Up @@ -1131,6 +1132,27 @@ def massUpdate(self,**opts):
"""
return opts

@dojson('hostgroup.exists')
@checkauth
def exists(self,**opts):
""" * Check if HostGroups exists
*
* {@source}
* @access public
* @static
* @since 1.8.3
* @version 1
*
* @param array $data
* @param array $data['nodeids']
* @param array $data['groupid']
* @param array $data['name']
* @return boolean
"""
print "Got RESULT"
print opts
return opts

class ZabbixAPIApplication(ZabbixAPISubClass):

@dojson('application.get')
Expand Down Expand Up @@ -2973,6 +2995,12 @@ def get(self,**opts):
def delete(self,**opts):
return opts

class ZabbixAPIProxy(ZabbixAPISubClass):
@dojson('proxy.get')
@checkauth
def get(self,**opts):
return opts

class ZabbixAPIMaintenance(ZabbixAPISubClass):
@dojson('maintenance.create')
@checkauth
Expand Down

0 comments on commit 33dea23

Please sign in to comment.