Class: MistApi::ApIpConfig
- Defined in:
- lib/mist_api/models/ap_ip_config.rb
Overview
IP AP settings
Instance Attribute Summary collapse
-
#dns ⇒ Array[String]
If ‘type`==`static`.
-
#dns_suffix ⇒ Array[String]
Required if ‘type`==`static`.
-
#gateway ⇒ String
Required if ‘type`==`static`.
-
#gateway6 ⇒ String
Required if ‘type`==`static`.
-
#ip ⇒ String
Required if ‘type`==`static`.
-
#ip6 ⇒ String
Required if ‘type`==`static`.
-
#mtu ⇒ Integer
Required if ‘type`==`static`.
-
#netmask ⇒ String
Required if ‘type`==`static`.
-
#netmask6 ⇒ String
Required if ‘type`==`static`.
-
#type ⇒ IpTypeEnum
enum: ‘dhcp`, `static`.
-
#type6 ⇒ IpType6Enum
enum: ‘autoconf`, `dhcp`, `disabled`, `static`.
-
#vlan_id ⇒ Integer
Management VLAN id, default is 1 (untagged).
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(dns = SKIP, dns_suffix = SKIP, gateway = SKIP, gateway6 = SKIP, ip = SKIP, ip6 = SKIP, mtu = SKIP, netmask = SKIP, netmask6 = SKIP, type = IpTypeEnum::DHCP, type6 = IpType6Enum::DISABLED, vlan_id = 1) ⇒ ApIpConfig
constructor
A new instance of ApIpConfig.
-
#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(dns = SKIP, dns_suffix = SKIP, gateway = SKIP, gateway6 = SKIP, ip = SKIP, ip6 = SKIP, mtu = SKIP, netmask = SKIP, netmask6 = SKIP, type = IpTypeEnum::DHCP, type6 = IpType6Enum::DISABLED, vlan_id = 1) ⇒ ApIpConfig
Returns a new instance of ApIpConfig.
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/mist_api/models/ap_ip_config.rb', line 101 def initialize(dns = SKIP, dns_suffix = SKIP, gateway = SKIP, gateway6 = SKIP, ip = SKIP, ip6 = SKIP, mtu = SKIP, netmask = SKIP, netmask6 = SKIP, type = IpTypeEnum::DHCP, type6 = IpType6Enum::DISABLED, vlan_id = 1) @dns = dns unless dns == SKIP @dns_suffix = dns_suffix unless dns_suffix == SKIP @gateway = gateway unless gateway == SKIP @gateway6 = gateway6 unless gateway6 == SKIP @ip = ip unless ip == SKIP @ip6 = ip6 unless ip6 == SKIP @mtu = mtu unless mtu == SKIP @netmask = netmask unless netmask == SKIP @netmask6 = netmask6 unless netmask6 == SKIP @type = type unless type == SKIP @type6 = type6 unless type6 == SKIP @vlan_id = vlan_id unless vlan_id == SKIP end |
Instance Attribute Details
#dns ⇒ Array[String]
If ‘type`==`static`
14 15 16 |
# File 'lib/mist_api/models/ap_ip_config.rb', line 14 def dns @dns end |
#dns_suffix ⇒ Array[String]
Required if ‘type`==`static`
18 19 20 |
# File 'lib/mist_api/models/ap_ip_config.rb', line 18 def dns_suffix @dns_suffix end |
#gateway ⇒ String
Required if ‘type`==`static`
22 23 24 |
# File 'lib/mist_api/models/ap_ip_config.rb', line 22 def gateway @gateway end |
#gateway6 ⇒ String
Required if ‘type`==`static`
26 27 28 |
# File 'lib/mist_api/models/ap_ip_config.rb', line 26 def gateway6 @gateway6 end |
#ip ⇒ String
Required if ‘type`==`static`
30 31 32 |
# File 'lib/mist_api/models/ap_ip_config.rb', line 30 def ip @ip end |
#ip6 ⇒ String
Required if ‘type`==`static`
34 35 36 |
# File 'lib/mist_api/models/ap_ip_config.rb', line 34 def ip6 @ip6 end |
#mtu ⇒ Integer
Required if ‘type`==`static`
38 39 40 |
# File 'lib/mist_api/models/ap_ip_config.rb', line 38 def mtu @mtu end |
#netmask ⇒ String
Required if ‘type`==`static`
42 43 44 |
# File 'lib/mist_api/models/ap_ip_config.rb', line 42 def netmask @netmask end |
#netmask6 ⇒ String
Required if ‘type`==`static`
46 47 48 |
# File 'lib/mist_api/models/ap_ip_config.rb', line 46 def netmask6 @netmask6 end |
#type ⇒ IpTypeEnum
enum: ‘dhcp`, `static`
50 51 52 |
# File 'lib/mist_api/models/ap_ip_config.rb', line 50 def type @type end |
#type6 ⇒ IpType6Enum
enum: ‘autoconf`, `dhcp`, `disabled`, `static`
54 55 56 |
# File 'lib/mist_api/models/ap_ip_config.rb', line 54 def type6 @type6 end |
#vlan_id ⇒ Integer
Management VLAN id, default is 1 (untagged)
58 59 60 |
# File 'lib/mist_api/models/ap_ip_config.rb', line 58 def vlan_id @vlan_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
# File 'lib/mist_api/models/ap_ip_config.rb', line 120 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. dns = hash.key?('dns') ? hash['dns'] : SKIP dns_suffix = hash.key?('dns_suffix') ? hash['dns_suffix'] : SKIP gateway = hash.key?('gateway') ? hash['gateway'] : SKIP gateway6 = hash.key?('gateway6') ? hash['gateway6'] : SKIP ip = hash.key?('ip') ? hash['ip'] : SKIP ip6 = hash.key?('ip6') ? hash['ip6'] : SKIP mtu = hash.key?('mtu') ? hash['mtu'] : SKIP netmask = hash.key?('netmask') ? hash['netmask'] : SKIP netmask6 = hash.key?('netmask6') ? hash['netmask6'] : SKIP type = hash['type'] ||= IpTypeEnum::DHCP type6 = hash['type6'] ||= IpType6Enum::DISABLED vlan_id = hash['vlan_id'] ||= 1 # Create object from extracted values. ApIpConfig.new(dns, dns_suffix, gateway, gateway6, ip, ip6, mtu, netmask, netmask6, type, type6, vlan_id) end |
.names ⇒ Object
A mapping from model property names to API property names.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/mist_api/models/ap_ip_config.rb', line 61 def self.names @_hash = {} if @_hash.nil? @_hash['dns'] = 'dns' @_hash['dns_suffix'] = 'dns_suffix' @_hash['gateway'] = 'gateway' @_hash['gateway6'] = 'gateway6' @_hash['ip'] = 'ip' @_hash['ip6'] = 'ip6' @_hash['mtu'] = 'mtu' @_hash['netmask'] = 'netmask' @_hash['netmask6'] = 'netmask6' @_hash['type'] = 'type' @_hash['type6'] = 'type6' @_hash['vlan_id'] = 'vlan_id' @_hash end |
.nullables ⇒ Object
An array for nullable fields
97 98 99 |
# File 'lib/mist_api/models/ap_ip_config.rb', line 97 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/mist_api/models/ap_ip_config.rb', line 79 def self.optionals %w[ dns dns_suffix gateway gateway6 ip ip6 mtu netmask netmask6 type type6 vlan_id ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
161 162 163 164 165 166 167 168 |
# File 'lib/mist_api/models/ap_ip_config.rb', line 161 def inspect class_name = self.class.name.split('::').last "<#{class_name} dns: #{@dns.inspect}, dns_suffix: #{@dns_suffix.inspect}, gateway:"\ " #{@gateway.inspect}, gateway6: #{@gateway6.inspect}, ip: #{@ip.inspect}, ip6:"\ " #{@ip6.inspect}, mtu: #{@mtu.inspect}, netmask: #{@netmask.inspect}, netmask6:"\ " #{@netmask6.inspect}, type: #{@type.inspect}, type6: #{@type6.inspect}, vlan_id:"\ " #{@vlan_id.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
153 154 155 156 157 158 |
# File 'lib/mist_api/models/ap_ip_config.rb', line 153 def to_s class_name = self.class.name.split('::').last "<#{class_name} dns: #{@dns}, dns_suffix: #{@dns_suffix}, gateway: #{@gateway}, gateway6:"\ " #{@gateway6}, ip: #{@ip}, ip6: #{@ip6}, mtu: #{@mtu}, netmask: #{@netmask}, netmask6:"\ " #{@netmask6}, type: #{@type}, type6: #{@type6}, vlan_id: #{@vlan_id}>" end |