class Infoblox::Host
Public Instance Methods
add_ipv4addr(address)
click to toggle source
Add an IP address to this host. Only allows setting the ipv4addr field of the remote HostIpv4Addr record. If you need to set other fields, such as mac or configure_for_dns, use ipv4addrs=
# File lib/infoblox/resource/host.rb, line 36 def add_ipv4addr(address) ipv4addrs << HostIpv4addr.new(:ipv4addr => address) end
ipv4addrs()
click to toggle source
# File lib/infoblox/resource/host.rb, line 40 def ipv4addrs @ipv4addrs ||= [] end
ipv4addrs=(attrs=[])
click to toggle source
The more robust way to add IP addresses to your host record, allowing you to set all the attributes.
Example:
host.ipv4addrs=[{:ipv4addr => '10.10.10.10', :mac => '0x0x0x0x0x0x0x'}]
# File lib/infoblox/resource/host.rb, line 25 def ipv4addrs=(attrs=[]) attrs.each do |att| ipv4addrs << HostIpv4addr.new(att) end end
remote_attribute_hash(write=false, post=false)
click to toggle source
Calls superclass method
Infoblox::Resource#remote_attribute_hash
# File lib/infoblox/resource/host.rb, line 44 def remote_attribute_hash(write=false, post=false) super.tap do |hsh| hsh[:ipv4addrs] = ipv4addrs.map do |i| i.remote_attribute_hash(write, post).delete_if{|k,v| v.nil? } end end end