netbox-client-ruby 0.5.4 → 0.5.5

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: 67bf42f57fa35176857fba1a7ec57797b0345ccf5de0c4074f5bcf2c5be77c04
4
- data.tar.gz: 20002e43346be5ce7d5a276656406b7096b302eaf055ef87a81844ae5f72a343
3
+ metadata.gz: 55bbd9dd0203bcfe5c840d50a36267993a7eef021f327c4eb09cfc6b386fae50
4
+ data.tar.gz: 764e38fc0bc4928e7951e8f0f10eed8c35d6e69651851d9c72e09ac9fd1b04c5
5
5
  SHA512:
6
- metadata.gz: 1db48b81125135817a7fe7aeed34a3b9ec589e1415bdf12c6fe26b8c69119ca540daca0d3077221f4c77aa6ff84289de765ff6b0aff1764c21652d08371eb5bf
7
- data.tar.gz: feb71125dcb8896ca6777333f7a857032ac247b286c004d971d2d22fff256e294926adecf713466e092637455a75eb206056dd5297830e32630bf1b72bf573f7
6
+ metadata.gz: 80f8d490bc49670339fc21e091a084be8478ee8c4562daa00635e94e5d162fd8ee0db0b8bd07b2288e144a5bf6317c68e5b7b2c66380df22510c5b7ad65a8d0e
7
+ data.tar.gz: 3f88931867f63cb1fbe049ef59682086eba3ccf19e88a5265238caf19be9b2ff76eed488567a4bc2159951261e4106445611ea620e540adcd5d641c725b1baf5
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.4
1
+ 0.5.5
@@ -1,5 +1,6 @@
1
1
  require 'netbox_client_ruby/api/circuits'
2
2
  require 'netbox_client_ruby/api/dcim'
3
+ require 'netbox_client_ruby/api/extras'
3
4
  require 'netbox_client_ruby/api/ipam'
4
5
  require 'netbox_client_ruby/api/secrets'
5
6
  require 'netbox_client_ruby/api/tenancy'
@@ -15,6 +16,10 @@ module NetboxClientRuby
15
16
  NetboxClientRuby::DCIM
16
17
  end
17
18
 
19
+ def self.extras
20
+ NetboxClientRuby::Extras
21
+ end
22
+
18
23
  def self.ipam
19
24
  NetboxClientRuby::IPAM
20
25
  end
@@ -29,6 +29,7 @@ module NetboxClientRuby
29
29
  primary_ip4: proc { |raw_data| IPAM::IpAddress.new raw_data['id'] },
30
30
  primary_ip6: proc { |raw_data| IPAM::IpAddress.new raw_data['id'] },
31
31
  virtual_chassis: proc { |raw_data| DCIM::VirtualChassis.new raw_data['id'] },
32
+ tags: proc { |raw_data| Extras::Tag.new raw_data['id'] },
32
33
  )
33
34
  end
34
35
  end
@@ -0,0 +1,20 @@
1
+ require 'netbox_client_ruby/api/extras/tag'
2
+ require 'netbox_client_ruby/api/extras/tags'
3
+
4
+ module NetboxClientRuby
5
+ module Extras
6
+ {
7
+ tags: Tags
8
+ }.each_pair do |method_name, class_name|
9
+ define_method(method_name) { class_name.new }
10
+ module_function(method_name)
11
+ end
12
+
13
+ {
14
+ tag: Tag
15
+ }.each_pair do |method_name, class_name|
16
+ define_method(method_name) { |id| class_name.new id }
17
+ module_function(method_name)
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,14 @@
1
+ require 'netbox_client_ruby/entity'
2
+
3
+ module NetboxClientRuby
4
+ module Extras
5
+ class Tag
6
+ include Entity
7
+
8
+ id id: :id
9
+ deletable true
10
+ path 'extras/tags/:id.json'
11
+ creation_path 'extras/tags/'
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,21 @@
1
+ require 'netbox_client_ruby/entities'
2
+ require 'netbox_client_ruby/api/extras/tag'
3
+
4
+ module NetboxClientRuby
5
+ module Extras
6
+ class Tags
7
+ include Entities
8
+
9
+ path 'extras/tags.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
+ Tag.new raw_entity['id']
18
+ end
19
+ end
20
+ end
21
+ end
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.5.4
4
+ version: 0.5.5
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: 2021-04-19 00:00:00.000000000 Z
11
+ date: 2021-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable
@@ -276,6 +276,9 @@ files:
276
276
  - lib/netbox_client_ruby/api/dcim/sites.rb
277
277
  - lib/netbox_client_ruby/api/dcim/virtual_chassis.rb
278
278
  - lib/netbox_client_ruby/api/dcim/virtual_chassis_list.rb
279
+ - lib/netbox_client_ruby/api/extras.rb
280
+ - lib/netbox_client_ruby/api/extras/tag.rb
281
+ - lib/netbox_client_ruby/api/extras/tags.rb
279
282
  - lib/netbox_client_ruby/api/ipam.rb
280
283
  - lib/netbox_client_ruby/api/ipam/aggregate.rb
281
284
  - lib/netbox_client_ruby/api/ipam/aggregates.rb