netbox-client-ruby 0.5.7 → 0.6.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: dfc4b8770c7433a268f229c7056fa6e8e551c46e61df9d779842a16781d10608
4
- data.tar.gz: a767490176d8a2246622ebb357bcf85a2a6d7f5a86890578c711f86980f6321c
3
+ metadata.gz: 63568afc97653757809347e5b44d878e6d66294e2c8190068d471dedc680ef86
4
+ data.tar.gz: 961c454e7e81c28a216c323604743a0d24b5bd01a3e6fe95231b42f1d99d664b
5
5
  SHA512:
6
- metadata.gz: bc57418ec2f35aa192dc004f26edb64588a67b89672bcf0ed8804ea9cfe26c74d410516c2af524d5b165a02b079d050e29be01690a85d778d75d822d4012d97c
7
- data.tar.gz: afbd55c916453c52231fad8ed1e6f30747c0aa60a4f3ddd267fd1f8e3e457f4b31e808b33d1b52ffad4b629ffcd8e58bd77774724a9b74bfbb8d4ac4094afb9f
6
+ metadata.gz: b1cce1d8566e42c11a12cc636b6996e3ed4f984d84157c37f376c75adc0a25609e38609191dd376ea406ae862d2931c9a264d5c492e81e98188216cff417c0bf
7
+ data.tar.gz: 347a7b25e339e3c06cf422bf012607c39216ea63908e993b1e76f716c99eef8e5135090d4a28d65445f928f11914c373adbaa94b9a8d0b968c26f427d21f3f8d
data/README.md CHANGED
@@ -162,6 +162,10 @@ Not all objects which the Netbox API exposes are currently implemented. Implemen
162
162
  * Virtual Chassis: `NetboxClientRuby.dcim.virtual_chassis_list`
163
163
  (⚠️ Exception: The access is different and the class is called `VirtualChassisList` because the plural and singular
164
164
  names are the same and this poses a conflict.)
165
+ * Extras:
166
+ * Config Contexts: `NetboxClientRuby.extras.config_contexts`
167
+ * Journal Entries: `NetboxClientRuby.extras.journal_entries`
168
+ * Tags: `NetboxClientRuby.extras.tags`
165
169
  * IPAM:
166
170
  * Aggregates: `NetboxClientRuby.ipam.aggregates`
167
171
  * IP Addresses: `NetboxClientRuby.ipam.ip_addresses`
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.7
1
+ 0.6.0
@@ -0,0 +1,25 @@
1
+ require 'netbox_client_ruby/entity'
2
+
3
+ module NetboxClientRuby
4
+ module Extras
5
+ class ConfigContext
6
+ include Entity
7
+
8
+ id id: :id
9
+ deletable true
10
+ path 'extras/config-contexts/:id.json'
11
+ creation_path 'extras/config-contexts/'
12
+ object_fields(
13
+ regions: proc { |raw_data| DCIM::Region.new raw_data['id'] },
14
+ sites: proc { |raw_data| DCIM::Site.new raw_data['id'] },
15
+ roles: proc { |raw_data| DCIM::DeviceRole.new raw_data['id'] },
16
+ platforms: proc { |raw_data| DCIM::Platform.new raw_data['id'] },
17
+ cluster_groups: proc { |raw_data| Virtualization::ClusterGroup.new raw_data['id'] },
18
+ clusters: proc { |raw_data| Virtualization::Cluster.new raw_data['id'] },
19
+ tenant_groups: proc { |raw_data| Tenancy::TenantGroup.new raw_data['id'] },
20
+ tenants: proc { |raw_data| Tenancy::Tenant.new raw_data['id'] },
21
+ tags: proc { |raw_data| Tag.new raw_data['id'] }
22
+ )
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,21 @@
1
+ require 'netbox_client_ruby/entities'
2
+ require 'netbox_client_ruby/api/extras/config_context'
3
+
4
+ module NetboxClientRuby
5
+ module Extras
6
+ class ConfigContexts
7
+ include Entities
8
+
9
+ path 'extras/config-contexts.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
+ ConfigContext.new raw_entity['id']
18
+ end
19
+ end
20
+ end
21
+ end
@@ -1,3 +1,5 @@
1
+ require 'netbox_client_ruby/api/extras/config_context'
2
+ require 'netbox_client_ruby/api/extras/config_contexts'
1
3
  require 'netbox_client_ruby/api/extras/journal_entry'
2
4
  require 'netbox_client_ruby/api/extras/journal_entries'
3
5
  require 'netbox_client_ruby/api/extras/tag'
@@ -6,6 +8,7 @@ require 'netbox_client_ruby/api/extras/tags'
6
8
  module NetboxClientRuby
7
9
  module Extras
8
10
  {
11
+ config_contexts: ConfigContexts,
9
12
  journal_entries: JournalEntries,
10
13
  tags: Tags
11
14
  }.each_pair do |method_name, class_name|
@@ -14,6 +17,7 @@ module NetboxClientRuby
14
17
  end
15
18
 
16
19
  {
20
+ config_context: ConfigContext,
17
21
  journal_entry: JournalEntry,
18
22
  tag: Tag
19
23
  }.each_pair do |method_name, class_name|
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.7
4
+ version: 0.6.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: 2021-11-15 00:00:00.000000000 Z
11
+ date: 2021-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable
@@ -277,6 +277,8 @@ files:
277
277
  - lib/netbox_client_ruby/api/dcim/virtual_chassis.rb
278
278
  - lib/netbox_client_ruby/api/dcim/virtual_chassis_list.rb
279
279
  - lib/netbox_client_ruby/api/extras.rb
280
+ - lib/netbox_client_ruby/api/extras/config_context.rb
281
+ - lib/netbox_client_ruby/api/extras/config_contexts.rb
280
282
  - lib/netbox_client_ruby/api/extras/journal_entries.rb
281
283
  - lib/netbox_client_ruby/api/extras/journal_entry.rb
282
284
  - lib/netbox_client_ruby/api/extras/tag.rb