infoblox 0.3.3 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -7
- data/.travis.yml +2 -1
- data/Gemfile +4 -2
- data/README.md +9 -2
- data/infoblox.gemspec +3 -0
- data/lib/infoblox/resource/network.rb +2 -2
- data/lib/infoblox/resource/range.rb +2 -2
- data/lib/infoblox/version.rb +1 -1
- data/spec/connection_spec.rb +6 -6
- data/spec/host_ipv4addr_spec.rb +10 -2
- data/spec/integration/host_ipv4addr_spec.rb +1 -1
- data/spec/integration/host_spec.rb +1 -1
- data/spec/spec_helper.rb +7 -5
- metadata +79 -100
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
---
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
---
|
2
|
+
SHA512:
|
3
|
+
data.tar.gz: 9523aef2db73841cfd832f7016585e21877560c0b6c6acf68d9dac97c376010b38159fbed244477cd6c702382df308030e8276e0aad6eb6913fa4fa060a3109c
|
4
|
+
metadata.gz: 9a743acf2e90903b18966884fa5d8f1acb82d78b97f9b5a992cc77fbb28faa6de95f10b4378480902323ad4d3426ca35fe534cdb9e1ac6b0bbab299096a9f85c
|
5
|
+
SHA1:
|
6
|
+
data.tar.gz: 5e8cfd4c91bf44aa902f0f4fd7157d8e3a34290b
|
7
|
+
metadata.gz: 87e376a6a12e29d85500d9302cec32b7b2d19104
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -156,15 +156,20 @@ The `Infoblox::Network` and `Infoblox::Range` objects support the `next_availabl
|
|
156
156
|
|
157
157
|
Note that this function does not work on a resource that has not been created. In other words, if you want to get the next available IP for a given network segment, you have to create that segment beforehand. See the CRUD examples above.
|
158
158
|
|
159
|
+
|
160
|
+
## Extensible Attributes
|
161
|
+
|
162
|
+
Extensible attributes are supported in this client. It should be noted that in WAPI versions before 1.2, the field is named "extensible_attributes", whereas in version 1.2 and later, it is named "extattrs".
|
163
|
+
|
159
164
|
## Infoblox Version Compatibility
|
160
165
|
|
161
166
|
This gem is known to be compatible with Infoblox versions 1.0 through 2.0. While Infoblox claims that their API is backwards-compatible, one caveat remains with the Extensible Attributes (see elsewhere in this document). Some features are only available in newer versions (such as FixedAddress and AAAARecord). To set your version, use the `WAPI_VERSION` environment variable. For example:
|
162
167
|
|
163
168
|
WAPI_VERSION=2.0 ruby my_script.rb
|
164
169
|
|
165
|
-
##
|
170
|
+
## Ruby Version Compatibility
|
166
171
|
|
167
|
-
|
172
|
+
This gem is tested against Ruby versions 1.8.7, 1.9.3, 2.1.6, JRuby-head, and JRuby in 1.9 mode.
|
168
173
|
|
169
174
|
## Development / testing
|
170
175
|
|
@@ -179,6 +184,8 @@ To run the tests:
|
|
179
184
|
To run the integration tests (you will be prompted for your Infoblox credentials):
|
180
185
|
|
181
186
|
INTEGRATION=true rspec
|
187
|
+
|
188
|
+
Please note that the integration tests do not work in Ruby 1.8.7, but the unit tests function normally.
|
182
189
|
|
183
190
|
## Contributing
|
184
191
|
|
data/infoblox.gemspec
CHANGED
@@ -18,6 +18,9 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
+
if RUBY_VERSION <= '1.8.7'
|
22
|
+
spec.add_runtime_dependency "json"
|
23
|
+
end
|
21
24
|
spec.add_runtime_dependency "faraday"
|
22
25
|
spec.add_runtime_dependency "faraday_middleware"
|
23
26
|
|
@@ -20,8 +20,8 @@ module Infoblox
|
|
20
20
|
#
|
21
21
|
def next_available_ip(num=1, exclude=[])
|
22
22
|
post_body = {
|
23
|
-
num
|
24
|
-
exclude
|
23
|
+
:num => num.to_i,
|
24
|
+
:exclude => exclude
|
25
25
|
}
|
26
26
|
JSON.parse(connection.post(resource_uri + "?_function=next_available_ip", post_body).body)["ips"]
|
27
27
|
end
|
@@ -16,8 +16,8 @@ module Infoblox
|
|
16
16
|
#
|
17
17
|
def next_available_ip(num=1, exclude=[])
|
18
18
|
post_body = {
|
19
|
-
num
|
20
|
-
exclude
|
19
|
+
:num => num.to_i,
|
20
|
+
:exclude => exclude
|
21
21
|
}
|
22
22
|
JSON.parse(connection.post(resource_uri + "?_function=next_available_ip", post_body).body)["ips"]
|
23
23
|
end
|
data/lib/infoblox/version.rb
CHANGED
data/spec/connection_spec.rb
CHANGED
@@ -4,9 +4,9 @@ describe Infoblox::Connection do
|
|
4
4
|
["localhost", "127.0.0.1", "http://localhost:3000", "https://localhost", "http://localhost:3000/"].each do |host|
|
5
5
|
it "should build URL #{host} without failure" do
|
6
6
|
conn_params = {
|
7
|
-
username
|
8
|
-
password
|
9
|
-
host
|
7
|
+
:username => "billy",
|
8
|
+
:password => "boi",
|
9
|
+
:host => host
|
10
10
|
}
|
11
11
|
uri = "/wapi/v1.0/record:host"
|
12
12
|
|
@@ -22,9 +22,9 @@ describe Infoblox::Connection do
|
|
22
22
|
it "should raise Infobloxon invalid response" do
|
23
23
|
host = 'localhost'
|
24
24
|
conn_params = {
|
25
|
-
username
|
26
|
-
password
|
27
|
-
host
|
25
|
+
:username => "billy",
|
26
|
+
:password => "boi",
|
27
|
+
:host => host
|
28
28
|
}
|
29
29
|
uri = "/wapi/v1.0/record:host"
|
30
30
|
|
data/spec/host_ipv4addr_spec.rb
CHANGED
@@ -5,8 +5,16 @@ describe Infoblox::HostIpv4addr do
|
|
5
5
|
expected = [:host]
|
6
6
|
expect(Infoblox::HostIpv4addr.remote_post_attrs).to eq(expected)
|
7
7
|
|
8
|
-
expected = [
|
9
|
-
|
8
|
+
expected = [
|
9
|
+
:bootfile,
|
10
|
+
:configure_for_dhcp,
|
11
|
+
:ipv4addr,
|
12
|
+
:mac,
|
13
|
+
:network,
|
14
|
+
:nextserver,
|
15
|
+
:use_bootfile,
|
16
|
+
:use_nextserver].map(&:to_s).sort
|
17
|
+
expect(Infoblox::HostIpv4addr.remote_attrs.map(&:to_s).sort).to eq(expected)
|
10
18
|
end
|
11
19
|
end
|
12
20
|
|
@@ -4,7 +4,7 @@ if ENV['INTEGRATION']
|
|
4
4
|
it 'should work' do
|
5
5
|
each_version do
|
6
6
|
# the empty result will be [], so nil is bad.
|
7
|
-
expect(Infoblox::HostIpv4addr.find(connection, _max_results
|
7
|
+
expect(Infoblox::HostIpv4addr.find(connection, :_max_results => 1)).to_not be_nil
|
8
8
|
end
|
9
9
|
end
|
10
10
|
end
|
@@ -4,7 +4,7 @@ if ENV['INTEGRATION']
|
|
4
4
|
it 'should work' do
|
5
5
|
each_version do
|
6
6
|
# the empty result will be [], so nil is bad.
|
7
|
-
expect(Infoblox::Host.find(connection,
|
7
|
+
expect(Infoblox::Host.find(connection, :max_results => 1)).to_not be_nil
|
8
8
|
end
|
9
9
|
end
|
10
10
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -6,7 +6,9 @@
|
|
6
6
|
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
7
7
|
require File.expand_path("../../lib/infoblox", __FILE__)
|
8
8
|
Bundler.setup(:test)
|
9
|
-
|
9
|
+
if ENV['INTEGRATION']
|
10
|
+
require 'highline/import'
|
11
|
+
end
|
10
12
|
|
11
13
|
module Helper
|
12
14
|
def each_version
|
@@ -20,10 +22,10 @@ module Helper
|
|
20
22
|
|
21
23
|
def connection
|
22
24
|
Infoblox::Connection.new(
|
23
|
-
username
|
24
|
-
password
|
25
|
-
host
|
26
|
-
# logger
|
25
|
+
:username => $username,
|
26
|
+
:password => $password,
|
27
|
+
:host => $host
|
28
|
+
# :logger => Logger.new(STDOUT)
|
27
29
|
)
|
28
30
|
end
|
29
31
|
end
|
metadata
CHANGED
@@ -1,109 +1,90 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: infoblox
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
|
-
authors:
|
6
|
+
authors:
|
7
7
|
- Billy Reisinger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
11
|
+
|
12
|
+
date: 2015-06-17 00:00:00 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
prerelease: false
|
16
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- &id002
|
19
|
+
- ">="
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: "0"
|
20
22
|
type: :runtime
|
23
|
+
name: json
|
24
|
+
version_requirements: *id001
|
25
|
+
- !ruby/object:Gem::Dependency
|
21
26
|
prerelease: false
|
22
|
-
|
23
|
-
requirements:
|
24
|
-
-
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: faraday_middleware
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
27
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
28
|
+
requirements:
|
29
|
+
- *id002
|
34
30
|
type: :runtime
|
31
|
+
name: faraday
|
32
|
+
version_requirements: *id003
|
33
|
+
- !ruby/object:Gem::Dependency
|
35
34
|
prerelease: false
|
36
|
-
|
37
|
-
requirements:
|
38
|
-
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
35
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- *id002
|
38
|
+
type: :runtime
|
39
|
+
name: faraday_middleware
|
40
|
+
version_requirements: *id004
|
41
|
+
- !ruby/object:Gem::Dependency
|
49
42
|
prerelease: false
|
50
|
-
|
51
|
-
requirements:
|
52
|
-
-
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: bundler
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '1.3'
|
43
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- *id002
|
62
46
|
type: :development
|
47
|
+
name: rspec
|
48
|
+
version_requirements: *id005
|
49
|
+
- !ruby/object:Gem::Dependency
|
63
50
|
prerelease: false
|
64
|
-
|
65
|
-
requirements:
|
66
|
-
- -
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version:
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rake
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
51
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ~>
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: "1.3"
|
76
56
|
type: :development
|
57
|
+
name: bundler
|
58
|
+
version_requirements: *id006
|
59
|
+
- !ruby/object:Gem::Dependency
|
77
60
|
prerelease: false
|
78
|
-
|
79
|
-
requirements:
|
80
|
-
-
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: pry
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
61
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- *id002
|
90
64
|
type: :development
|
65
|
+
name: rake
|
66
|
+
version_requirements: *id007
|
67
|
+
- !ruby/object:Gem::Dependency
|
91
68
|
prerelease: false
|
92
|
-
|
93
|
-
requirements:
|
94
|
-
-
|
95
|
-
|
96
|
-
|
69
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- *id002
|
72
|
+
type: :development
|
73
|
+
name: pry
|
74
|
+
version_requirements: *id008
|
97
75
|
description: A Ruby wrapper to the Infoblox WAPI
|
98
|
-
email:
|
76
|
+
email:
|
99
77
|
- billy.reisinger@govdelivery.com
|
100
78
|
executables: []
|
79
|
+
|
101
80
|
extensions: []
|
81
|
+
|
102
82
|
extra_rdoc_files: []
|
103
|
-
|
104
|
-
|
105
|
-
-
|
106
|
-
-
|
83
|
+
|
84
|
+
files:
|
85
|
+
- .gitignore
|
86
|
+
- .rspec
|
87
|
+
- .travis.yml
|
107
88
|
- Gemfile
|
108
89
|
- LICENSE.txt
|
109
90
|
- README.md
|
@@ -139,31 +120,29 @@ files:
|
|
139
120
|
- spec/search_spec.rb
|
140
121
|
- spec/spec_helper.rb
|
141
122
|
homepage: https://github.com/govdelivery/infoblox
|
142
|
-
licenses:
|
123
|
+
licenses:
|
143
124
|
- MIT
|
144
125
|
metadata: {}
|
126
|
+
|
145
127
|
post_install_message:
|
146
128
|
rdoc_options: []
|
147
|
-
|
129
|
+
|
130
|
+
require_paths:
|
148
131
|
- lib
|
149
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
150
|
-
requirements:
|
151
|
-
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
requirements:
|
156
|
-
- - ">="
|
157
|
-
- !ruby/object:Gem::Version
|
158
|
-
version: '0'
|
132
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
133
|
+
requirements:
|
134
|
+
- *id002
|
135
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- *id002
|
159
138
|
requirements: []
|
139
|
+
|
160
140
|
rubyforge_project:
|
161
|
-
rubygems_version: 2.
|
141
|
+
rubygems_version: 2.0.17
|
162
142
|
signing_key:
|
163
143
|
specification_version: 4
|
164
|
-
summary: This gem is a Ruby interface to the Infoblox WAPI. Using the gem, you can
|
165
|
-
|
166
|
-
test_files:
|
144
|
+
summary: This gem is a Ruby interface to the Infoblox WAPI. Using the gem, you can query, create, update, and delete DNS records in your Infoblox instance.
|
145
|
+
test_files:
|
167
146
|
- spec/connection_spec.rb
|
168
147
|
- spec/host_ipv4addr_spec.rb
|
169
148
|
- spec/host_spec.rb
|