Class: MistApi::SwitchOobIpConfig
- Defined in:
- lib/mist_api/models/switch_oob_ip_config.rb
Overview
Switch OOB IP Config: - If HA configuration: key parameter will be nodeX (eg: node1) - If there are 2 routing engines, re1 mgmt IP has to be set separately (if desired): key parameter = ‘re1`
Instance Attribute Summary collapse
-
#gateway ⇒ String
TODO: Write general description for this method.
-
#ip ⇒ String
TODO: Write general description for this method.
-
#netmask ⇒ String
Used only if ‘subnet` is not specified in `networks`.
-
#network ⇒ String
Optional, the network to be used for mgmt.
-
#type ⇒ IpTypeEnum
enum: ‘dhcp`, `static`.
-
#use_mgmt_vrf ⇒ TrueClass | FalseClass
If supported on the platform.
-
#use_mgmt_vrf_for_host_out ⇒ TrueClass | FalseClass
For host-out traffic (NTP/TACPLUS/RADIUS/SYSLOG/SNMP), if alternative source network/ip is desired.
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(gateway = SKIP, ip = SKIP, netmask = SKIP, network = SKIP, type = IpTypeEnum::DHCP, use_mgmt_vrf = false, use_mgmt_vrf_for_host_out = false) ⇒ SwitchOobIpConfig
constructor
A new instance of SwitchOobIpConfig.
-
#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(gateway = SKIP, ip = SKIP, netmask = SKIP, network = SKIP, type = IpTypeEnum::DHCP, use_mgmt_vrf = false, use_mgmt_vrf_for_host_out = false) ⇒ SwitchOobIpConfig
Returns a new instance of SwitchOobIpConfig.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/mist_api/models/switch_oob_ip_config.rb', line 75 def initialize(gateway = SKIP, ip = SKIP, netmask = SKIP, network = SKIP, type = IpTypeEnum::DHCP, use_mgmt_vrf = false, use_mgmt_vrf_for_host_out = false) @gateway = gateway unless gateway == SKIP @ip = ip unless ip == SKIP @netmask = netmask unless netmask == SKIP @network = network unless network == SKIP @type = type unless type == SKIP @use_mgmt_vrf = use_mgmt_vrf unless use_mgmt_vrf == SKIP unless use_mgmt_vrf_for_host_out == SKIP @use_mgmt_vrf_for_host_out = use_mgmt_vrf_for_host_out end end |
Instance Attribute Details
#gateway ⇒ String
TODO: Write general description for this method
16 17 18 |
# File 'lib/mist_api/models/switch_oob_ip_config.rb', line 16 def gateway @gateway end |
#ip ⇒ String
TODO: Write general description for this method
20 21 22 |
# File 'lib/mist_api/models/switch_oob_ip_config.rb', line 20 def ip @ip end |
#netmask ⇒ String
Used only if ‘subnet` is not specified in `networks`
24 25 26 |
# File 'lib/mist_api/models/switch_oob_ip_config.rb', line 24 def netmask @netmask end |
#network ⇒ String
Optional, the network to be used for mgmt
28 29 30 |
# File 'lib/mist_api/models/switch_oob_ip_config.rb', line 28 def network @network end |
#type ⇒ IpTypeEnum
enum: ‘dhcp`, `static`
32 33 34 |
# File 'lib/mist_api/models/switch_oob_ip_config.rb', line 32 def type @type end |
#use_mgmt_vrf ⇒ TrueClass | FalseClass
If supported on the platform. If enabled, DNS will be using this routing-instance, too
37 38 39 |
# File 'lib/mist_api/models/switch_oob_ip_config.rb', line 37 def use_mgmt_vrf @use_mgmt_vrf end |
#use_mgmt_vrf_for_host_out ⇒ TrueClass | FalseClass
For host-out traffic (NTP/TACPLUS/RADIUS/SYSLOG/SNMP), if alternative source network/ip is desired
42 43 44 |
# File 'lib/mist_api/models/switch_oob_ip_config.rb', line 42 def use_mgmt_vrf_for_host_out @use_mgmt_vrf_for_host_out end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/mist_api/models/switch_oob_ip_config.rb', line 91 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. gateway = hash.key?('gateway') ? hash['gateway'] : SKIP ip = hash.key?('ip') ? hash['ip'] : SKIP netmask = hash.key?('netmask') ? hash['netmask'] : SKIP network = hash.key?('network') ? hash['network'] : SKIP type = hash['type'] ||= IpTypeEnum::DHCP use_mgmt_vrf = hash['use_mgmt_vrf'] ||= false use_mgmt_vrf_for_host_out = hash['use_mgmt_vrf_for_host_out'] ||= false # Create object from extracted values. SwitchOobIpConfig.new(gateway, ip, netmask, network, type, use_mgmt_vrf, use_mgmt_vrf_for_host_out) end |
.names ⇒ Object
A mapping from model property names to API property names.
45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/mist_api/models/switch_oob_ip_config.rb', line 45 def self.names @_hash = {} if @_hash.nil? @_hash['gateway'] = 'gateway' @_hash['ip'] = 'ip' @_hash['netmask'] = 'netmask' @_hash['network'] = 'network' @_hash['type'] = 'type' @_hash['use_mgmt_vrf'] = 'use_mgmt_vrf' @_hash['use_mgmt_vrf_for_host_out'] = 'use_mgmt_vrf_for_host_out' @_hash end |
.nullables ⇒ Object
An array for nullable fields
71 72 73 |
# File 'lib/mist_api/models/switch_oob_ip_config.rb', line 71 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/mist_api/models/switch_oob_ip_config.rb', line 58 def self.optionals %w[ gateway ip netmask network type use_mgmt_vrf use_mgmt_vrf_for_host_out ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
122 123 124 125 126 127 128 |
# File 'lib/mist_api/models/switch_oob_ip_config.rb', line 122 def inspect class_name = self.class.name.split('::').last "<#{class_name} gateway: #{@gateway.inspect}, ip: #{@ip.inspect}, netmask:"\ " #{@netmask.inspect}, network: #{@network.inspect}, type: #{@type.inspect}, use_mgmt_vrf:"\ " #{@use_mgmt_vrf.inspect}, use_mgmt_vrf_for_host_out:"\ " #{@use_mgmt_vrf_for_host_out.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
114 115 116 117 118 119 |
# File 'lib/mist_api/models/switch_oob_ip_config.rb', line 114 def to_s class_name = self.class.name.split('::').last "<#{class_name} gateway: #{@gateway}, ip: #{@ip}, netmask: #{@netmask}, network:"\ " #{@network}, type: #{@type}, use_mgmt_vrf: #{@use_mgmt_vrf}, use_mgmt_vrf_for_host_out:"\ " #{@use_mgmt_vrf_for_host_out}>" end |