Sha256: ad5ca64f8178059c2fee998c79b30bf48b571c6390f69f33350769154efbf54e

Contents?: true

Size: 791 Bytes

Versions: 9

Compression:

Stored size: 791 Bytes

Contents

class ZabbixApi
  class Users < Basic

    def method_name
      "user"
    end

    def keys
      "userids"
    end

    def key
      "userid"
    end

    def indentify
      "alias"
    end

    def add_medias(data)
      result = @client.api_request(
        :method => "user.addMedia",
        :params => {
          :users => data[:userids].map { |t| {:userid => t} },
          :medias => data[:media]
        }
      )
      result ? result['mediaids'][0].to_i : nil
    end

    def update_medias(data)
      result = @client.api_request(
        :method => "user.updateMedia",
        :params => {
          :users => data[:userids].map { |t| {:userid => t} },
          :medias => data[:media]
        }
      )
      result ? result['userids'][0].to_i : nil
    end

  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
logstash-filter-zabbix-0.1.2 vendor/bundle/jruby/1.9/gems/zabbixapi-2.4.9/lib/zabbixapi/classes/users.rb
logstash-filter-zabbix-0.1.1 vendor/bundle/jruby/1.9/gems/zabbixapi-2.4.9/lib/zabbixapi/classes/users.rb
zabbixapi-3.1.0 lib/zabbixapi/classes/users.rb
zabbixapi-3.0.0 lib/zabbixapi/classes/users.rb
zabbixapi-2.4.9 lib/zabbixapi/classes/users.rb
zabbixapi-2.4.8 lib/zabbixapi/classes/users.rb
zabbixapi-2.4.7 lib/zabbixapi/classes/users.rb
zabbixapi-2.4.6 lib/zabbixapi/classes/users.rb
zabbixapi-2.4.5 lib/zabbixapi/classes/users.rb