netbox-client-ruby 0.7.1 → 0.9.0
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 +4 -4
- data/.github/workflows/gem-push.yml +1 -1
- data/.github/workflows/rspec.yml +2 -1
- data/Dockerfile +1 -1
- data/README.md +1 -0
- data/VERSION +1 -1
- data/docker-compose.test.yml +5 -5
- data/dump.sql +7 -4
- data/lib/netbox_client_ruby/api/ipam/service.rb +31 -0
- data/lib/netbox_client_ruby/api/ipam/services.rb +21 -0
- data/lib/netbox_client_ruby/api/ipam.rb +4 -2
- data/netbox-client-ruby.gemspec +3 -3
- metadata +10 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cc8d383718b668854ea67169e97cfcc91a2a2b44f61fc03a9a169ec9af3484a
|
4
|
+
data.tar.gz: 5974995a14be30b0245f6653aaa1d58c310ba05d634e094522533d6bf344d64d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2dc728a2320243c24729809d73acc581f78cabc7aab52afb2037e7716c4726a1d2faa30e87c463369fd0b837f32013631cbc1cce0503f7e68d70e3457f5dcb78
|
7
|
+
data.tar.gz: e21e87d7a1dc35cbd572ff05ac2bd18820b9fa10537f2c53bd7502b2f8e90f94d95cdeddf77cc0dbb53ee67764f55cdc208a52ef760a1aba9aced81061cd0fae
|
data/.github/workflows/rspec.yml
CHANGED
@@ -14,7 +14,8 @@ jobs:
|
|
14
14
|
fail-fast: false
|
15
15
|
matrix:
|
16
16
|
os: [ubuntu-latest]
|
17
|
-
|
17
|
+
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
|
18
|
+
ruby: ["2.7", "3.0"]
|
18
19
|
runs-on: ${{ matrix.os }}
|
19
20
|
steps:
|
20
21
|
- uses: actions/checkout@v2
|
data/Dockerfile
CHANGED
data/README.md
CHANGED
@@ -173,6 +173,7 @@ Not all objects which the Netbox API exposes are currently implemented. Implemen
|
|
173
173
|
* Prefixes: `NetboxClientRuby.ipam.prefixes`
|
174
174
|
* RIRs: `NetboxClientRuby.ipam.rirs`
|
175
175
|
* Roles: `NetboxClientRuby.ipam.roles`
|
176
|
+
* Services: `NetboxClientRuby.ipam.services`
|
176
177
|
* VLANs: `NetboxClientRuby.ipam.vlans`
|
177
178
|
* VLAN Groups: `NetboxClientRuby.ipam.vlan_groups`
|
178
179
|
* VRFs: `NetboxClientRuby.ipam.vrfs`
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.9.0
|
data/docker-compose.test.yml
CHANGED
@@ -4,13 +4,13 @@ services:
|
|
4
4
|
build:
|
5
5
|
context: .
|
6
6
|
args:
|
7
|
-
RUBY_VERSION: 2.
|
8
|
-
image: netbox-client-ruby:2.
|
7
|
+
RUBY_VERSION: 3.2.2
|
8
|
+
image: netbox-client-ruby:3.2.2
|
9
9
|
command: 'docker/start.test.sh'
|
10
|
-
|
10
|
+
app27:
|
11
11
|
build:
|
12
12
|
context: .
|
13
13
|
args:
|
14
|
-
RUBY_VERSION: 2.
|
15
|
-
image: netbox-client-ruby:2.
|
14
|
+
RUBY_VERSION: 2.7.8
|
15
|
+
image: netbox-client-ruby:2.7.8
|
16
16
|
command: 'docker/start.test.sh'
|
data/dump.sql
CHANGED
@@ -5187,6 +5187,7 @@ COPY public.ipam_role (id, name, slug, weight, created, last_updated) FROM stdin
|
|
5187
5187
|
--
|
5188
5188
|
|
5189
5189
|
COPY public.ipam_service (id, created, last_updated, name, protocol, port, description, device_id, virtual_machine_id) FROM stdin;
|
5190
|
+
1 2023-04-23 2023-04-23 15:44:58.595982+00 Service 0 6 443 This is Description \N 1
|
5190
5191
|
\.
|
5191
5192
|
|
5192
5193
|
|
@@ -5195,6 +5196,7 @@ COPY public.ipam_service (id, created, last_updated, name, protocol, port, descr
|
|
5195
5196
|
--
|
5196
5197
|
|
5197
5198
|
COPY public.ipam_service_ipaddresses (id, service_id, ipaddress_id) FROM stdin;
|
5199
|
+
1 1 4
|
5198
5200
|
\.
|
5199
5201
|
|
5200
5202
|
|
@@ -5326,6 +5328,7 @@ COPY public.taggit_taggeditem (id, object_id, content_type_id, tag_id) FROM stdi
|
|
5326
5328
|
32 1 9 4
|
5327
5329
|
33 1 11 5
|
5328
5330
|
34 8 17 9
|
5331
|
+
35 1 47 5
|
5329
5332
|
\.
|
5330
5333
|
|
5331
5334
|
|
@@ -5774,7 +5777,7 @@ SELECT pg_catalog.setval('public.extras_imageattachment_id_seq', 1, false);
|
|
5774
5777
|
-- Name: extras_objectchange_id_seq; Type: SEQUENCE SET; Schema: public; Owner: netbox
|
5775
5778
|
--
|
5776
5779
|
|
5777
|
-
SELECT pg_catalog.setval('public.extras_objectchange_id_seq',
|
5780
|
+
SELECT pg_catalog.setval('public.extras_objectchange_id_seq', 319, true);
|
5778
5781
|
|
5779
5782
|
|
5780
5783
|
--
|
@@ -5851,14 +5854,14 @@ SELECT pg_catalog.setval('public.ipam_role_id_seq', 1, true);
|
|
5851
5854
|
-- Name: ipam_service_id_seq; Type: SEQUENCE SET; Schema: public; Owner: netbox
|
5852
5855
|
--
|
5853
5856
|
|
5854
|
-
SELECT pg_catalog.setval('public.ipam_service_id_seq', 1,
|
5857
|
+
SELECT pg_catalog.setval('public.ipam_service_id_seq', 1, true);
|
5855
5858
|
|
5856
5859
|
|
5857
5860
|
--
|
5858
5861
|
-- Name: ipam_service_ipaddresses_id_seq; Type: SEQUENCE SET; Schema: public; Owner: netbox
|
5859
5862
|
--
|
5860
5863
|
|
5861
|
-
SELECT pg_catalog.setval('public.ipam_service_ipaddresses_id_seq', 1,
|
5864
|
+
SELECT pg_catalog.setval('public.ipam_service_ipaddresses_id_seq', 1, true);
|
5862
5865
|
|
5863
5866
|
|
5864
5867
|
--
|
@@ -5935,7 +5938,7 @@ SELECT pg_catalog.setval('public.taggit_tag_id_seq', 9, true);
|
|
5935
5938
|
-- Name: taggit_taggeditem_id_seq; Type: SEQUENCE SET; Schema: public; Owner: netbox
|
5936
5939
|
--
|
5937
5940
|
|
5938
|
-
SELECT pg_catalog.setval('public.taggit_taggeditem_id_seq',
|
5941
|
+
SELECT pg_catalog.setval('public.taggit_taggeditem_id_seq', 35, true);
|
5939
5942
|
|
5940
5943
|
|
5941
5944
|
--
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'netbox_client_ruby/entity'
|
2
|
+
require 'netbox_client_ruby/api/ipam/ip_address'
|
3
|
+
|
4
|
+
module NetboxClientRuby
|
5
|
+
module IPAM
|
6
|
+
class Service
|
7
|
+
include Entity
|
8
|
+
|
9
|
+
id id: :id
|
10
|
+
deletable true
|
11
|
+
path 'ipam/services/:id.json'
|
12
|
+
creation_path 'ipam/services/'
|
13
|
+
object_fields(
|
14
|
+
device: proc { |raw_data| Device.new raw_data['id'] },
|
15
|
+
virtual_machine: proc { |raw_data| VirtualMachine.new raw_data['id'] },
|
16
|
+
protocol: proc { |raw_data| ServiceProtocol.new raw_data },
|
17
|
+
ipaddresses: proc { |raw_data| IpAddress.new raw_data['id'] }
|
18
|
+
)
|
19
|
+
readonly_fields :display_name
|
20
|
+
end
|
21
|
+
|
22
|
+
class ServiceProtocol
|
23
|
+
attr_reader :value, :label
|
24
|
+
|
25
|
+
def initialize(raw_data)
|
26
|
+
@value = raw_data['value']
|
27
|
+
@label = raw_data['label']
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'netbox_client_ruby/entities'
|
2
|
+
require 'netbox_client_ruby/api/ipam/service'
|
3
|
+
|
4
|
+
module NetboxClientRuby
|
5
|
+
module IPAM
|
6
|
+
class Services
|
7
|
+
include Entities
|
8
|
+
|
9
|
+
path 'ipam/services.json'
|
10
|
+
data_key 'results'
|
11
|
+
count_key 'count'
|
12
|
+
entity_creator :entity_creator
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def entity_creator(raw_entity)
|
17
|
+
Service.new raw_entity['id']
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -10,8 +10,8 @@ require 'netbox_client_ruby/api/ipam/rir'
|
|
10
10
|
require 'netbox_client_ruby/api/ipam/rirs'
|
11
11
|
require 'netbox_client_ruby/api/ipam/role'
|
12
12
|
require 'netbox_client_ruby/api/ipam/roles'
|
13
|
-
|
14
|
-
|
13
|
+
require 'netbox_client_ruby/api/ipam/service'
|
14
|
+
require 'netbox_client_ruby/api/ipam/services'
|
15
15
|
require 'netbox_client_ruby/api/ipam/vlan_group'
|
16
16
|
require 'netbox_client_ruby/api/ipam/vlan_groups'
|
17
17
|
require 'netbox_client_ruby/api/ipam/vlan'
|
@@ -29,6 +29,7 @@ module NetboxClientRuby
|
|
29
29
|
prefixes: Prefixes,
|
30
30
|
rirs: Rirs,
|
31
31
|
roles: Roles,
|
32
|
+
services: Services,
|
32
33
|
vlans: Vlans,
|
33
34
|
vlan_groups: VlanGroups,
|
34
35
|
vrfs: Vrfs
|
@@ -44,6 +45,7 @@ module NetboxClientRuby
|
|
44
45
|
prefix: Prefix,
|
45
46
|
rir: Rir,
|
46
47
|
role: Role,
|
48
|
+
service: Service,
|
47
49
|
vlan: Vlan,
|
48
50
|
vlan_group: VlanGroup,
|
49
51
|
vrf: Vrf
|
data/netbox-client-ruby.gemspec
CHANGED
@@ -23,9 +23,9 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
24
|
spec.require_paths = ['lib']
|
25
25
|
|
26
|
-
spec.required_ruby_version = '>= 2.
|
26
|
+
spec.required_ruby_version = '>= 2.7.0'
|
27
27
|
|
28
|
-
spec.add_runtime_dependency 'dry-configurable', '~>
|
28
|
+
spec.add_runtime_dependency 'dry-configurable', '~> 1'
|
29
29
|
spec.add_runtime_dependency 'faraday', '>= 0.11.0', '< 2'
|
30
30
|
spec.add_runtime_dependency 'faraday-detailed_logger', '~> 2.1'
|
31
31
|
spec.add_runtime_dependency 'faraday_middleware', '>= 0.11', '< 2'
|
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
|
|
34
34
|
|
35
35
|
spec.add_development_dependency 'bundler', '~> 2.1'
|
36
36
|
spec.add_development_dependency 'pry', '~> 0.10'
|
37
|
-
spec.add_development_dependency 'rake', '~>
|
37
|
+
spec.add_development_dependency 'rake', '~> 13'
|
38
38
|
spec.add_development_dependency 'rspec', '~> 3.5'
|
39
39
|
spec.add_development_dependency 'rubocop', '~> 0.48'
|
40
40
|
spec.add_development_dependency 'rubocop-rspec', '~> 1.15'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: netbox-client-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Mäder
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-configurable
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: '1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: '1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: faraday
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -146,14 +146,14 @@ dependencies:
|
|
146
146
|
requirements:
|
147
147
|
- - "~>"
|
148
148
|
- !ruby/object:Gem::Version
|
149
|
-
version: '
|
149
|
+
version: '13'
|
150
150
|
type: :development
|
151
151
|
prerelease: false
|
152
152
|
version_requirements: !ruby/object:Gem::Requirement
|
153
153
|
requirements:
|
154
154
|
- - "~>"
|
155
155
|
- !ruby/object:Gem::Version
|
156
|
-
version: '
|
156
|
+
version: '13'
|
157
157
|
- !ruby/object:Gem::Dependency
|
158
158
|
name: rspec
|
159
159
|
requirement: !ruby/object:Gem::Requirement
|
@@ -297,6 +297,8 @@ files:
|
|
297
297
|
- lib/netbox_client_ruby/api/ipam/rirs.rb
|
298
298
|
- lib/netbox_client_ruby/api/ipam/role.rb
|
299
299
|
- lib/netbox_client_ruby/api/ipam/roles.rb
|
300
|
+
- lib/netbox_client_ruby/api/ipam/service.rb
|
301
|
+
- lib/netbox_client_ruby/api/ipam/services.rb
|
300
302
|
- lib/netbox_client_ruby/api/ipam/vlan.rb
|
301
303
|
- lib/netbox_client_ruby/api/ipam/vlan_group.rb
|
302
304
|
- lib/netbox_client_ruby/api/ipam/vlan_groups.rb
|
@@ -350,14 +352,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
350
352
|
requirements:
|
351
353
|
- - ">="
|
352
354
|
- !ruby/object:Gem::Version
|
353
|
-
version: 2.
|
355
|
+
version: 2.7.0
|
354
356
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
355
357
|
requirements:
|
356
358
|
- - ">="
|
357
359
|
- !ruby/object:Gem::Version
|
358
360
|
version: '0'
|
359
361
|
requirements: []
|
360
|
-
rubygems_version: 3.
|
362
|
+
rubygems_version: 3.4.10
|
361
363
|
signing_key:
|
362
364
|
specification_version: 4
|
363
365
|
summary: A read/write client for Netbox v2.
|