class Infoblox::Range

Public Instance Methods

next_available_ip(num=1, exclude=[]) click to toggle source

Invoke the same-named function on the range resource in WAPI, returning an array of available IP addresses. You may optionally specify how many IPs you want (num) and which ones to exclude from consideration (array of IPv4 address strings).

# File lib/infoblox/resource/range.rb, line 17
def next_available_ip(num=1, exclude=[])
  post_body = {
    :num =>     num.to_i,
    :exclude => exclude
  }
  JSON.parse(connection.post(resource_uri + "?_function=next_available_ip", post_body).body)["ips"]
end