infoblox 1.0.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -2
- data/RELEASES.md +3 -0
- data/lib/infoblox.rb +6 -6
- data/lib/infoblox/version.rb +1 -1
- data/spec/connection_spec.rb +1 -1
- data/spec/resource_spec.rb +16 -4
- data/spec/spec_helper.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b7222b3b91069125571ec18d52d5a270bde96ca
|
4
|
+
data.tar.gz: 1420c6a63bb641f8159bd3a38bdc89a2821fcd0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 022760f2578972ca11583adc646a2df274b8108fca7cfcd53346998d558d7d277ded594db735d336c79ec46e38af63f008a7331a94d49617aeca132f1c9be069
|
7
|
+
data.tar.gz: ffe884aa4559ab98749037baa18f8bd73e89fd140e191533d101a58027f36a743c626108174f936348f86301d8df442cd33fac2bbf92cc7e37c36b501417d5e1
|
data/README.md
CHANGED
@@ -184,9 +184,11 @@ Extensible attributes are supported in this client. It should be noted that in
|
|
184
184
|
|
185
185
|
## Infoblox Version Compatibility
|
186
186
|
|
187
|
-
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).
|
187
|
+
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). For best results, set the version using the `WAPI_VERSION` environment variable. For example:
|
188
188
|
|
189
|
-
WAPI_VERSION=2
|
189
|
+
WAPI_VERSION=1.2 ruby my_script.rb
|
190
|
+
|
191
|
+
The default version is 2.0.
|
190
192
|
|
191
193
|
## Ruby Version Compatibility
|
192
194
|
|
data/RELEASES.md
CHANGED
data/lib/infoblox.rb
CHANGED
@@ -7,16 +7,11 @@ require 'infoblox/version'
|
|
7
7
|
require 'infoblox/connection'
|
8
8
|
require 'infoblox/resource'
|
9
9
|
|
10
|
-
# Require everything in the resource directory
|
11
|
-
Dir[File.expand_path('../infoblox/resource/*.rb', __FILE__)].each do |f|
|
12
|
-
require f
|
13
|
-
end
|
14
|
-
|
15
10
|
module Infoblox
|
16
11
|
DEBUG = ENV['DEBUG']
|
17
12
|
|
18
13
|
def wapi_version
|
19
|
-
@wapi_version ||= (ENV['WAPI_VERSION'] || '
|
14
|
+
@wapi_version ||= (ENV['WAPI_VERSION'] || '2.0')
|
20
15
|
end
|
21
16
|
module_function :wapi_version
|
22
17
|
|
@@ -30,3 +25,8 @@ module Infoblox
|
|
30
25
|
end
|
31
26
|
module_function :base_path
|
32
27
|
end
|
28
|
+
|
29
|
+
# Require everything in the resource directory
|
30
|
+
Dir[File.expand_path('../infoblox/resource/*.rb', __FILE__)].each do |f|
|
31
|
+
require f
|
32
|
+
end
|
data/lib/infoblox/version.rb
CHANGED
data/spec/connection_spec.rb
CHANGED
data/spec/resource_spec.rb
CHANGED
@@ -44,15 +44,27 @@ describe Infoblox::Resource, "#add_ipv4addr" do
|
|
44
44
|
|
45
45
|
it "should find with default attributes" do
|
46
46
|
conn = double
|
47
|
-
|
48
|
-
|
49
|
-
|
47
|
+
each_version do
|
48
|
+
uri = Infoblox.base_path + "foo:animal"
|
49
|
+
if(Infoblox.wapi_version >= '1.2')
|
50
|
+
allow(conn).to receive(:get).with(uri, {:_return_fields => "name,junction,extattrs,readonly_thing"}).and_return(FooResponse.new("[]"))
|
51
|
+
else
|
52
|
+
allow(conn).to receive(:get).with(uri, {:_return_fields => "name,junction,extensible_attributes,readonly_thing"}).and_return(FooResponse.new("[]"))
|
53
|
+
end
|
54
|
+
expect(FooResource.all(conn)).to eq([])
|
55
|
+
end
|
50
56
|
end
|
51
57
|
|
52
58
|
it "should allow .all with return fields or max results" do
|
53
59
|
conn = double
|
54
60
|
uri = Infoblox.base_path + "foo:animal"
|
55
|
-
|
61
|
+
each_version do
|
62
|
+
if Infoblox.wapi_version >= '1.2'
|
63
|
+
allow(conn).to receive(:get).with(uri, {:_return_fields => "name,junction,extattrs,readonly_thing", :_max_results => -70}).and_return(FooResponse.new("[]"))
|
64
|
+
else
|
65
|
+
allow(conn).to receive(:get).with(uri, {:_return_fields => "name,junction,extensible_attributes,readonly_thing", :_max_results => -70}).and_return(FooResponse.new("[]"))
|
66
|
+
end
|
67
|
+
end
|
56
68
|
expect(FooResource.all(conn, :_max_results => -70)).to eq([])
|
57
69
|
end
|
58
70
|
|
data/spec/spec_helper.rb
CHANGED
@@ -17,16 +17,16 @@ module Helper
|
|
17
17
|
yield
|
18
18
|
end
|
19
19
|
ensure
|
20
|
-
Infoblox.wapi_version = '
|
20
|
+
Infoblox.wapi_version = '2.0'
|
21
21
|
end
|
22
22
|
|
23
23
|
def connection
|
24
24
|
Infoblox::Connection.new(
|
25
25
|
:username => $username,
|
26
26
|
:password => $password,
|
27
|
-
:host
|
27
|
+
:host => $host,
|
28
28
|
:ssl_opts => {:verify => false}
|
29
|
-
# :logger
|
29
|
+
# :logger => Logger.new(STDOUT)
|
30
30
|
)
|
31
31
|
end
|
32
32
|
end
|