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 CHANGED
@@ -1,7 +1,7 @@
1
- ---
2
- SHA1:
3
- metadata.gz: c25a0a8c232a93161b8317af5238429446a78779
4
- data.tar.gz: 48d577a599c4a404ea571cc7fe26619a95387c16
5
- SHA512:
6
- metadata.gz: 866fb518bdae0ae892386ecfeaef74b6f7394f0243c0bcf6d69a151f05912e567cc5d7b852e36f4fa9fca3843ac3a05fa3a66f83f9235b4327da2ad5360a428a
7
- data.tar.gz: 33e941c47b1ee9f258c3317be8921231741b1da1388d59f9fd71705adc4d1e71d6b1780ab0ce01bd3252a5eba5e0f8eb3bf595ff443c8639151b45d2ae0a4e93
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
@@ -1,9 +1,10 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1.5
3
+ - 2.1.6
4
4
  - 1.9.3
5
5
  - jruby-19mode
6
6
  - jruby-head
7
+ - 1.8.7
7
8
  script: bundle exec rspec
8
9
  notifications:
9
10
  webhooks: https://gd-radiator.ngrok.com/hubot/travis?room=devlab@conference.im.office.gdi
data/Gemfile CHANGED
@@ -3,6 +3,8 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in infoblox.gemspec
4
4
  gemspec
5
5
 
6
- group :test do
7
- gem 'highline'
6
+ if ENV['INTEGRATION']
7
+ group :test do
8
+ gem 'highline'
9
+ end
8
10
  end
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
- ## Extensible Attributes
170
+ ## Ruby Version Compatibility
166
171
 
167
- 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".
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: num.to_i,
24
- exclude: 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: num.to_i,
20
- exclude: 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
@@ -1,3 +1,3 @@
1
1
  module Infoblox
2
- VERSION = "0.3.3"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -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: "billy",
8
- password: "boi",
9
- host: 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: "billy",
26
- password: "boi",
27
- host: host
25
+ :username => "billy",
26
+ :password => "boi",
27
+ :host => host
28
28
  }
29
29
  uri = "/wapi/v1.0/record:host"
30
30
 
@@ -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 = [:bootfile, :configure_for_dhcp, :ipv4addr, :mac, :network, :nextserver, :use_bootfile, :use_nextserver].sort
9
- expect(Infoblox::HostIpv4addr.remote_attrs.sort).to eq(expected)
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: 1)).to_not be_nil
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, _max_results: 1)).to_not be_nil
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
- require 'highline/import'
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: $username,
24
- password: $password,
25
- host: $host,
26
- # logger: Logger.new(STDOUT)
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.3
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
- date: 2015-06-16 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: faraday
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
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
- version_requirements: !ruby/object:Gem::Requirement
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
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: rspec
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
- version_requirements: !ruby/object:Gem::Requirement
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
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '1.3'
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
- version_requirements: !ruby/object:Gem::Requirement
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
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
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
- files:
104
- - ".gitignore"
105
- - ".rspec"
106
- - ".travis.yml"
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
- require_paths:
129
+
130
+ require_paths:
148
131
  - lib
149
- required_ruby_version: !ruby/object:Gem::Requirement
150
- requirements:
151
- - - ">="
152
- - !ruby/object:Gem::Version
153
- version: '0'
154
- required_rubygems_version: !ruby/object:Gem::Requirement
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.4.3
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
- query, create, update, and delete DNS records in your Infoblox instance.
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