netbox-client-ruby 0.1.3 → 0.1.4

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
  SHA1:
3
- metadata.gz: 06b586e73594396dd7fdcffce33dde0a8a7c5ae6
4
- data.tar.gz: 6c10c27dc81db8f26a3f5a5c319ef06b7d2b8688
3
+ metadata.gz: 4c2790971b77b46de9951fa49827fb7af234c5ec
4
+ data.tar.gz: c1df33a387651063eafc6106f3aa9c3161920a44
5
5
  SHA512:
6
- metadata.gz: 792d23f9938ea1e8a974db2a53fd67d6de86899f2a1f4cce6e5778e16d7ea1f3a72f97cfff2c738d03b59fe62a33e8d0faa4c8c1ff6e2942b660d4ed1d07db0d
7
- data.tar.gz: 7ee301dccf03b6c31691871416d65cdb8dded5a4c46f4a26cd313abe2b23855e9c6112289fea316055c6f70dc436184d43182b585db1eca8d5e0399293255f03
6
+ metadata.gz: ac02e9bd64f9105a65f90b6436476b16224f2b32df3bb67703c38252e4e8d310272d5bbc8abdce6d81cd8c30546cdfc2d90d70a3baa70452c54bd7fea2628dc8
7
+ data.tar.gz: 2df624834a8dbcff6776e63c61a62323f67288fed3b0c302d926791bb40541330ff267c6705134bcb3c918f4a6f4441eb2aae3a3b55edd4997b2620964a311ff
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- netbox-client-ruby (0.1.3)
4
+ netbox-client-ruby (0.1.4)
5
5
  dry-configurable (~> 0.1)
6
6
  faraday (>= 0.11.0)
7
7
  faraday-detailed_logger (~> 2.1)
data/README.md CHANGED
@@ -135,6 +135,7 @@ Not all objects which the Netbox API exposes are currently implemented. Implemen
135
135
  * Power Outlets
136
136
  * Power Ports
137
137
  * Racks
138
+ * Rack Groups
138
139
  * Regions
139
140
  * Sites
140
141
  * IPAM:
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
@@ -17,6 +17,8 @@ require 'netbox_client_ruby/api/dcim/power_outlets'
17
17
  require 'netbox_client_ruby/api/dcim/power_port'
18
18
  require 'netbox_client_ruby/api/dcim/power_ports'
19
19
  require 'netbox_client_ruby/api/dcim/rack'
20
+ require 'netbox_client_ruby/api/dcim/rack_group'
21
+ require 'netbox_client_ruby/api/dcim/rack_groups'
20
22
  require 'netbox_client_ruby/api/dcim/racks'
21
23
  require 'netbox_client_ruby/api/dcim/region'
22
24
  require 'netbox_client_ruby/api/dcim/regions'
@@ -37,6 +39,7 @@ module NetboxClientRuby
37
39
  power_outlets: PowerOutlets,
38
40
  power_ports: PowerPorts,
39
41
  racks: Racks,
42
+ rack_groups: RackGroups,
40
43
  regions: Regions,
41
44
  sites: Sites
42
45
  }.each_pair do |method_name, class_name|
@@ -55,6 +58,7 @@ module NetboxClientRuby
55
58
  power_outlet: PowerOutlet,
56
59
  power_port: PowerPort,
57
60
  rack: Rack,
61
+ rack_group: RackGroup,
58
62
  region: Region,
59
63
  site: Site
60
64
  }.each_pair do |method_name, class_name|
@@ -0,0 +1,20 @@
1
+ require 'netbox_client_ruby/entity'
2
+ require 'netbox_client_ruby/api/dcim/region'
3
+ require 'netbox_client_ruby/api/tenancy/tenant'
4
+
5
+ module NetboxClientRuby
6
+ module DCIM
7
+ class RackGroup
8
+ include Entity
9
+
10
+ id id: :id
11
+ deletable true
12
+ path 'dcim/rack-groups/:id.json'
13
+ creation_path 'dcim/rack-groups/'
14
+ object_fields(
15
+ region: proc { |raw_data| DCIM::Region.new raw_data['id'] },
16
+ tenant: proc { |raw_data| Tenancy::Tenant.new raw_data['id'] },
17
+ )
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,21 @@
1
+ require 'netbox_client_ruby/entities'
2
+ require 'netbox_client_ruby/api/dcim/rack_group'
3
+
4
+ module NetboxClientRuby
5
+ module DCIM
6
+ class RackGroups
7
+ include Entities
8
+
9
+ path 'dcim/rack-groups.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
+ RackGroup.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.1.3
4
+ version: 0.1.4
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: 2017-10-19 00:00:00.000000000 Z
11
+ date: 2017-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable
@@ -227,6 +227,8 @@ files:
227
227
  - lib/netbox_client_ruby/api/dcim/power_port.rb
228
228
  - lib/netbox_client_ruby/api/dcim/power_ports.rb
229
229
  - lib/netbox_client_ruby/api/dcim/rack.rb
230
+ - lib/netbox_client_ruby/api/dcim/rack_group.rb
231
+ - lib/netbox_client_ruby/api/dcim/rack_groups.rb
230
232
  - lib/netbox_client_ruby/api/dcim/racks.rb
231
233
  - lib/netbox_client_ruby/api/dcim/region.rb
232
234
  - lib/netbox_client_ruby/api/dcim/regions.rb