Sha256: e03379852fce862627ea6517345f0fd320c21a73231e7a7ee96045745164fde2

Contents?: true

Size: 807 Bytes

Versions: 15

Compression:

Stored size: 807 Bytes

Contents

module Infoblox
  class Range < Resource
    remote_attr_accessor :end_addr, 
                         :extattrs,
                         :extensible_attributes,
                         :network_view, 
                         :start_addr

    wapi_object "range"
    
    ## 
    # 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).
    #
    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

  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
infoblox-3.0.0 lib/infoblox/resource/range.rb
infoblox-2.0.5 lib/infoblox/resource/range.rb
infoblox-2.0.4 lib/infoblox/resource/range.rb
infoblox-2.0.3 lib/infoblox/resource/range.rb
infoblox-2.0.2 lib/infoblox/resource/range.rb
infoblox-2.0.1 lib/infoblox/resource/range.rb
infoblox-2.0.0 lib/infoblox/resource/range.rb
infoblox-1.0.1 lib/infoblox/resource/range.rb
infoblox-1.0.0 lib/infoblox/resource/range.rb
infoblox-0.5.3 lib/infoblox/resource/range.rb
infoblox-0.5.2 lib/infoblox/resource/range.rb
infoblox-0.5.1 lib/infoblox/resource/range.rb
infoblox-0.5.0 lib/infoblox/resource/range.rb
infoblox-0.4.1 lib/infoblox/resource/range.rb
infoblox-0.4.0 lib/infoblox/resource/range.rb