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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 58900d8b11339ba296f175de86b4160b6bc6300c
4
- data.tar.gz: f2b1740ca897c5c07f1d42cf8912ec085eeab45f
3
+ metadata.gz: 7b7222b3b91069125571ec18d52d5a270bde96ca
4
+ data.tar.gz: 1420c6a63bb641f8159bd3a38bdc89a2821fcd0e
5
5
  SHA512:
6
- metadata.gz: 6eec1b32abae5f6829b9ef27dc29ee09b5c6cfff98251e52191225626439f954ba25a93f84af460d2376ba01b9d5e552e968f1afaa47bb87d35d54af716f4a26
7
- data.tar.gz: 14e7bef6cd7c2c5ddb3f1a5c447ed6fa052bbf7b5969ea58a86433f309addcd843c808dcff5a764528f2d23a952f80c8cfbe43537191a04f3908a8ba663cebd1
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). To set your version, use the `WAPI_VERSION` environment variable. For example:
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.0 ruby my_script.rb
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
 
@@ -1,3 +1,6 @@
1
+ ## 2.0.0 - September 2 2016
2
+ Make WAPI version 2.0 the default version.
3
+
1
4
  ## 1.0.1 - September 2 2016
2
5
  A point release containing a bugfix and new field on a recod.
3
6
 
@@ -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'] || '1.0')
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
@@ -1,3 +1,3 @@
1
1
  module Infoblox
2
- VERSION = "1.0.1"
2
+ VERSION = "2.0.0"
3
3
  end
@@ -19,7 +19,7 @@ describe Infoblox::Connection do
19
19
  end
20
20
  end
21
21
 
22
- it "should raise Infobloxon invalid response" do
22
+ it "should raise on invalid response" do
23
23
  host = 'localhost'
24
24
  conn_params = {
25
25
  :username => "billy",
@@ -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
- uri = Infoblox.base_path + "foo:animal"
48
- allow(conn).to receive(:get).with(uri, {:_return_fields => "name,junction,extensible_attributes,readonly_thing"}).and_return(FooResponse.new("[]"))
49
- expect(FooResource.all(conn)).to eq([])
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
- allow(conn).to receive(:get).with(uri, {:_return_fields => "name,junction,extensible_attributes,readonly_thing", :_max_results => -70}).and_return(FooResponse.new("[]"))
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
 
@@ -17,16 +17,16 @@ module Helper
17
17
  yield
18
18
  end
19
19
  ensure
20
- Infoblox.wapi_version = '1.0'
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 => $host,
27
+ :host => $host,
28
28
  :ssl_opts => {:verify => false}
29
- # :logger => Logger.new(STDOUT)
29
+ # :logger => Logger.new(STDOUT)
30
30
  )
31
31
  end
32
32
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: infoblox
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Billy Reisinger