netbox-client-ruby 0.11.0 → 0.13.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 +4 -4
- data/README.md +3 -1
- data/lib/netbox_client_ruby/api/dcim/mac_address.rb +14 -0
- data/lib/netbox_client_ruby/api/dcim/mac_addresses.rb +20 -0
- data/lib/netbox_client_ruby/api/dcim/site.rb +1 -0
- data/lib/netbox_client_ruby/api/dcim.rb +2 -0
- data/lib/netbox_client_ruby/api/tenancy/contact.rb +15 -0
- data/lib/netbox_client_ruby/api/tenancy/contact_group.rb +15 -0
- data/lib/netbox_client_ruby/api/tenancy/contact_groups.rb +20 -0
- data/lib/netbox_client_ruby/api/tenancy/contacts.rb +20 -0
- data/lib/netbox_client_ruby/api/tenancy.rb +6 -2
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e92fcfb1847cb3521d78c31bf1963c3a05e5d9ff790d67de847dd7f0750ba7e
|
4
|
+
data.tar.gz: 7133f48050960e5bc0e5b5e29b7e488688f53dfe8c51a6103091d72b6753f501
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db362181a8f59cc3209dfbdec06a0d29af0207ae8d94713f4a3965b9a91d07aa47aa743fc2c415fa39edc27aa9b94982bb7bc3920b8125a68090b7a9a6996a45
|
7
|
+
data.tar.gz: eb607a8f76f5dd6bb6106efd367f0f94206d6a34822ecf158a444761c43b13408c21c0299b067defb160a040b940dfae6ee4df36eeb3fce606f6bb3c68f71953
|
data/README.md
CHANGED
@@ -194,6 +194,8 @@ Not all objects which the Netbox API exposes are currently implemented. Implemen
|
|
194
194
|
* Tenancy:
|
195
195
|
* Tenant: `NetboxClientRuby.tenancy.tenants`
|
196
196
|
* Tenant Groups: `NetboxClientRuby.tenancy.tenant_groups`
|
197
|
+
* Contact: `NetboxClientRuby.tenancy.contacts`
|
198
|
+
* Contact Groups: `NetboxClientRuby.tenancy.contact_groups`
|
197
199
|
* Virtualization:
|
198
200
|
* Cluster Types: `NetboxClientRuby.virtualization.cluster_types`
|
199
201
|
* Cluster Groups: `NetboxClientRuby.virtualization.cluster_groups`
|
@@ -243,7 +245,7 @@ Before opening a PR, please
|
|
243
245
|
* extend the existing specs
|
244
246
|
* run rspec
|
245
247
|
* run rubocop and fix your warnings
|
246
|
-
* check if this README.md file needs adjustments
|
248
|
+
* check if this `README.md` file needs adjustments
|
247
249
|
|
248
250
|
## License
|
249
251
|
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module NetboxClientRuby
|
4
|
+
module DCIM
|
5
|
+
class MacAddresses
|
6
|
+
include Entities
|
7
|
+
|
8
|
+
path 'dcim/mac-addresses/'
|
9
|
+
data_key 'results'
|
10
|
+
count_key 'count'
|
11
|
+
entity_creator :entity_creator
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def entity_creator(raw_entity)
|
16
|
+
MacAddress.new raw_entity['id']
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -19,6 +19,7 @@ module NetboxClientRuby
|
|
19
19
|
path 'dcim/sites/:id/'
|
20
20
|
creation_path 'dcim/sites/'
|
21
21
|
object_fields(
|
22
|
+
tenant: proc { |raw_region| Tenancy::Tenant.new raw_region['id'] },
|
22
23
|
region: proc { |raw_region| DCIM::Region.new raw_region['id'] },
|
23
24
|
status: proc do |raw_status|
|
24
25
|
STATUS_VALUES.key(raw_status['value']) || raw_status['value']
|
@@ -12,6 +12,7 @@ module NetboxClientRuby
|
|
12
12
|
interfaces: Interfaces,
|
13
13
|
interface_connections: InterfaceConnections,
|
14
14
|
inventory_items: InventoryItems,
|
15
|
+
mac_addresses: MacAddresses,
|
15
16
|
manufacturers: Manufacturers,
|
16
17
|
platforms: Platforms,
|
17
18
|
power_connections: PowerConnections,
|
@@ -39,6 +40,7 @@ module NetboxClientRuby
|
|
39
40
|
interface: Interface,
|
40
41
|
interface_connection: InterfaceConnection,
|
41
42
|
inventory_item: InventoryItem,
|
43
|
+
mac_address: MacAddress,
|
42
44
|
manufacturer: Manufacturer,
|
43
45
|
platform: Platform,
|
44
46
|
power_connection: PowerConnection,
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module NetboxClientRuby
|
4
|
+
module Tenancy
|
5
|
+
class Contact
|
6
|
+
include Entity
|
7
|
+
|
8
|
+
id id: :id
|
9
|
+
deletable true
|
10
|
+
path 'tenancy/contacts/:id/'
|
11
|
+
creation_path 'tenancy/contacts/'
|
12
|
+
object_fields group: proc { |raw_data| ContactGroup.new raw_data['id'] }
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module NetboxClientRuby
|
4
|
+
module Tenancy
|
5
|
+
class ContactGroup
|
6
|
+
include Entity
|
7
|
+
|
8
|
+
id id: :id
|
9
|
+
deletable true
|
10
|
+
path 'tenancy/contact-groups/:id/'
|
11
|
+
creation_path 'tenancy/contact-groups/'
|
12
|
+
object_fields parent: proc { |raw_data| ContactGroup.new raw_data['id'] }
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module NetboxClientRuby
|
4
|
+
module Tenancy
|
5
|
+
class ContactGroups
|
6
|
+
include Entities
|
7
|
+
|
8
|
+
path 'tenancy/contact-groups/'
|
9
|
+
data_key 'results'
|
10
|
+
count_key 'count'
|
11
|
+
entity_creator :entity_creator
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def entity_creator(raw_entity)
|
16
|
+
ContactGroup.new raw_entity['id']
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module NetboxClientRuby
|
4
|
+
module Tenancy
|
5
|
+
class Contacts
|
6
|
+
include Entities
|
7
|
+
|
8
|
+
path 'tenancy/contacts/'
|
9
|
+
data_key 'results'
|
10
|
+
count_key 'count'
|
11
|
+
entity_creator :entity_creator
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def entity_creator(raw_entity)
|
16
|
+
Contact.new raw_entity['id']
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -4,7 +4,9 @@ module NetboxClientRuby
|
|
4
4
|
module Tenancy
|
5
5
|
{
|
6
6
|
tenants: Tenants,
|
7
|
-
tenant_groups: TenantGroups
|
7
|
+
tenant_groups: TenantGroups,
|
8
|
+
contacts: Contacts,
|
9
|
+
contact_groups: ContactGroups
|
8
10
|
}.each_pair do |method_name, class_name|
|
9
11
|
define_method(method_name) { class_name.new }
|
10
12
|
module_function(method_name)
|
@@ -12,7 +14,9 @@ module NetboxClientRuby
|
|
12
14
|
|
13
15
|
{
|
14
16
|
tenant: Tenant,
|
15
|
-
tenant_group: TenantGroup
|
17
|
+
tenant_group: TenantGroup,
|
18
|
+
contact: Contact,
|
19
|
+
contact_group: ContactGroup
|
16
20
|
}.each_pair do |method_name, class_name|
|
17
21
|
define_method(method_name) { |id| class_name.new id }
|
18
22
|
module_function(method_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.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nine Internet Solutions AG
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-configurable
|
@@ -165,6 +165,8 @@ files:
|
|
165
165
|
- lib/netbox_client_ruby/api/dcim/interfaces.rb
|
166
166
|
- lib/netbox_client_ruby/api/dcim/inventory_item.rb
|
167
167
|
- lib/netbox_client_ruby/api/dcim/inventory_items.rb
|
168
|
+
- lib/netbox_client_ruby/api/dcim/mac_address.rb
|
169
|
+
- lib/netbox_client_ruby/api/dcim/mac_addresses.rb
|
168
170
|
- lib/netbox_client_ruby/api/dcim/manufacturer.rb
|
169
171
|
- lib/netbox_client_ruby/api/dcim/manufacturers.rb
|
170
172
|
- lib/netbox_client_ruby/api/dcim/platform.rb
|
@@ -225,6 +227,10 @@ files:
|
|
225
227
|
- lib/netbox_client_ruby/api/secrets/secrets.rb
|
226
228
|
- lib/netbox_client_ruby/api/secrets/session_key.rb
|
227
229
|
- lib/netbox_client_ruby/api/tenancy.rb
|
230
|
+
- lib/netbox_client_ruby/api/tenancy/contact.rb
|
231
|
+
- lib/netbox_client_ruby/api/tenancy/contact_group.rb
|
232
|
+
- lib/netbox_client_ruby/api/tenancy/contact_groups.rb
|
233
|
+
- lib/netbox_client_ruby/api/tenancy/contacts.rb
|
228
234
|
- lib/netbox_client_ruby/api/tenancy/tenant.rb
|
229
235
|
- lib/netbox_client_ruby/api/tenancy/tenant_group.rb
|
230
236
|
- lib/netbox_client_ruby/api/tenancy/tenant_groups.rb
|