Sha256: 3551594f093087c03d56673f1dedf2ab6111ede1a79488c11be69e17b6e61673
Contents?: true
Size: 1.24 KB
Versions: 2
Compression:
Stored size: 1.24 KB
Contents
require 'netbox_client_ruby/entity' require 'netbox_client_ruby/api/tenancy/tenant' require 'netbox_client_ruby/api/dcim/site' require 'netbox_client_ruby/api/ipam/role' require 'netbox_client_ruby/api/ipam/vlan_group' module NetboxClientRuby module IPAM class Vlan include Entity id id: :id deletable true path 'ipam/vlans/:id.json' creation_path 'ipam/vlans/' object_fields( tenant: proc { |raw_data| Tenancy::Tenant.new raw_data['id'] }, role: proc { |raw_data| Role.new raw_data['id'] }, status: proc { |raw_data| VlanStatus.new raw_data['value'] }, group: proc { |raw_data| VlanGroup.new raw_data['id'] }, site: proc { |raw_data| DCIM::Site.new raw_data['id'] }, ) readonly_fields :display_name end class VlanStatus attr_reader :value, :label def initialize(status_value) @value = status_value @label = case status_value when 1 then 'Active'.freeze when 2 then 'Reserved'.freeze when 3 then 'Deprecated'.freeze else 'UNDEFINED'.freeze end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
netbox-client-ruby-0.2.3 | lib/netbox_client_ruby/api/ipam/vlan.rb |
netbox-client-ruby-0.2.2 | lib/netbox_client_ruby/api/ipam/vlan.rb |