From 6b6ddfd1b83cacfa68d7d4b812d7c65dbc589a96 Mon Sep 17 00:00:00 2001 From: Ryan Day Date: Tue, 23 Aug 2011 17:47:37 -0400 Subject: [PATCH 1/2] Add hostgroup exists call --- zabbix/zabbix_api.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/zabbix/zabbix_api.py b/zabbix/zabbix_api.py index aa8bfdf..e1164d9 100644 --- a/zabbix/zabbix_api.py +++ b/zabbix/zabbix_api.py @@ -1131,6 +1131,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') @@ -2994,4 +3015,4 @@ def get(self,**opts): @dojson('maintenance.update') @checkauth def update(self,**opts): - return opts \ No newline at end of file + return opts From 195184aed9fc562f506a6b8344fe32b8f6824d70 Mon Sep 17 00:00:00 2001 From: Ryan Day Date: Tue, 23 Aug 2011 18:07:52 -0400 Subject: [PATCH 2/2] Add proxy API --- zabbix/zabbix_api.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/zabbix/zabbix_api.py b/zabbix/zabbix_api.py index e1164d9..bd98261 100644 --- a/zabbix/zabbix_api.py +++ b/zabbix/zabbix_api.py @@ -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) @@ -2994,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