Class: Infoblox::Client
- Inherits:
-
Object
- Object
- Infoblox::Client
- Defined in:
- lib/infoblox/client.rb
Instance Method Summary collapse
- #all_hosts ⇒ Object
-
#create_host(hostname, ip, dns = true) ⇒ Object
hostname : string ip : ipv4 string, i.e.
- #delete_host(hostname) ⇒ Object
-
#find_host_by_name(name) ⇒ Object
Find all host records by wildcard name.
-
#find_ips(ip_fragment) ⇒ Object
Find all ipv4addr records by ip address fragment.
-
#initialize(options = {}) ⇒ Client
constructor
:username :password :host (host if infoblox appliance, including protocol).
Constructor Details
#initialize(options = {}) ⇒ Client
:username :password :host (host if infoblox appliance, including protocol)
7 8 9 |
# File 'lib/infoblox/client.rb', line 7 def initialize(={}) Resource.connection = Connection.new() end |
Instance Method Details
#create_host(hostname, ip, dns = true) ⇒ Object
hostname : string ip : ipv4 string, i.e. “10.40.20.3”
33 34 35 36 37 |
# File 'lib/infoblox/client.rb', line 33 def create_host(hostname, ip, dns=true) host = Host.new(:name => hostname, :configure_for_dns => true) host.add_ipv4addr(ip) host.create end |
#delete_host(hostname) ⇒ Object
39 40 41 42 43 44 45 46 47 |
# File 'lib/infoblox/client.rb', line 39 def delete_host(hostname) if !(hosts = Host.find(:name => hostname)).empty? hosts.map(&:delete) hosts else raise Exception.new("host #{hostname} not found") false end end |