Class: Infoblox::Network
- Defined in:
- lib/infoblox/resource/network.rb
Instance Attribute Summary collapse
-
#network_container ⇒ Object
Returns the value of attribute network_container.
-
#network_view ⇒ Object
Returns the value of attribute network_view.
Attributes inherited from Resource
Instance Method Summary collapse
-
#next_available_ip(num = 1, exclude = []) ⇒ Object
Invoke the same-named function on the network resource in WAPI, returning an array of available IP addresses.
Methods inherited from Resource
_return_fields, all, default_params, #delete, find, #get, #initialize, #post, #put, remote_attr_accessor, remote_attr_writer, #remote_attribute_hash, remote_attrs, remote_post_accessor, remote_post_attrs, remote_write_only_attrs, resource_map, resource_uri, #resource_uri, wapi_object
Constructor Details
This class inherits a constructor from Infoblox::Resource
Instance Attribute Details
#network_container ⇒ Object
Returns the value of attribute network_container.
6 7 8 |
# File 'lib/infoblox/resource/network.rb', line 6 def network_container @network_container end |
#network_view ⇒ Object
Returns the value of attribute network_view.
6 7 8 |
# File 'lib/infoblox/resource/network.rb', line 6 def network_view @network_view end |
Instance Method Details
#next_available_ip(num = 1, exclude = []) ⇒ Object
Invoke the same-named function on the network 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 addrdess strings).
16 17 18 19 20 21 22 |
# File 'lib/infoblox/resource/network.rb', line 16 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 |