Class: MistApi::Inventory
- Defined in:
- lib/mist_api/models/inventory.rb
Overview
Inventory Model.
Instance Attribute Summary collapse
-
#adopted ⇒ TrueClass | FalseClass
Only if ‘type`==`switch` or `type`==`gateway`, whether the switch/gateway is adopted.
-
#chassis_mac ⇒ String
For Virtual Chassis only, the MAC Address of the FPC0.
-
#chassis_serial ⇒ String
For Virtual Chassis only, the Serial Number of the FPC0.
-
#connected ⇒ TrueClass | FalseClass
Whether the device is connected.
-
#created_time ⇒ Float
When the object has been created, in epoch.
-
#deviceprofile_id ⇒ String
Deviceprofile id if assigned, null if not assigned.
-
#hostname ⇒ String
Hostname reported by the device.
-
#hw_rev ⇒ String
Device hardware revision number.
-
#id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization.
-
#jsi ⇒ TrueClass | FalseClass
Unique ID of the object instance in the Mist Organization.
-
#mac ⇒ String
Device MAC address.
-
#magic ⇒ String
Device claim code.
-
#model ⇒ String
Device model.
-
#modified_time ⇒ Float
When the object has been modified for the last time, in epoch.
-
#name ⇒ String
Device name if configured.
-
#org_id ⇒ UUID | String
Device name if configured.
-
#serial ⇒ String
Device serial.
-
#site_id ⇒ UUID | String
Device serial.
-
#sku ⇒ String
Device stock keeping unit.
-
#type ⇒ DeviceTypeDefaultApEnum
enum: ‘ap`, `gateway`, `switch`.
-
#vc_mac ⇒ String
If ‘type`==`switch` and device part of a Virtual Chassis, MAC Address of the Virtual Chassis.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(adopted = SKIP, chassis_mac = SKIP, chassis_serial = SKIP, connected = SKIP, created_time = SKIP, deviceprofile_id = SKIP, hostname = SKIP, hw_rev = SKIP, id = SKIP, jsi = SKIP, mac = SKIP, magic = SKIP, model = SKIP, modified_time = SKIP, name = SKIP, org_id = SKIP, serial = SKIP, site_id = SKIP, sku = SKIP, type = DeviceTypeDefaultApEnum::AP, vc_mac = SKIP) ⇒ Inventory
constructor
A new instance of Inventory.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(adopted = SKIP, chassis_mac = SKIP, chassis_serial = SKIP, connected = SKIP, created_time = SKIP, deviceprofile_id = SKIP, hostname = SKIP, hw_rev = SKIP, id = SKIP, jsi = SKIP, mac = SKIP, magic = SKIP, model = SKIP, modified_time = SKIP, name = SKIP, org_id = SKIP, serial = SKIP, site_id = SKIP, sku = SKIP, type = DeviceTypeDefaultApEnum::AP, vc_mac = SKIP) ⇒ Inventory
Returns a new instance of Inventory.
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
# File 'lib/mist_api/models/inventory.rb', line 160 def initialize(adopted = SKIP, chassis_mac = SKIP, chassis_serial = SKIP, connected = SKIP, created_time = SKIP, deviceprofile_id = SKIP, hostname = SKIP, hw_rev = SKIP, id = SKIP, jsi = SKIP, mac = SKIP, magic = SKIP, model = SKIP, modified_time = SKIP, name = SKIP, org_id = SKIP, serial = SKIP, site_id = SKIP, sku = SKIP, type = DeviceTypeDefaultApEnum::AP, vc_mac = SKIP) @adopted = adopted unless adopted == SKIP @chassis_mac = chassis_mac unless chassis_mac == SKIP @chassis_serial = chassis_serial unless chassis_serial == SKIP @connected = connected unless connected == SKIP @created_time = created_time unless created_time == SKIP @deviceprofile_id = deviceprofile_id unless deviceprofile_id == SKIP @hostname = hostname unless hostname == SKIP @hw_rev = hw_rev unless hw_rev == SKIP @id = id unless id == SKIP @jsi = jsi unless jsi == SKIP @mac = mac unless mac == SKIP @magic = magic unless magic == SKIP @model = model unless model == SKIP @modified_time = modified_time unless modified_time == SKIP @name = name unless name == SKIP @org_id = org_id unless org_id == SKIP @serial = serial unless serial == SKIP @site_id = site_id unless site_id == SKIP @sku = sku unless sku == SKIP @type = type unless type == SKIP @vc_mac = vc_mac unless vc_mac == SKIP end |
Instance Attribute Details
#adopted ⇒ TrueClass | FalseClass
Only if ‘type`==`switch` or `type`==`gateway`, whether the switch/gateway is adopted
15 16 17 |
# File 'lib/mist_api/models/inventory.rb', line 15 def adopted @adopted end |
#chassis_mac ⇒ String
For Virtual Chassis only, the MAC Address of the FPC0
19 20 21 |
# File 'lib/mist_api/models/inventory.rb', line 19 def chassis_mac @chassis_mac end |
#chassis_serial ⇒ String
For Virtual Chassis only, the Serial Number of the FPC0
23 24 25 |
# File 'lib/mist_api/models/inventory.rb', line 23 def chassis_serial @chassis_serial end |
#connected ⇒ TrueClass | FalseClass
Whether the device is connected
27 28 29 |
# File 'lib/mist_api/models/inventory.rb', line 27 def connected @connected end |
#created_time ⇒ Float
When the object has been created, in epoch
31 32 33 |
# File 'lib/mist_api/models/inventory.rb', line 31 def created_time @created_time end |
#deviceprofile_id ⇒ String
Deviceprofile id if assigned, null if not assigned
35 36 37 |
# File 'lib/mist_api/models/inventory.rb', line 35 def deviceprofile_id @deviceprofile_id end |
#hostname ⇒ String
Hostname reported by the device
39 40 41 |
# File 'lib/mist_api/models/inventory.rb', line 39 def hostname @hostname end |
#hw_rev ⇒ String
Device hardware revision number
43 44 45 |
# File 'lib/mist_api/models/inventory.rb', line 43 def hw_rev @hw_rev end |
#id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization
47 48 49 |
# File 'lib/mist_api/models/inventory.rb', line 47 def id @id end |
#jsi ⇒ TrueClass | FalseClass
Unique ID of the object instance in the Mist Organization
51 52 53 |
# File 'lib/mist_api/models/inventory.rb', line 51 def jsi @jsi end |
#mac ⇒ String
Device MAC address
55 56 57 |
# File 'lib/mist_api/models/inventory.rb', line 55 def mac @mac end |
#magic ⇒ String
Device claim code
59 60 61 |
# File 'lib/mist_api/models/inventory.rb', line 59 def magic @magic end |
#model ⇒ String
Device model
63 64 65 |
# File 'lib/mist_api/models/inventory.rb', line 63 def model @model end |
#modified_time ⇒ Float
When the object has been modified for the last time, in epoch
67 68 69 |
# File 'lib/mist_api/models/inventory.rb', line 67 def modified_time @modified_time end |
#name ⇒ String
Device name if configured
71 72 73 |
# File 'lib/mist_api/models/inventory.rb', line 71 def name @name end |
#org_id ⇒ UUID | String
Device name if configured
75 76 77 |
# File 'lib/mist_api/models/inventory.rb', line 75 def org_id @org_id end |
#serial ⇒ String
Device serial
79 80 81 |
# File 'lib/mist_api/models/inventory.rb', line 79 def serial @serial end |
#site_id ⇒ UUID | String
Device serial
83 84 85 |
# File 'lib/mist_api/models/inventory.rb', line 83 def site_id @site_id end |
#sku ⇒ String
Device stock keeping unit
87 88 89 |
# File 'lib/mist_api/models/inventory.rb', line 87 def sku @sku end |
#type ⇒ DeviceTypeDefaultApEnum
enum: ‘ap`, `gateway`, `switch`
91 92 93 |
# File 'lib/mist_api/models/inventory.rb', line 91 def type @type end |
#vc_mac ⇒ String
If ‘type`==`switch` and device part of a Virtual Chassis, MAC Address of the Virtual Chassis. if `type`==`gateway` and device part of a Cluster, MAC Address of the Cluster
97 98 99 |
# File 'lib/mist_api/models/inventory.rb', line 97 def vc_mac @vc_mac end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 |
# File 'lib/mist_api/models/inventory.rb', line 191 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. adopted = hash.key?('adopted') ? hash['adopted'] : SKIP chassis_mac = hash.key?('chassis_mac') ? hash['chassis_mac'] : SKIP chassis_serial = hash.key?('chassis_serial') ? hash['chassis_serial'] : SKIP connected = hash.key?('connected') ? hash['connected'] : SKIP created_time = hash.key?('created_time') ? hash['created_time'] : SKIP deviceprofile_id = hash.key?('deviceprofile_id') ? hash['deviceprofile_id'] : SKIP hostname = hash.key?('hostname') ? hash['hostname'] : SKIP hw_rev = hash.key?('hw_rev') ? hash['hw_rev'] : SKIP id = hash.key?('id') ? hash['id'] : SKIP jsi = hash.key?('jsi') ? hash['jsi'] : SKIP mac = hash.key?('mac') ? hash['mac'] : SKIP magic = hash.key?('magic') ? hash['magic'] : SKIP model = hash.key?('model') ? hash['model'] : SKIP modified_time = hash.key?('modified_time') ? hash['modified_time'] : SKIP name = hash.key?('name') ? hash['name'] : SKIP org_id = hash.key?('org_id') ? hash['org_id'] : SKIP serial = hash.key?('serial') ? hash['serial'] : SKIP site_id = hash.key?('site_id') ? hash['site_id'] : SKIP sku = hash.key?('sku') ? hash['sku'] : SKIP type = hash['type'] ||= DeviceTypeDefaultApEnum::AP vc_mac = hash.key?('vc_mac') ? hash['vc_mac'] : SKIP # Create object from extracted values. Inventory.new(adopted, chassis_mac, chassis_serial, connected, created_time, deviceprofile_id, hostname, hw_rev, id, jsi, mac, magic, model, modified_time, name, org_id, serial, site_id, sku, type, vc_mac) end |
.names ⇒ Object
A mapping from model property names to API property names.
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'lib/mist_api/models/inventory.rb', line 100 def self.names @_hash = {} if @_hash.nil? @_hash['adopted'] = 'adopted' @_hash['chassis_mac'] = 'chassis_mac' @_hash['chassis_serial'] = 'chassis_serial' @_hash['connected'] = 'connected' @_hash['created_time'] = 'created_time' @_hash['deviceprofile_id'] = 'deviceprofile_id' @_hash['hostname'] = 'hostname' @_hash['hw_rev'] = 'hw_rev' @_hash['id'] = 'id' @_hash['jsi'] = 'jsi' @_hash['mac'] = 'mac' @_hash['magic'] = 'magic' @_hash['model'] = 'model' @_hash['modified_time'] = 'modified_time' @_hash['name'] = 'name' @_hash['org_id'] = 'org_id' @_hash['serial'] = 'serial' @_hash['site_id'] = 'site_id' @_hash['sku'] = 'sku' @_hash['type'] = 'type' @_hash['vc_mac'] = 'vc_mac' @_hash end |
.nullables ⇒ Object
An array for nullable fields
154 155 156 157 158 |
# File 'lib/mist_api/models/inventory.rb', line 154 def self.nullables %w[ deviceprofile_id ] end |
.optionals ⇒ Object
An array for optional fields
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
# File 'lib/mist_api/models/inventory.rb', line 127 def self.optionals %w[ adopted chassis_mac chassis_serial connected created_time deviceprofile_id hostname hw_rev id jsi mac magic model modified_time name org_id serial site_id sku type vc_mac ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
255 256 257 258 259 260 261 262 263 264 265 |
# File 'lib/mist_api/models/inventory.rb', line 255 def inspect class_name = self.class.name.split('::').last "<#{class_name} adopted: #{@adopted.inspect}, chassis_mac: #{@chassis_mac.inspect},"\ " chassis_serial: #{@chassis_serial.inspect}, connected: #{@connected.inspect},"\ " created_time: #{@created_time.inspect}, deviceprofile_id: #{@deviceprofile_id.inspect},"\ " hostname: #{@hostname.inspect}, hw_rev: #{@hw_rev.inspect}, id: #{@id.inspect}, jsi:"\ " #{@jsi.inspect}, mac: #{@mac.inspect}, magic: #{@magic.inspect}, model: #{@model.inspect},"\ " modified_time: #{@modified_time.inspect}, name: #{@name.inspect}, org_id:"\ " #{@org_id.inspect}, serial: #{@serial.inspect}, site_id: #{@site_id.inspect}, sku:"\ " #{@sku.inspect}, type: #{@type.inspect}, vc_mac: #{@vc_mac.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
244 245 246 247 248 249 250 251 252 |
# File 'lib/mist_api/models/inventory.rb', line 244 def to_s class_name = self.class.name.split('::').last "<#{class_name} adopted: #{@adopted}, chassis_mac: #{@chassis_mac}, chassis_serial:"\ " #{@chassis_serial}, connected: #{@connected}, created_time: #{@created_time},"\ " deviceprofile_id: #{@deviceprofile_id}, hostname: #{@hostname}, hw_rev: #{@hw_rev}, id:"\ " #{@id}, jsi: #{@jsi}, mac: #{@mac}, magic: #{@magic}, model: #{@model}, modified_time:"\ " #{@modified_time}, name: #{@name}, org_id: #{@org_id}, serial: #{@serial}, site_id:"\ " #{@site_id}, sku: #{@sku}, type: #{@type}, vc_mac: #{@vc_mac}>" end |