netbox-client-ruby 0.8.0 → 0.10.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a9535356ec28f6b98e36cbe9716a17a6a3274c3aa8fa61c94546d83259863ef4
4
- data.tar.gz: 88fd17466447a4dc38f61d05b94ac3ead97662b2de1d9b7e59b52be2e50e9f0a
3
+ metadata.gz: ec7ff93496769653e21eea7c3f04b184890fb7babdc00ea8f0f8173cc7040470
4
+ data.tar.gz: ff23b46b13f2f849dd3b4b3465ff42ead9b771ff5a064a6aa27d9582031b4f4a
5
5
  SHA512:
6
- metadata.gz: 1e70efad1051fd7f8f50d707cabf92ff3549048459b447987695f4b7ba3ef023fcd827dcce076070ab7821b22a1f636505fd6a21ffc0e7632f5b233365ace673
7
- data.tar.gz: 1cb160fa098d2a08420bbd972d67ee7d5e3ab885c43484b44625dd0938aca2bd1a060ed7c494d7351d187fe6851296a2b549d0eabee1962396418f1b48aef9ed
6
+ metadata.gz: 2f2437ae2ecb563e586b62ac05a852f6726f46d2e117373ebf0381b6b9e615906fe74504ea5898036380c08ed98b8b2b72e04095ed3b9649303f9859fa0f7da8
7
+ data.tar.gz: e8ab26e54501488a91c0bc1544c2cfb8c7b79801bb6e73fa87c0c3351d24481b2a07b87ae369dab263f2b3bd7450c035a179d959f443032fdc943cf48e14a8a3
@@ -15,12 +15,29 @@ jobs:
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
+ ruby: ['2.7', '3.0', '3.1', '3.2']
19
+ gemfile:
20
+ [
21
+ 'Gemfile',
22
+ 'gemfiles/faraday0.gemfile',
23
+ 'gemfiles/faraday1.gemfile',
24
+ 'gemfiles/faraday2.gemfile',
25
+ ]
26
+ # Faraday 0.x with Ruby 3.x not supported
27
+ exclude:
28
+ - ruby: '3.0'
29
+ gemfile: gemfiles/faraday0.gemfile
30
+ - ruby: '3.1'
31
+ gemfile: gemfiles/faraday0.gemfile
32
+ - ruby: '3.2'
33
+ gemfile: gemfiles/faraday0.gemfile
19
34
  runs-on: ${{ matrix.os }}
35
+ env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
36
+ BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}
20
37
  steps:
21
- - uses: actions/checkout@v2
22
- - uses: ruby/setup-ruby@v1
23
- with:
24
- ruby-version: ${{ matrix.ruby }}
25
- bundler-cache: true
26
- - run: bundle exec rake spec
38
+ - uses: actions/checkout@v2
39
+ - uses: ruby/setup-ruby@v1
40
+ with:
41
+ ruby-version: ${{ matrix.ruby }}
42
+ bundler-cache: true
43
+ - run: bundle exec rake spec
data/.gitignore CHANGED
@@ -14,4 +14,3 @@ quickstart.rb
14
14
  *.gz
15
15
 
16
16
  /vendor/
17
- Gemfile.lock
data/Gemfile CHANGED
@@ -1,4 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ gem "faraday", "~> 1.10"
4
+ gem "faraday_middleware"
5
+
3
6
  # Specify your gem dependencies in netbox-client-ruby.gemspec
4
7
  gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,115 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ netbox-client-ruby (0.9.0)
