Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extra functionality #2

Merged
merged 2 commits into from
Aug 26, 2011
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion 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 All @@ -2994,4 +3022,4 @@ def get(self,**opts):
@dojson('maintenance.update')
@checkauth
def update(self,**opts):
return opts
return opts