Class: ZabbixApi::Proxies

Inherits:
Basic
  • Object
show all
Defined in:
lib/zabbixapi/classes/proxies.rb

Instance Method Summary collapse

Methods inherited from Basic

#add, #all, #create, #create_or_update, #default_options, #destroy, #dump_by_id, #get, #get_full_data, #get_id, #get_or_create, #get_raw, #hash_equals?, #initialize, #key, #keys, #log, #merge_params, #normalize_array, #normalize_hash, #parse_keys, #symbolize_keys, #update

Constructor Details

This class inherits a constructor from ZabbixApi::Basic

Instance Method Details

#delete(data) ⇒ Integer

Delete Proxy object using Zabbix API

Parameters:

  • data (Array)

    Should include array of proxyid's

Returns:

  • (Integer)

    The Proxy object id that was deleted

Raises:

  • (ApiError)

    Error returned when there is a problem with the Zabbix API call.

  • (HttpError)

    Error raised when HTTP status from Zabbix Server response is not a 200 OK.


23
24
25
26
# File 'lib/zabbixapi/classes/proxies.rb', line 23

def delete(data)
  result = @client.api_request(method: 'proxy.delete', params: data)
  result.empty? ? nil : result['proxyids'][0].to_i
end

#indentifyString

The id field name used for identifying specific Proxy objects via Zabbix API

Returns:

  • (String)

13
14
15
# File 'lib/zabbixapi/classes/proxies.rb', line 13

def indentify
  'host'
end

#isreadable(data) ⇒ Boolean

Check if a Proxy object is readable using Zabbix API

Parameters:

  • data (Array)

    Should include array of proxyid's

Returns:

  • (Boolean)

    Returns true if the given proxies are readable

Raises:

  • (ApiError)

    Error returned when there is a problem with the Zabbix API call.

  • (HttpError)

    Error raised when HTTP status from Zabbix Server response is not a 200 OK.


34
35
36
# File 'lib/zabbixapi/classes/proxies.rb', line 34

def isreadable(data)
  @client.api_request(method: 'proxy.isreadable', params: data)
end

#iswritable(data) ⇒ Boolean

Check if a Proxy object is writable using Zabbix API

Parameters:

  • data (Array)

    Should include array of proxyid's

Returns:

  • (Boolean)

    Returns true if the given proxies are writable

Raises:

  • (ApiError)

    Error returned when there is a problem with the Zabbix API call.

  • (HttpError)

    Error raised when HTTP status from Zabbix Server response is not a 200 OK.


44
45
46
# File 'lib/zabbixapi/classes/proxies.rb', line 44

def iswritable(data)
  @client.api_request(method: 'proxy.iswritable', params: data)
end

#method_nameString

The method name used for interacting with Proxies via Zabbix API

Returns:

  • (String)

6
7
8
# File 'lib/zabbixapi/classes/proxies.rb', line 6

def method_name
  'proxy'
end