5
+ dry-configurable (~> 1)
6
+ faraday (>= 0.11.0, < 3)
7
+ faraday-detailed_logger (~> 2.1)
8
+ ipaddress (~> 0.8, >= 0.8.3)
9
+ openssl (>= 2.0.5)
10
+
11
+ GEM
12
+ remote: https://rubygems.org/
13
+ specs:
14
+ ast (2.4.2)
15
+ coderay (1.1.3)
16
+ concurrent-ruby (1.2.2)
17
+ diff-lcs (1.5.0)
18
+ dry-configurable (1.0.1)
19
+ dry-core (~> 1.0, < 2)
20
+ zeitwerk (~> 2.6)
21
+ dry-core (1.0.0)
22
+ concurrent-ruby (~> 1.0)
23
+ zeitwerk (~> 2.6)
24
+ faraday (1.10.3)
25
+ faraday-em_http (~> 1.0)
26
+ faraday-em_synchrony (~> 1.0)
27
+ faraday-excon (~> 1.1)
28
+ faraday-httpclient (~> 1.0)
29
+ faraday-multipart (~> 1.0)
30
+ faraday-net_http (~> 1.0)
31
+ faraday-net_http_persistent (~> 1.0)
32
+ faraday-patron (~> 1.0)
33
+ faraday-rack (~> 1.0)
34
+ faraday-retry (~> 1.0)
35
+ ruby2_keywords (>= 0.0.4)
36
+ faraday-detailed_logger (2.5.0)
37
+ faraday (>= 0.16, < 3)
38
+ faraday-em_http (1.0.0)
39
+ faraday-em_synchrony (1.0.0)
40
+ faraday-excon (1.1.0)
41
+ faraday-httpclient (1.0.1)
42
+ faraday-multipart (1.0.4)
43
+ multipart-post (~> 2)
44
+ faraday-net_http (1.0.1)
45
+ faraday-net_http_persistent (1.2.0)
46
+ faraday-patron (1.0.0)
47
+ faraday-rack (1.0.0)
48
+ faraday-retry (1.0.3)
49
+ faraday_middleware (1.2.0)
50
+ faraday (~> 1.0)
51
+ ipaddress (0.8.3)
52
+ method_source (1.0.0)
53
+ multipart-post (2.3.0)
54
+ openssl (3.2.0)
55
+ parallel (1.23.0)
56
+ parser (3.2.2.3)
57
+ ast (~> 2.4.1)
58
+ racc
59
+ pry (0.14.2)
60
+ coderay (~> 1.1)
61
+ method_source (~> 1.0)
62
+ racc (1.7.1)
63
+ rainbow (3.1.1)
64
+ rake (13.0.6)
65
+ regexp_parser (2.8.1)
66
+ rexml (3.2.6)
67
+ rspec (3.12.0)
68
+ rspec-core (~> 3.12.0)
69
+ rspec-expectations (~> 3.12.0)
70
+ rspec-mocks (~> 3.12.0)
71
+ rspec-core (3.12.2)
72
+ rspec-support (~> 3.12.0)
73
+ rspec-expectations (3.12.3)
74
+ diff-lcs (>= 1.2.0, < 2.0)
75
+ rspec-support (~> 3.12.0)
76
+ rspec-mocks (3.12.6)
77
+ diff-lcs (>= 1.2.0, < 2.0)
78
+ rspec-support (~> 3.12.0)
79
+ rspec-support (3.12.1)
80
+ rubocop (0.93.1)
81
+ parallel (~> 1.10)
82
+ parser (>= 2.7.1.5)
83
+ rainbow (>= 2.2.2, < 4.0)
84
+ regexp_parser (>= 1.8)
85
+ rexml
86
+ rubocop-ast (>= 0.6.0)
87
+ ruby-progressbar (~> 1.7)
88
+ unicode-display_width (>= 1.4.0, < 2.0)
89
+ rubocop-ast (1.29.0)
90
+ parser (>= 3.2.1.0)
91
+ rubocop-rspec (1.44.1)
92
+ rubocop (~> 0.87)
93
+ rubocop-ast (>= 0.7.1)
94
+ ruby-progressbar (1.13.0)
95
+ ruby2_keywords (0.0.5)
96
+ unicode-display_width (1.8.0)
97
+ zeitwerk (2.6.12)
98
+
99
+ PLATFORMS
100
+ arm64-darwin-22
101
+ x86_64-linux
102
+
103
+ DEPENDENCIES
104
+ bundler (~> 2.1)
105
+ faraday (~> 1.10)
106
+ faraday_middleware
107
+ netbox-client-ruby!
108
+ pry (~> 0.10)
109
+ rake (~> 13)
110
+ rspec (~> 3.5)
111
+ rubocop (~> 0.48)
112
+ rubocop-rspec (~> 1.15)
113
+
114
+ BUNDLED WITH
115
+ 2.4.10
data/README.md CHANGED
@@ -15,6 +15,12 @@ Add this line to your application's Gemfile:
15
15
  gem 'netbox-client-ruby'
