netbox-client-ruby 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rspec.yml +2 -0
- data/Gemfile.lock +4 -2
- data/gemfiles/faraday0.gemfile.lock +1 -1
- data/gemfiles/faraday1.gemfile.lock +1 -1
- data/gemfiles/faraday2.gemfile.lock +1 -1
- data/lib/netbox_client_ruby/api/circuits/circuit_terminations.rb +1 -1
- data/lib/netbox_client_ruby/api/circuits/circuit_types.rb +1 -1
- data/lib/netbox_client_ruby/api/circuits/circuits.rb +1 -1
- data/lib/netbox_client_ruby/api/circuits/providers.rb +1 -1
- data/lib/netbox_client_ruby/api/dcim/console_connections.rb +1 -1
- data/lib/netbox_client_ruby/api/dcim/console_ports.rb +1 -1
- data/lib/netbox_client_ruby/api/dcim/console_server_ports.rb +1 -1
- data/lib/netbox_client_ruby/api/dcim/device_roles.rb +1 -1
- data/lib/netbox_client_ruby/api/dcim/device_types.rb +1 -1
- data/lib/netbox_client_ruby/api/dcim/devices.rb +1 -1
- data/lib/netbox_client_ruby/api/dcim/interface_connections.rb +1 -1
- data/lib/netbox_client_ruby/api/dcim/interfaces.rb +1 -1
- data/lib/netbox_client_ruby/api/dcim/inventory_items.rb +1 -1
- data/lib/netbox_client_ruby/api/dcim/manufacturers.rb +1 -1
- data/lib/netbox_client_ruby/api/dcim/platforms.rb +1 -1
- data/lib/netbox_client_ruby/api/dcim/power_connections.rb +1 -1
- data/lib/netbox_client_ruby/api/dcim/power_outlets.rb +1 -1
- data/lib/netbox_client_ruby/api/dcim/power_ports.rb +1 -1
- data/lib/netbox_client_ruby/api/dcim/rack_groups.rb +1 -1
- data/lib/netbox_client_ruby/api/dcim/rack_reservations.rb +1 -1
- data/lib/netbox_client_ruby/api/dcim/rack_roles.rb +1 -1
- data/lib/netbox_client_ruby/api/dcim/racks.rb +1 -1
- data/lib/netbox_client_ruby/api/dcim/regions.rb +1 -1
- data/lib/netbox_client_ruby/api/dcim/sites.rb +1 -1
- data/lib/netbox_client_ruby/api/dcim/virtual_chassis_list.rb +1 -1
- data/lib/netbox_client_ruby/api/extras/config_contexts.rb +1 -1
- data/lib/netbox_client_ruby/api/extras/journal_entries.rb +1 -1
- data/lib/netbox_client_ruby/api/extras/tags.rb +1 -1
- data/lib/netbox_client_ruby/api/ipam/aggregates.rb +1 -1
- data/lib/netbox_client_ruby/api/ipam/ip_address.rb +1 -1
- data/lib/netbox_client_ruby/api/ipam/ip_addresses.rb +1 -1
- data/lib/netbox_client_ruby/api/ipam/ip_ranges.rb +1 -1
- data/lib/netbox_client_ruby/api/ipam/prefixes.rb +1 -1
- data/lib/netbox_client_ruby/api/ipam/rirs.rb +1 -1
- data/lib/netbox_client_ruby/api/ipam/roles.rb +1 -1
- data/lib/netbox_client_ruby/api/ipam/services.rb +1 -1
- data/lib/netbox_client_ruby/api/ipam/vlan_groups.rb +1 -1
- data/lib/netbox_client_ruby/api/ipam/vlans.rb +1 -1
- data/lib/netbox_client_ruby/api/ipam/vrfs.rb +1 -1
- data/lib/netbox_client_ruby/api/secrets/secret_roles.rb +1 -1
- data/lib/netbox_client_ruby/api/secrets/secrets.rb +1 -1
- data/lib/netbox_client_ruby/api/tenancy/tenant_groups.rb +1 -1
- data/lib/netbox_client_ruby/api/tenancy/tenants.rb +1 -1
- data/lib/netbox_client_ruby/api/virtualization/cluster_groups.rb +1 -1
- data/lib/netbox_client_ruby/api/virtualization/cluster_types.rb +1 -1
- data/lib/netbox_client_ruby/api/virtualization/clusters.rb +1 -1
- data/lib/netbox_client_ruby/api/virtualization/interfaces.rb +1 -1
- data/lib/netbox_client_ruby/api/virtualization/virtual_machines.rb +1 -1
- data/lib/netbox_client_ruby/communication.rb +2 -2
- data/lib/netbox_client_ruby/entity.rb +7 -7
- data/netbox-client-ruby.gemspec +1 -1
- metadata +3 -4
- data/VERSION +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e05b0acd52ba688b19ce5874d612d9601290f8ec3c88a4798849f976c3f0b368
|
4
|
+
data.tar.gz: 1cd26e233b325ff0502698cd91e6036f430d5d7920aa660b6edeb9852f8c1e11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c12dbb99d8fe6a8c431252fe95489395b55d783161989b457cb8f53d97303289e13e83b45a55bdad9e679fac347b921ac64843c54e2c1b7c64d4d98d66fe383
|
7
|
+
data.tar.gz: 5bd2e5b74095102928eee7f63a2ddfd19f213e099f0eac97edd8ce7be58b754416f9a363b465aa07de99c6d99cc96cfb8542f9f2f6af1e9182862245539ae626
|
data/.github/workflows/rspec.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
netbox-client-ruby (0.
|
4
|
+
netbox-client-ruby (0.10.0)
|
5
5
|
dry-configurable (~> 1)
|
6
6
|
faraday (>= 0.11.0, < 3)
|
7
7
|
faraday-detailed_logger (~> 2.1)
|
@@ -63,7 +63,8 @@ GEM
|
|
63
63
|
rainbow (3.1.1)
|
64
64
|
rake (13.0.6)
|
65
65
|
regexp_parser (2.8.1)
|
66
|
-
rexml (3.
|
66
|
+
rexml (3.3.6)
|
67
|
+
strscan
|
67
68
|
rspec (3.12.0)
|
68
69
|
rspec-core (~> 3.12.0)
|
69
70
|
rspec-expectations (~> 3.12.0)
|
@@ -93,6 +94,7 @@ GEM
|
|
93
94
|
rubocop-ast (>= 0.7.1)
|
94
95
|
ruby-progressbar (1.13.0)
|
95
96
|
ruby2_keywords (0.0.5)
|
97
|
+
strscan (3.1.0)
|
96
98
|
unicode-display_width (1.8.0)
|
97
99
|
zeitwerk (2.6.12)
|
98
100
|
|
@@ -38,7 +38,7 @@ module NetboxClientRuby
|
|
38
38
|
|
39
39
|
return nil unless interface_data
|
40
40
|
|
41
|
-
if interface_data.key?
|
41
|
+
if interface_data.key?('virtual_machine')
|
42
42
|
Virtualization::Interface.new interface_data['id']
|
43
43
|
else
|
44
44
|
DCIM::Interface.new interface_data['id']
|
@@ -23,8 +23,8 @@ module NetboxClientRuby
|
|
23
23
|
variable_name = sanitize_variable_name(k)
|
24
24
|
variable_name = "_#{variable_name}" if objectified_instance.methods.map(&:to_s).include?(variable_name)
|
25
25
|
|
26
|
-
objectified_instance.instance_variable_set("@#{variable_name}", v)
|
27
|
-
objectified_class.send(:define_method, variable_name, proc { instance_variable_get("@#{variable_name}") })
|
26
|
+
objectified_instance.instance_variable_set(:"@#{variable_name}", v)
|
27
|
+
objectified_class.send(:define_method, variable_name, proc { instance_variable_get(:"@#{variable_name}") })
|
28
28
|
end
|
29
29
|
objectified_instance
|
30
30
|
end
|
@@ -38,7 +38,7 @@ module NetboxClientRuby
|
|
38
38
|
end
|
39
39
|
|
40
40
|
@id_fields.keys.each do |field|
|
41
|
-
define_method(field) { instance_variable_get "@#{field}" }
|
41
|
+
define_method(field) { instance_variable_get :"@#{field}" }
|
42
42
|
end
|
43
43
|
|
44
44
|
@id_fields
|
@@ -108,13 +108,13 @@ module NetboxClientRuby
|
|
108
108
|
return self if given_values.nil?
|
109
109
|
|
110
110
|
if id_fields.count == 1 && !given_values.is_a?(Hash)
|
111
|
-
instance_variable_set("@#{id_fields.keys.first}", given_values)
|
111
|
+
instance_variable_set(:"@#{id_fields.keys.first}", given_values)
|
112
112
|
return self
|
113
113
|
end
|
114
114
|
|
115
115
|
given_values.each do |field, value|
|
116
116
|
if id_fields.key? field.to_s
|
117
|
-
instance_variable_set "@#{field}", value
|
117
|
+
instance_variable_set :"@#{field}", value
|
118
118
|
else
|
119
119
|
# via method_missing, because it checks for readonly fields, etc.
|
120
120
|
method_missing("#{field}=", value)
|
@@ -164,7 +164,7 @@ module NetboxClientRuby
|
|
164
164
|
s_attribute = attribute.to_s
|
165
165
|
next if readonly_fields.include? s_attribute
|
166
166
|
|
167
|
-
sym_attr_writer = "#{attribute}="
|
167
|
+
sym_attr_writer = :"#{attribute}="
|
168
168
|
if methods.include?(sym_attr_writer)
|
169
169
|
public_send(sym_attr_writer, values)
|
170
170
|
else
|
@@ -197,7 +197,7 @@ module NetboxClientRuby
|
|
197
197
|
|
198
198
|
if name.end_with?('=')
|
199
199
|
is_readonly_field = readonly_fields.include?(name[0..-2])
|
200
|
-
is_instance_variable = instance_variables.include?("@#{name[0..-2]}"
|
200
|
+
is_instance_variable = instance_variables.include?(:"@#{name[0..-2]}")
|
201
201
|
not_this_classes_business = is_readonly_field || is_instance_variable
|
202
202
|
|
203
203
|
return super if not_this_classes_business
|
@@ -328,12 +328,12 @@ module NetboxClientRuby
|
|
328
328
|
raise LocalError, "Can't find the id field '#{id_field}' in the received data."
|
329
329
|
end
|
330
330
|
|
331
|
-
instance_variable_set("@#{id_attr}", data[id_field])
|
331
|
+
instance_variable_set(:"@#{id_attr}", data[id_field])
|
332
332
|
end
|
333
333
|
end
|
334
334
|
|
335
335
|
def ids_set?
|
336
|
-
id_fields.map { |id_attr, _| instance_variable_get("@#{id_attr}") }.all?
|
336
|
+
id_fields.map { |id_attr, _| instance_variable_get(:"@#{id_attr}") }.all?
|
337
337
|
end
|
338
338
|
end
|
339
339
|
end
|
data/netbox-client-ruby.gemspec
CHANGED
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |spec|
|
5
5
|
spec.name = 'netbox-client-ruby'
|
6
|
-
spec.version =
|
6
|
+
spec.version = `git describe --tags --match="v[0-9]*" --abbrev=0`.strip.delete_prefix("v")
|
7
7
|
|
8
8
|
spec.summary = 'A read/write client for Netbox v2.'
|
9
9
|
spec.homepage = 'https://github.com/ninech/netbox-client-ruby'
|
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.10.
|
4
|
+
version: 0.10.1
|
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: 2024-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-configurable
|
@@ -195,7 +195,6 @@ files:
|
|
195
195
|
- LICENSE.txt
|
196
196
|
- README.md
|
197
197
|
- Rakefile
|
198
|
-
- VERSION
|
199
198
|
- bin/console
|
200
199
|
- bin/setup
|
201
200
|
- docker-compose.test.yml
|
@@ -344,7 +343,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
344
343
|
- !ruby/object:Gem::Version
|
345
344
|
version: '0'
|
346
345
|
requirements: []
|
347
|
-
rubygems_version: 3.4.
|
346
|
+
rubygems_version: 3.4.19
|
348
347
|
signing_key:
|
349
348
|
specification_version: 4
|
350
349
|
summary: A read/write client for Netbox v2.
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.10.0
|