netbox-client-ruby 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +13 -0
- data/.rspec +2 -0
- data/.ruby-version +1 -0
- data/.travis.yml +8 -0
- data/Dockerfile +12 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +75 -0
- data/LICENSE.txt +21 -0
- data/README.md +138 -0
- data/Rakefile +6 -0
- data/VERSION +1 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/docker-compose.test.yml +5 -0
- data/docker-compose.yml +37 -0
- data/docker/start.sh +3 -0
- data/docker/start.test.sh +3 -0
- data/lib/netbox-client-ruby.rb +1 -0
- data/lib/netbox_client_ruby.rb +25 -0
- data/lib/netbox_client_ruby/api.rb +18 -0
- data/lib/netbox_client_ruby/api/dcim.rb +55 -0
- data/lib/netbox_client_ruby/api/dcim/device.rb +31 -0
- data/lib/netbox_client_ruby/api/dcim/device_role.rb +12 -0
- data/lib/netbox_client_ruby/api/dcim/device_roles.rb +19 -0
- data/lib/netbox_client_ruby/api/dcim/device_type.rb +26 -0
- data/lib/netbox_client_ruby/api/dcim/device_types.rb +19 -0
- data/lib/netbox_client_ruby/api/dcim/devices.rb +19 -0
- data/lib/netbox_client_ruby/api/dcim/interface.rb +14 -0
- data/lib/netbox_client_ruby/api/dcim/interfaces.rb +19 -0
- data/lib/netbox_client_ruby/api/dcim/manufacturer.rb +12 -0
- data/lib/netbox_client_ruby/api/dcim/manufacturers.rb +19 -0
- data/lib/netbox_client_ruby/api/dcim/platform.rb +12 -0
- data/lib/netbox_client_ruby/api/dcim/platforms.rb +19 -0
- data/lib/netbox_client_ruby/api/dcim/rack.rb +12 -0
- data/lib/netbox_client_ruby/api/dcim/racks.rb +19 -0
- data/lib/netbox_client_ruby/api/dcim/region.rb +13 -0
- data/lib/netbox_client_ruby/api/dcim/regions.rb +19 -0
- data/lib/netbox_client_ruby/api/dcim/site.rb +15 -0
- data/lib/netbox_client_ruby/api/dcim/sites.rb +19 -0
- data/lib/netbox_client_ruby/api/ipam.rb +53 -0
- data/lib/netbox_client_ruby/api/ipam/aggregate.rb +14 -0
- data/lib/netbox_client_ruby/api/ipam/aggregates.rb +19 -0
- data/lib/netbox_client_ruby/api/ipam/ip_address.rb +42 -0
- data/lib/netbox_client_ruby/api/ipam/ip_addresses.rb +19 -0
- data/lib/netbox_client_ruby/api/ipam/prefix.rb +47 -0
- data/lib/netbox_client_ruby/api/ipam/prefixes.rb +19 -0
- data/lib/netbox_client_ruby/api/ipam/rir.rb +12 -0
- data/lib/netbox_client_ruby/api/ipam/rirs.rb +19 -0
- data/lib/netbox_client_ruby/api/ipam/role.rb +12 -0
- data/lib/netbox_client_ruby/api/ipam/roles.rb +19 -0
- data/lib/netbox_client_ruby/api/ipam/vlan.rb +40 -0
- data/lib/netbox_client_ruby/api/ipam/vlan_group.rb +14 -0
- data/lib/netbox_client_ruby/api/ipam/vlan_groups.rb +19 -0
- data/lib/netbox_client_ruby/api/ipam/vlans.rb +19 -0
- data/lib/netbox_client_ruby/api/ipam/vrf.rb +14 -0
- data/lib/netbox_client_ruby/api/ipam/vrfs.rb +19 -0
- data/lib/netbox_client_ruby/api/tenancy.rb +25 -0
- data/lib/netbox_client_ruby/api/tenancy/tenant.rb +14 -0
- data/lib/netbox_client_ruby/api/tenancy/tenant_group.rb +12 -0
- data/lib/netbox_client_ruby/api/tenancy/tenant_groups.rb +19 -0
- data/lib/netbox_client_ruby/api/tenancy/tenants.rb +19 -0
- data/lib/netbox_client_ruby/communication.rb +74 -0
- data/lib/netbox_client_ruby/connection.rb +33 -0
- data/lib/netbox_client_ruby/entities.rb +200 -0
- data/lib/netbox_client_ruby/entity.rb +345 -0
- data/lib/netbox_client_ruby/error/client_error.rb +4 -0
- data/lib/netbox_client_ruby/error/local_error.rb +4 -0
- data/lib/netbox_client_ruby/error/remote_error.rb +4 -0
- data/netbox-client-ruby.gemspec +43 -0
- data/netbox.env +17 -0
- metadata +255 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.name = 'netbox-client-ruby'
|
|
8
|
+
spec.version = File.read(File.expand_path('../VERSION', __FILE__)).strip
|
|
9
|
+
spec.authors = ['Christian Mäder']
|
|
10
|
+
spec.email = ['christian.maeder@nine.ch']
|
|
11
|
+
|
|
12
|
+
spec.summary = 'A read/write client for Netbox v2.'
|
|
13
|
+
spec.homepage = 'https://github.com/ninech/netbox-client-ruby'
|
|
14
|
+
spec.license = 'MIT'
|
|
15
|
+
|
|
16
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
|
17
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
|
18
|
+
if spec.respond_to?(:metadata)
|
|
19
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
|
20
|
+
else
|
|
21
|
+
raise 'RubyGems 2.0 or newer is required to protect against ' \
|
|
22
|
+
'public gem pushes.'
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
26
|
+
f.match(%r{^(test|spec|features)/})
|
|
27
|
+
end
|
|
28
|
+
spec.bindir = 'exe'
|
|
29
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
30
|
+
spec.require_paths = ['lib']
|
|
31
|
+
|
|
32
|
+
spec.add_runtime_dependency 'dry-configurable', '~> 0.1'
|
|
33
|
+
spec.add_runtime_dependency 'faraday', '~> 0.12'
|
|
34
|
+
spec.add_runtime_dependency 'faraday_middleware', '~> 0.11.0'
|
|
35
|
+
spec.add_runtime_dependency 'faraday-detailed_logger', '~> 2.1'
|
|
36
|
+
|
|
37
|
+
spec.add_development_dependency 'bundler', '~> 1.14'
|
|
38
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
|
39
|
+
spec.add_development_dependency 'rspec', '~> 3.5'
|
|
40
|
+
spec.add_development_dependency 'pry', '~> 0.10'
|
|
41
|
+
spec.add_development_dependency 'rubocop', '~> 0.48'
|
|
42
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 1.15'
|
|
43
|
+
end
|
data/netbox.env
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
SUPERUSER_NAME=admin
|
|
2
|
+
SUPERUSER_EMAIL=admin@example.com
|
|
3
|
+
SUPERUSER_PASSWORD=admin
|
|
4
|
+
ALLOWED_HOSTS=localhost
|
|
5
|
+
DB_NAME=netbox
|
|
6
|
+
DB_USER=netbox
|
|
7
|
+
DB_PASSWORD=netbox
|
|
8
|
+
DB_HOST=postgres
|
|
9
|
+
SECRET_KEY=ooJee8UHaej7bie4ji8ahng3Pi6Sha
|
|
10
|
+
EMAIL_SERVER=localhost
|
|
11
|
+
EMAIL_PORT=25
|
|
12
|
+
EMAIL_USERNAME=foo
|
|
13
|
+
EMAIL_PASSWORD=bar
|
|
14
|
+
EMAIL_TIMEOUT=10
|
|
15
|
+
EMAIL_FROM=netbox@bar.com
|
|
16
|
+
NETBOX_USERNAME=guest
|
|
17
|
+
NETBOX_PASSWORD=guest
|
metadata
ADDED
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: netbox-client-ruby
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Christian Mäder
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: exe
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2017-05-08 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: dry-configurable
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '0.1'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '0.1'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: faraday
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '0.12'
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '0.12'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: faraday_middleware
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: 0.11.0
|
|
48
|
+
type: :runtime
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: 0.11.0
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: faraday-detailed_logger
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - "~>"
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '2.1'
|
|
62
|
+
type: :runtime
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - "~>"
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '2.1'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: bundler
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - "~>"
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '1.14'
|
|
76
|
+
type: :development
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - "~>"
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '1.14'
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: rake
|
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - "~>"
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: '10.0'
|
|
90
|
+
type: :development
|
|
91
|
+
prerelease: false
|
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - "~>"
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: '10.0'
|
|
97
|
+
- !ruby/object:Gem::Dependency
|
|
98
|
+
name: rspec
|
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
|
100
|
+
requirements:
|
|
101
|
+
- - "~>"
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: '3.5'
|
|
104
|
+
type: :development
|
|
105
|
+
prerelease: false
|
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
+
requirements:
|
|
108
|
+
- - "~>"
|
|
109
|
+
- !ruby/object:Gem::Version
|
|
110
|
+
version: '3.5'
|
|
111
|
+
- !ruby/object:Gem::Dependency
|
|
112
|
+
name: pry
|
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
|
114
|
+
requirements:
|
|
115
|
+
- - "~>"
|
|
116
|
+
- !ruby/object:Gem::Version
|
|
117
|
+
version: '0.10'
|
|
118
|
+
type: :development
|
|
119
|
+
prerelease: false
|
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
+
requirements:
|
|
122
|
+
- - "~>"
|
|
123
|
+
- !ruby/object:Gem::Version
|
|
124
|
+
version: '0.10'
|
|
125
|
+
- !ruby/object:Gem::Dependency
|
|
126
|
+
name: rubocop
|
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
|
128
|
+
requirements:
|
|
129
|
+
- - "~>"
|
|
130
|
+
- !ruby/object:Gem::Version
|
|
131
|
+
version: '0.48'
|
|
132
|
+
type: :development
|
|
133
|
+
prerelease: false
|
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
135
|
+
requirements:
|
|
136
|
+
- - "~>"
|
|
137
|
+
- !ruby/object:Gem::Version
|
|
138
|
+
version: '0.48'
|
|
139
|
+
- !ruby/object:Gem::Dependency
|
|
140
|
+
name: rubocop-rspec
|
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
|
142
|
+
requirements:
|
|
143
|
+
- - "~>"
|
|
144
|
+
- !ruby/object:Gem::Version
|
|
145
|
+
version: '1.15'
|
|
146
|
+
type: :development
|
|
147
|
+
prerelease: false
|
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
149
|
+
requirements:
|
|
150
|
+
- - "~>"
|
|
151
|
+
- !ruby/object:Gem::Version
|
|
152
|
+
version: '1.15'
|
|
153
|
+
description:
|
|
154
|
+
email:
|
|
155
|
+
- christian.maeder@nine.ch
|
|
156
|
+
executables: []
|
|
157
|
+
extensions: []
|
|
158
|
+
extra_rdoc_files: []
|
|
159
|
+
files:
|
|
160
|
+
- ".gitignore"
|
|
161
|
+
- ".rspec"
|
|
162
|
+
- ".ruby-version"
|
|
163
|
+
- ".travis.yml"
|
|
164
|
+
- Dockerfile
|
|
165
|
+
- Gemfile
|
|
166
|
+
- Gemfile.lock
|
|
167
|
+
- LICENSE.txt
|
|
168
|
+
- README.md
|
|
169
|
+
- Rakefile
|
|
170
|
+
- VERSION
|
|
171
|
+
- bin/console
|
|
172
|
+
- bin/setup
|
|
173
|
+
- docker-compose.test.yml
|
|
174
|
+
- docker-compose.yml
|
|
175
|
+
- docker/start.sh
|
|
176
|
+
- docker/start.test.sh
|
|
177
|
+
- lib/netbox-client-ruby.rb
|
|
178
|
+
- lib/netbox_client_ruby.rb
|
|
179
|
+
- lib/netbox_client_ruby/api.rb
|
|
180
|
+
- lib/netbox_client_ruby/api/dcim.rb
|
|
181
|
+
- lib/netbox_client_ruby/api/dcim/device.rb
|
|
182
|
+
- lib/netbox_client_ruby/api/dcim/device_role.rb
|
|
183
|
+
- lib/netbox_client_ruby/api/dcim/device_roles.rb
|
|
184
|
+
- lib/netbox_client_ruby/api/dcim/device_type.rb
|
|
185
|
+
- lib/netbox_client_ruby/api/dcim/device_types.rb
|
|
186
|
+
- lib/netbox_client_ruby/api/dcim/devices.rb
|
|
187
|
+
- lib/netbox_client_ruby/api/dcim/interface.rb
|
|
188
|
+
- lib/netbox_client_ruby/api/dcim/interfaces.rb
|
|
189
|
+
- lib/netbox_client_ruby/api/dcim/manufacturer.rb
|
|
190
|
+
- lib/netbox_client_ruby/api/dcim/manufacturers.rb
|
|
191
|
+
- lib/netbox_client_ruby/api/dcim/platform.rb
|
|
192
|
+
- lib/netbox_client_ruby/api/dcim/platforms.rb
|
|
193
|
+
- lib/netbox_client_ruby/api/dcim/rack.rb
|
|
194
|
+
- lib/netbox_client_ruby/api/dcim/racks.rb
|
|
195
|
+
- lib/netbox_client_ruby/api/dcim/region.rb
|
|
196
|
+
- lib/netbox_client_ruby/api/dcim/regions.rb
|
|
197
|
+
- lib/netbox_client_ruby/api/dcim/site.rb
|
|
198
|
+
- lib/netbox_client_ruby/api/dcim/sites.rb
|
|
199
|
+
- lib/netbox_client_ruby/api/ipam.rb
|
|
200
|
+
- lib/netbox_client_ruby/api/ipam/aggregate.rb
|
|
201
|
+
- lib/netbox_client_ruby/api/ipam/aggregates.rb
|
|
202
|
+
- lib/netbox_client_ruby/api/ipam/ip_address.rb
|
|
203
|
+
- lib/netbox_client_ruby/api/ipam/ip_addresses.rb
|
|
204
|
+
- lib/netbox_client_ruby/api/ipam/prefix.rb
|
|
205
|
+
- lib/netbox_client_ruby/api/ipam/prefixes.rb
|
|
206
|
+
- lib/netbox_client_ruby/api/ipam/rir.rb
|
|
207
|
+
- lib/netbox_client_ruby/api/ipam/rirs.rb
|
|
208
|
+
- lib/netbox_client_ruby/api/ipam/role.rb
|
|
209
|
+
- lib/netbox_client_ruby/api/ipam/roles.rb
|
|
210
|
+
- lib/netbox_client_ruby/api/ipam/vlan.rb
|
|
211
|
+
- lib/netbox_client_ruby/api/ipam/vlan_group.rb
|
|
212
|
+
- lib/netbox_client_ruby/api/ipam/vlan_groups.rb
|
|
213
|
+
- lib/netbox_client_ruby/api/ipam/vlans.rb
|
|
214
|
+
- lib/netbox_client_ruby/api/ipam/vrf.rb
|
|
215
|
+
- lib/netbox_client_ruby/api/ipam/vrfs.rb
|
|
216
|
+
- lib/netbox_client_ruby/api/tenancy.rb
|
|
217
|
+
- lib/netbox_client_ruby/api/tenancy/tenant.rb
|
|
218
|
+
- lib/netbox_client_ruby/api/tenancy/tenant_group.rb
|
|
219
|
+
- lib/netbox_client_ruby/api/tenancy/tenant_groups.rb
|
|
220
|
+
- lib/netbox_client_ruby/api/tenancy/tenants.rb
|
|
221
|
+
- lib/netbox_client_ruby/communication.rb
|
|
222
|
+
- lib/netbox_client_ruby/connection.rb
|
|
223
|
+
- lib/netbox_client_ruby/entities.rb
|
|
224
|
+
- lib/netbox_client_ruby/entity.rb
|
|
225
|
+
- lib/netbox_client_ruby/error/client_error.rb
|
|
226
|
+
- lib/netbox_client_ruby/error/local_error.rb
|
|
227
|
+
- lib/netbox_client_ruby/error/remote_error.rb
|
|
228
|
+
- netbox-client-ruby.gemspec
|
|
229
|
+
- netbox.env
|
|
230
|
+
homepage: https://github.com/ninech/netbox-client-ruby
|
|
231
|
+
licenses:
|
|
232
|
+
- MIT
|
|
233
|
+
metadata:
|
|
234
|
+
allowed_push_host: https://rubygems.org
|
|
235
|
+
post_install_message:
|
|
236
|
+
rdoc_options: []
|
|
237
|
+
require_paths:
|
|
238
|
+
- lib
|
|
239
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
240
|
+
requirements:
|
|
241
|
+
- - ">="
|
|
242
|
+
- !ruby/object:Gem::Version
|
|
243
|
+
version: '0'
|
|
244
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
245
|
+
requirements:
|
|
246
|
+
- - ">="
|
|
247
|
+
- !ruby/object:Gem::Version
|
|
248
|
+
version: '0'
|
|
249
|
+
requirements: []
|
|
250
|
+
rubyforge_project:
|
|
251
|
+
rubygems_version: 2.5.2
|
|
252
|
+
signing_key:
|
|
253
|
+
specification_version: 4
|
|
254
|
+
summary: A read/write client for Netbox v2.
|
|
255
|
+
test_files: []
|