16
16
  ```
17
17
 
18
+ If your application already uses Faraday 0.x or 1.x and you cannot otherwise upgrade to Faraday 2, you must also add this line to your application's Gemfile:
19
+
20
+ ```ruby
21
+ gem 'faraday_middleware' # remove when upgrading to Faraday 2+
22
+ ```
23
+
18
24
  And then execute:
19
25
 
20
26
  $ bundle
@@ -173,6 +179,7 @@ Not all objects which the Netbox API exposes are currently implemented. Implemen
173
179
  * Prefixes: `NetboxClientRuby.ipam.prefixes`
174
180
  * RIRs: `NetboxClientRuby.ipam.rirs`
175
181
  * Roles: `NetboxClientRuby.ipam.roles`
182
+ * Services: `NetboxClientRuby.ipam.services`
176
183
  * VLANs: `NetboxClientRuby.ipam.vlans`
177
184
  * VLAN Groups: `NetboxClientRuby.ipam.vlan_groups`
178
185
  * VRFs: `NetboxClientRuby.ipam.vrfs`
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.0
1
+ 0.10.0
data/bin/setup CHANGED
@@ -5,4 +5,6 @@ set -vx
5
5
 
6
6
  bundle install
7
7
 
8
- # Do any other automated setup that you need to do here
8
+ for filename in gemfiles/*.gemfile; do
9
+ BUNDLE_GEMFILE=$filename bundle install
10
+ done
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', 318, true);
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, false);
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, false);
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', 34, true);
5941
+ SELECT pg_catalog.setval('public.taggit_taggeditem_id_seq', 35, true);
5939
5942
 
5940
5943
 
5941
5944
  --
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "faraday", "= 0.11"
4
+ gem "faraday_middleware", "< 1"
5
+
6
+ gemspec path: ".."
@@ -0,0 +1,94 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ netbox-client-ruby (0.9.0)
5
+ dry-configurable (~> 1)
6
+ faraday (>= 0.11.0, < 3)
7
+ faraday-detailed_logger (~> 2.1)
8
+ ipaddress (~> 0.8, >= 0.8.3)
9
+ openssl (>= 2.0.5)
10
+
11
+ GEM
12
+ remote: https://rubygems.org/
13
+ specs:
14
+ ast (2.4.2)
15
+ coderay (1.1.3)
16
+ concurrent-ruby (1.2.2)
17
+ diff-lcs (1.5.0)
18
+ dry-configurable (1.0.1)
19
+ dry-core (~> 1.0, < 2)
20
+ zeitwerk (~> 2.6)
21
+ dry-core (1.0.0)
22
+ concurrent-ruby (~> 1.0)
23
+ zeitwerk (~> 2.6)
24
+ faraday (0.11.0)
25
+ multipart-post (>= 1.2, < 3)
26
+ faraday-detailed_logger (2.4.0)
27
+ faraday (>= 0.8, < 2)
28
+ zeitwerk (~> 2.0)
29
+ faraday_middleware (0.14.0)
30
+ faraday (>= 0.7.4, < 1.0)
31
+ ipaddress (0.8.3)
32
+ method_source (1.0.0)
33
+ multipart-post (2.3.0)
34
+ openssl (3.2.0)
35
+ parallel (1.23.0)
36
+ parser (3.2.2.3)
37
+ ast (~> 2.4.1)
38
+ racc
39
+ pry (0.14.2)
40
+ coderay (~> 1.1)
41
+ method_source (~> 1.0)
42
+ racc (1.7.1)
43
+ rainbow (3.1.1)
44
+ rake (13.0.6)
45
+ regexp_parser (2.8.1)
46
+ rexml (3.2.6)
47
+ rspec (3.12.0)
48
+ rspec-core (~> 3.12.0)
49
+ rspec-expectations (~> 3.12.0)
50
+ rspec-mocks (~> 3.12.0)
51
+ rspec-core (3.12.2)
52
+ rspec-support (~> 3.12.0)
53
+ rspec-expectations (3.12.3)
54
+ diff-lcs (>= 1.2.0, < 2.0)
55
+ rspec-support (~> 3.12.0)
56
+ rspec-mocks (3.12.6)
57
+ diff-lcs (>= 1.2.0, < 2.0)
58
+ rspec-support (~> 3.12.0)
59
+ rspec-support (3.12.1)
60
+ rubocop (0.93.1)
61
+ parallel (~> 1.10)
62
+ parser (>= 2.7.1.5)
63
+ rainbow (>= 2.2.2, < 4.0)
64
+ regexp_parser (>= 1.8)
65
+ rexml
66
+ rubocop-ast (>= 0.6.0)
67
+ ruby-progressbar (~> 1.7)
68
+ unicode-display_width (>= 1.4.0, < 2.0)
69
+ rubocop-ast (1.29.0)
70
+ parser (>= 3.2.1.0)
71
+ rubocop-rspec (1.44.1)
72
+ rubocop (~> 0.87)
73
+ rubocop-ast (>= 0.7.1)
74
+ ruby-progressbar (1.13.0)
75
+ unicode-display_width (1.8.0)
76
+ zeitwerk (2.6.12)
77
+
78
+ PLATFORMS
79
+ arm64-darwin-22
80
+ x86_64-linux
81
+
82
+ DEPENDENCIES
83
+ bundler (~> 2.1)
84
+ faraday (= 0.11)
85
+ faraday_middleware (< 1)
86
+ netbox-client-ruby!
87
+ pry (~> 0.10)
88
+ rake (~> 13)
89
+ rspec (~> 3.5)
90
+ rubocop (~> 0.48)
91
+ rubocop-rspec (~> 1.15)
92
+
93
+ BUNDLED WITH
94
+ 2.4.10
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "faraday", "= 1.0"
4
+ gem "faraday_middleware", "< 2"
5
+
6
+ gemspec path: ".."
@@ -0,0 +1,93 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ netbox-client-ruby (0.9.0)
5
+ dry-configurable (~> 1)
6
+ faraday (>= 0.11.0, < 3)
7
+ faraday-detailed_logger (~> 2.1)
8
+ ipaddress (~> 0.8, >= 0.8.3)
9
+ openssl (>= 2.0.5)
10
+
11
+ GEM
12
+ remote: https://rubygems.org/
13
+ specs:
14
+ ast (2.4.2)
15
+ coderay (1.1.3)
16
+ concurrent-ruby (1.2.2)
17
+ diff-lcs (1.5.0)
18
+ dry-configurable (1.0.1)
19
+ dry-core (~> 1.0, < 2)
20
+ zeitwerk (~> 2.6)
21
+ dry-core (1.0.0)
22
+ concurrent-ruby (~> 1.0)
23
+ zeitwerk (~> 2.6)
24
+ faraday (1.0.0)
25
+ multipart-post (>= 1.2, < 3)
26
+ faraday-detailed_logger (2.5.0)
27
+ faraday (>= 0.16, < 3)
28
+ faraday_middleware (1.2.0)
29
+ faraday (~> 1.0)
30
+ ipaddress (0.8.3)
31
+ method_source (1.0.0)
32
+ multipart-post (2.3.0)
33
+ openssl (3.2.0)
34
+ parallel (1.23.0)
35
+ parser (3.2.2.3)
36
+ ast (~> 2.4.1)
37
+ racc
38
+ pry (0.14.2)
39
+ coderay (~> 1.1)
40
+ method_source (~> 1.0)
41
+ racc (1.7.1)
42
+ rainbow (3.1.1)
43
+ rake (13.0.6)
44
+ regexp_parser (2.8.1)
45
+ rexml (3.2.6)
46
+ rspec (3.12.0)
47
+ rspec-core (~> 3.12.0)
48
+ rspec-expectations (~> 3.12.0)
49
+ rspec-mocks (~> 3.12.0)
50
+ rspec-core (3.12.2)
51
+ rspec-support (~> 3.12.0)
52
+ rspec-expectations (3.12.3)
53
+ diff-lcs (>= 1.2.0, < 2.0)
54
+ rspec-support (~> 3.12.0)
55
+ rspec-mocks (3.12.6)
56
+ diff-lcs (>= 1.2.0, < 2.0)
57
+ rspec-support (~> 3.12.0)
58
+ rspec-support (3.12.1)
59
+ rubocop (0.93.1)
60
+ parallel (~> 1.10)
61
+ parser (>= 2.7.1.5)
62
+ rainbow (>= 2.2.2, < 4.0)
63
+ regexp_parser (>= 1.8)
64
+ rexml
65
+ rubocop-ast (>= 0.6.0)
66
+ ruby-progressbar (~> 1.7)
67
+ unicode-display_width (>= 1.4.0, < 2.0)
68
+ rubocop-ast (1.29.0)
69
+ parser (>= 3.2.1.0)
70
+ rubocop-rspec (1.44.1)
71
+ rubocop (~> 0.87)
72
+ rubocop-ast (>= 0.7.1)
73
+ ruby-progressbar (1.13.0)
74
+ unicode-display_width (1.8.0)
75
+ zeitwerk (2.6.12)
76
+
77
+ PLATFORMS
78
+ arm64-darwin-22
79
+ x86_64-linux
80
+
81
+ DEPENDENCIES
82
+ bundler (~> 2.1)
83
+ faraday (= 1.0)
84
+ faraday_middleware (< 2)
85
+ netbox-client-ruby!
86
+ pry (~> 0.10)
87
+ rake (~> 13)
88
+ rspec (~> 3.5)
89
+ rubocop (~> 0.48)
90
+ rubocop-rspec (~> 1.15)
91
+
92
+ BUNDLED WITH
93
+ 2.4.10
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "faraday", "< 3"
4
+ gem "faraday-net_http_persistent"
5
+
6
+ gemspec path: ".."
@@ -0,0 +1,101 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ netbox-client-ruby (0.9.0)
5
+ dry-configurable (~> 1)
6
+ faraday (>= 0.11.0, < 3)
7
+ faraday-detailed_logger (~> 2.1)
8
+ ipaddress (~> 0.8, >= 0.8.3)
9
+ openssl (>= 2.0.5)
10
+
11
+ GEM
12
+ remote: https://rubygems.org/
13
+ specs:
14
+ ast (2.4.2)
15
+ base64 (0.1.1)
16
+ coderay (1.1.3)
17
+ concurrent-ruby (1.2.2)
18
+ connection_pool (2.4.1)
19
+ diff-lcs (1.5.0)
20
+ dry-configurable (1.0.1)
21
+ dry-core (~> 1.0, < 2)
22
+ zeitwerk (~> 2.6)
23
+ dry-core (1.0.0)
24
+ concurrent-ruby (~> 1.0)
25
+ zeitwerk (~> 2.6)
26
+ faraday (2.7.11)
27
+ base64
28
+ faraday-net_http (>= 2.0, < 3.1)
29
+ ruby2_keywords (>= 0.0.4)
30
+ faraday-detailed_logger (2.5.0)
31
+ faraday (>= 0.16, < 3)
32
+ faraday-net_http (3.0.2)
33
+ faraday-net_http_persistent (2.1.0)
34
+ faraday (~> 2.5)
35
+ net-http-persistent (~> 4.0)
36
+ ipaddress (0.8.3)
37
+ method_source (1.0.0)
38
+ net-http-persistent (4.0.2)
39
+ connection_pool (~> 2.2)
40
+ openssl (3.2.0)
41
+ parallel (1.23.0)
42
+ parser (3.2.2.3)
43
+ ast (~> 2.4.1)
44
+ racc
45
+ pry (0.14.2)
46
+ coderay (~> 1.1)
47
+ method_source (~> 1.0)
48
+ racc (1.7.1)
49
+ rainbow (3.1.1)
50
+ rake (13.0.6)
51
+ regexp_parser (2.8.1)
52
+ rexml (3.2.6)
53
+ rspec (3.12.0)
54
+ rspec-core (~> 3.12.0)
55
+ rspec-expectations (~> 3.12.0)
56
+ rspec-mocks (~> 3.12.0)
57
+ rspec-core (3.12.2)
58
+ rspec-support (~> 3.12.0)
59
+ rspec-expectations (3.12.3)
60
+ diff-lcs (>= 1.2.0, < 2.0)
61
+ rspec-support (~> 3.12.0)
62
+ rspec-mocks (3.12.6)
63
+ diff-lcs (>= 1.2.0, < 2.0)
64
+ rspec-support (~> 3.12.0)
65
+ rspec-support (3.12.1)
66
+ rubocop (0.93.1)
67
+ parallel (~> 1.10)
68
+ parser (>= 2.7.1.5)
69
+ rainbow (>= 2.2.2, < 4.0)
70
+ regexp_parser (>= 1.8)
71
+ rexml
72
+ rubocop-ast (>= 0.6.0)
73
+ ruby-progressbar (~> 1.7)
74
+ unicode-display_width (>= 1.4.0, < 2.0)
75
+ rubocop-ast (1.29.0)
76
+ parser (>= 3.2.1.0)
77
+ rubocop-rspec (1.44.1)
78
+ rubocop (~> 0.87)
79
+ rubocop-ast (>= 0.7.1)
80
+ ruby-progressbar (1.13.0)
81
+ ruby2_keywords (0.0.5)
82
+ unicode-display_width (1.8.0)
83
+ zeitwerk (2.6.12)
84
+
85
+ PLATFORMS
86
+ arm64-darwin-22
87
+ x86_64-linux
88
+
89
+ DEPENDENCIES
90
+ bundler (~> 2.1)
91
+ faraday (< 3)
92
+ faraday-net_http_persistent
93
+ netbox-client-ruby!
94
+ pry (~> 0.10)
95
+ rake (~> 13)
96
+ rspec (~> 3.5)
97
+ rubocop (~> 0.48)
98
+ rubocop-rspec (~> 1.15)
99
+
100
+ BUNDLED WITH
101
+ 2.4.10
@@ -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
- # require 'netbox_client_ruby/api/ipam/service'
14
- # require 'netbox_client_ruby/api/ipam/services'
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
@@ -1,5 +1,4 @@
1
- require 'netbox_client_ruby/error/client_error'
2
- require 'netbox_client_ruby/error/remote_error'
1
+ require 'netbox_client_ruby/error'
3
2
  require 'netbox_client_ruby/connection'
4
3
 
5
4
  module NetboxClientRuby
@@ -1,7 +1,22 @@
1
1
  require 'faraday'
2
- require 'faraday_middleware'
3
2
  require 'faraday/detailed_logger'
4
- require 'netbox_client_ruby/error/local_error'
3
+ require 'netbox_client_ruby/error'
4
+
5
+ if Faraday::VERSION < '2'
6
+ begin
7
+ require 'faraday_middleware'
8
+ rescue LoadError => e
9
+ message = <<~MSG
10
+ For the current version of Faraday (#{Faraday::VERSION}), "faraday_middleware"
11
+ is a required peer dependency of "netbox-client-ruby". Please install
12
+ "faraday_middleware" separately OR upgrade to Faraday 2, in which case,
13
+ "faraday_middleware" is not needed to work with "netbox-client-ruby".
14
+
15
+ #{e.message}
16
+ MSG
17
+ raise NetboxClientRuby::Error, message
18
+ end
19
+ end
5
20
 
6
21
  module NetboxClientRuby
7
22
  class Connection
@@ -1,5 +1,5 @@
1
1
  require 'netbox_client_ruby/entity'
2
- require 'netbox_client_ruby/error/local_error'
2
+ require 'netbox_client_ruby/error'
3
3
 
4
4
  module NetboxClientRuby
5
5
  module Entities
@@ -1,5 +1,5 @@
1
1
  require 'netbox_client_ruby/communication'
2
- require 'netbox_client_ruby/error/local_error'
2
+ require 'netbox_client_ruby/error'
3
3
 
4
4
  module NetboxClientRuby
5
5
  module Entity
@@ -0,0 +1,6 @@
1
+ module NetboxClientRuby
2
+ class Error < StandardError; end
3
+ class ClientError < Error; end
4
+ class LocalError < Error; end
5
+ class RemoteError < Error; end
6
+ end
@@ -1,4 +1,5 @@
1
1
  require 'dry-configurable'
2
+ require 'netbox_client_ruby/error'
2
3
  require 'netbox_client_ruby/api'
3
4
 
4
5
  module NetboxClientRuby
@@ -26,9 +26,8 @@ Gem::Specification.new do |spec|
26
26
  spec.required_ruby_version = '>= 2.7.0'
27
27
 
28
28
  spec.add_runtime_dependency 'dry-configurable', '~> 1'
29
- spec.add_runtime_dependency 'faraday', '>= 0.11.0', '< 2'
29
+ spec.add_runtime_dependency 'faraday', '>= 0.11.0', '< 3'
30
30
  spec.add_runtime_dependency 'faraday-detailed_logger', '~> 2.1'
31
- spec.add_runtime_dependency 'faraday_middleware', '>= 0.11', '< 2'
32
31
  spec.add_runtime_dependency 'ipaddress', '~> 0.8', '>= 0.8.3'
33
32
  spec.add_runtime_dependency 'openssl', '>= 2.0.5'
34
33
 
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.8.0
4
+ version: 0.10.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: 2023-06-14 00:00:00.000000000 Z
11
+ date: 2023-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: 0.11.0
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
- version: '2'
36
+ version: '3'
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 0.11.0
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
- version: '2'
46
+ version: '3'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: faraday-detailed_logger
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -58,26 +58,6 @@ dependencies:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
60
  version: '2.1'
61
- - !ruby/object:Gem::Dependency
62
- name: faraday_middleware
63
- requirement: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - ">="
66
- - !ruby/object:Gem::Version
67
- version: '0.11'
68
- - - "<"
69
- - !ruby/object:Gem::Version
70
- version: '2'
71
- type: :runtime
72
- prerelease: false
73
- version_requirements: !ruby/object:Gem::Requirement
74
- requirements:
75
- - - ">="
76
- - !ruby/object:Gem::Version
77
- version: '0.11'
78
- - - "<"
79
- - !ruby/object:Gem::Version
80
- version: '2'
81
61
  - !ruby/object:Gem::Dependency
82
62
  name: ipaddress
83
63
  requirement: !ruby/object:Gem::Requirement
@@ -211,6 +191,7 @@ files:
211
191
  - ".rspec"
212
192
  - Dockerfile
213
193
  - Gemfile
194
+ - Gemfile.lock
214
195
  - LICENSE.txt
215
196
  - README.md
216
197
  - Rakefile
@@ -222,6 +203,12 @@ files:
222
203
  - docker/start.sh
223
204
  - docker/start.test.sh
224
205
  - dump.sql
206
+ - gemfiles/faraday0.gemfile
207
+ - gemfiles/faraday0.gemfile.lock
208
+ - gemfiles/faraday1.gemfile
209
+ - gemfiles/faraday1.gemfile.lock
210
+ - gemfiles/faraday2.gemfile
211
+ - gemfiles/faraday2.gemfile.lock
225
212
  - lib/netbox-client-ruby.rb
226
213
  - lib/netbox_client_ruby.rb
227
214
  - lib/netbox_client_ruby/api.rb
@@ -297,6 +284,8 @@ files:
297
284
  - lib/netbox_client_ruby/api/ipam/rirs.rb
298
285
  - lib/netbox_client_ruby/api/ipam/role.rb
299
286
  - lib/netbox_client_ruby/api/ipam/roles.rb
287
+ - lib/netbox_client_ruby/api/ipam/service.rb
288
+ - lib/netbox_client_ruby/api/ipam/services.rb
300
289
  - lib/netbox_client_ruby/api/ipam/vlan.rb
301
290
  - lib/netbox_client_ruby/api/ipam/vlan_group.rb
302
291
  - lib/netbox_client_ruby/api/ipam/vlan_groups.rb
@@ -330,9 +319,7 @@ files:
330
319
  - lib/netbox_client_ruby/connection.rb
331
320
  - lib/netbox_client_ruby/entities.rb
332
321
  - lib/netbox_client_ruby/entity.rb
333
- - lib/netbox_client_ruby/error/client_error.rb
334
- - lib/netbox_client_ruby/error/local_error.rb
335
- - lib/netbox_client_ruby/error/remote_error.rb
322
+ - lib/netbox_client_ruby/error.rb
336
323
  - netbox-client-ruby.gemspec
337
324
  - netbox-client-ruby_rsa
338
325
  - netbox-client-ruby_rsa.pub
@@ -1,4 +0,0 @@
1
- module NetboxClientRuby
2
- class ClientError < StandardError
3
- end
4
- end
@@ -1,4 +0,0 @@
1
- module NetboxClientRuby
2
- class LocalError < StandardError
3
- end
4
- end
@@ -1,4 +0,0 @@
1
- module NetboxClientRuby
2
- class RemoteError < StandardError
3
- end
4
- end