Class: MistApi::JunosOtherIpConfig
- Defined in:
- lib/mist_api/models/junos_other_ip_config.rb
Overview
Optional, if it’s required to have switch’s L3 presence on a network/vlan
Instance Attribute Summary collapse
-
#evpn_anycast ⇒ TrueClass | FalseClass
For EVPN, if anycast is desired.
-
#ip ⇒ String
Required if ‘type`==`static`.
-
#ip6 ⇒ String
Required if ‘type6`==`static`.
-
#netmask ⇒ String
Optional, ‘subnet` from `network` definition will be used if defined.
-
#netmask6 ⇒ String
Optional, ‘subnet` from `network` definition will be used if defined.
-
#type ⇒ IpTypeEnum
enum: ‘dhcp`, `static`.
-
#type6 ⇒ IpType6Enum
enum: ‘autoconf`, `dhcp`, `disabled`, `static`.
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(evpn_anycast = false, ip = SKIP, ip6 = SKIP, netmask = SKIP, netmask6 = SKIP, type = IpTypeEnum::DHCP, type6 = IpType6Enum::DISABLED) ⇒ JunosOtherIpConfig
constructor
A new instance of JunosOtherIpConfig.
-
#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(evpn_anycast = false, ip = SKIP, ip6 = SKIP, netmask = SKIP, netmask6 = SKIP, type = IpTypeEnum::DHCP, type6 = IpType6Enum::DISABLED) ⇒ JunosOtherIpConfig
Returns a new instance of JunosOtherIpConfig.
71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/mist_api/models/junos_other_ip_config.rb', line 71 def initialize(evpn_anycast = false, ip = SKIP, ip6 = SKIP, netmask = SKIP, netmask6 = SKIP, type = IpTypeEnum::DHCP, type6 = IpType6Enum::DISABLED) @evpn_anycast = evpn_anycast unless evpn_anycast == SKIP @ip = ip unless ip == SKIP @ip6 = ip6 unless ip6 == SKIP @netmask = netmask unless netmask == SKIP @netmask6 = netmask6 unless netmask6 == SKIP @type = type unless type == SKIP @type6 = type6 unless type6 == SKIP end |
Instance Attribute Details
#evpn_anycast ⇒ TrueClass | FalseClass
For EVPN, if anycast is desired
14 15 16 |
# File 'lib/mist_api/models/junos_other_ip_config.rb', line 14 def evpn_anycast @evpn_anycast end |
#ip ⇒ String
Required if ‘type`==`static`
18 19 20 |
# File 'lib/mist_api/models/junos_other_ip_config.rb', line 18 def ip @ip end |
#ip6 ⇒ String
Required if ‘type6`==`static`
22 23 24 |
# File 'lib/mist_api/models/junos_other_ip_config.rb', line 22 def ip6 @ip6 end |
#netmask ⇒ String
Optional, ‘subnet` from `network` definition will be used if defined
26 27 28 |
# File 'lib/mist_api/models/junos_other_ip_config.rb', line 26 def netmask @netmask end |
#netmask6 ⇒ String
Optional, ‘subnet` from `network` definition will be used if defined
30 31 32 |
# File 'lib/mist_api/models/junos_other_ip_config.rb', line 30 def netmask6 @netmask6 end |
#type ⇒ IpTypeEnum
enum: ‘dhcp`, `static`
34 35 36 |
# File 'lib/mist_api/models/junos_other_ip_config.rb', line 34 def type @type end |
#type6 ⇒ IpType6Enum
enum: ‘autoconf`, `dhcp`, `disabled`, `static`
38 39 40 |
# File 'lib/mist_api/models/junos_other_ip_config.rb', line 38 def type6 @type6 end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/mist_api/models/junos_other_ip_config.rb', line 84 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. evpn_anycast = hash['evpn_anycast'] ||= false ip = hash.key?('ip') ? hash['ip'] : SKIP ip6 = hash.key?('ip6') ? hash['ip6'] : 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 # Create object from extracted values. JunosOtherIpConfig.new(evpn_anycast, ip, ip6, netmask, netmask6, type, type6) end |
.names ⇒ Object
A mapping from model property names to API property names.
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/mist_api/models/junos_other_ip_config.rb', line 41 def self.names @_hash = {} if @_hash.nil? @_hash['evpn_anycast'] = 'evpn_anycast' @_hash['ip'] = 'ip' @_hash['ip6'] = 'ip6' @_hash['netmask'] = 'netmask' @_hash['netmask6'] = 'netmask6' @_hash['type'] = 'type' @_hash['type6'] = 'type6' @_hash end |
.nullables ⇒ Object
An array for nullable fields
67 68 69 |
# File 'lib/mist_api/models/junos_other_ip_config.rb', line 67 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/mist_api/models/junos_other_ip_config.rb', line 54 def self.optionals %w[ evpn_anycast ip ip6 netmask netmask6 type type6 ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
114 115 116 117 118 119 |
# File 'lib/mist_api/models/junos_other_ip_config.rb', line 114 def inspect class_name = self.class.name.split('::').last "<#{class_name} evpn_anycast: #{@evpn_anycast.inspect}, ip: #{@ip.inspect}, ip6:"\ " #{@ip6.inspect}, netmask: #{@netmask.inspect}, netmask6: #{@netmask6.inspect}, type:"\ " #{@type.inspect}, type6: #{@type6.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
107 108 109 110 111 |
# File 'lib/mist_api/models/junos_other_ip_config.rb', line 107 def to_s class_name = self.class.name.split('::').last "<#{class_name} evpn_anycast: #{@evpn_anycast}, ip: #{@ip}, ip6: #{@ip6}, netmask:"\ " #{@netmask}, netmask6: #{@netmask6}, type: #{@type}, type6: #{@type6}>" end |