Sha256: 4b55125f17762e98609d55c29e946365d89654320fc941434e8511d61a361500

Contents?: true

Size: 887 Bytes

Versions: 11

Compression:

Stored size: 887 Bytes

Contents

class ZabbixApi
  class Usermacros < Basic
    def indentify
      "macro"
    end

    def method_name
      "usermacro"
    end

    def create(data)
      request(data, "usermacro.create", "hostmacroids")
    end

    def create_global(data)
      request(data, "usermacro.createglobal", "globalmacroids")
    end

    def delete(data)
      request(data, "usermacro.delete", "hostmacroids")
    end

    def delete_global(data)
      request(data, "usermacro.deleteglobal", "globalmacroids")
    end

    def update
      request(data, "usermacro.update", "hostmacroids")
    end

    def update_global
      request(data, "usermacro.updateglobal", "globalmacroids")
    end

    private
      def request(data, method, result_key)
        result = @client.api_request(:method => method, :params => data)
        result.empty? ? nil : result[result_key][0].to_i
      end

  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
logstash-filter-zabbix-0.1.2 vendor/bundle/jruby/1.9/gems/zabbixapi-2.4.9/lib/zabbixapi/classes/usermacros.rb
logstash-filter-zabbix-0.1.1 vendor/bundle/jruby/1.9/gems/zabbixapi-2.4.9/lib/zabbixapi/classes/usermacros.rb
zabbixapi-2.4.9 lib/zabbixapi/classes/usermacros.rb
zabbixapi-2.4.8 lib/zabbixapi/classes/usermacros.rb
zabbixapi-2.4.7 lib/zabbixapi/classes/usermacros.rb
zabbixapi-2.4.6 lib/zabbixapi/classes/usermacros.rb
zabbixapi-2.4.5 lib/zabbixapi/classes/usermacros.rb
zabbixapi-2.4.4 lib/zabbixapi/classes/usermacros.rb
zabbixapi-2.4.3 lib/zabbixapi/classes/usermacros.rb
zabbixapi-2.4.2 lib/zabbixapi/classes/usermacros.rb
zabbixapi-2.4.1 lib/zabbixapi/classes/usermacros.rb