Class: MistApi::JunosPortConfig
- Defined in:
- lib/mist_api/models/junos_port_config.rb
Overview
Switch port config
Instance Attribute Summary collapse
-
#ae_disable_lacp ⇒ TrueClass | FalseClass
To disable LACP support for the AE interface.
-
#ae_idx ⇒ Integer
Users could force to use the designated AE name.
-
#ae_lacp_force_up ⇒ TrueClass | FalseClass
If ‘aggregated`==`true`, sets the state of the interface as UP when the peer has limited LACP capability.
-
#ae_lacp_slow ⇒ TrueClass | FalseClass
To use slow timeout.
-
#aggregated ⇒ TrueClass | FalseClass
To use slow timeout.
-
#critical ⇒ TrueClass | FalseClass
To generate port up/down alarm.
-
#description ⇒ String
To generate port up/down alarm.
-
#disable_autoneg ⇒ TrueClass | FalseClass
If ‘speed` and `duplex` are specified, whether to disable autonegotiation.
-
#duplex ⇒ JunosPortConfigDuplexEnum
enum: ‘auto`, `full`, `half`.
-
#dynamic_usage ⇒ String
Enable dynamic usage for this port.
-
#esilag ⇒ TrueClass | FalseClass
Enable dynamic usage for this port.
-
#mtu ⇒ Integer
Media maximum transmission unit (MTU) is the largest data unit that can be forwarded without fragmentation.
-
#networks ⇒ Array[String]
List of network names.
-
#no_local_overwrite ⇒ TrueClass | FalseClass
Prevent helpdesk to override the port config.
-
#poe_disabled ⇒ TrueClass | FalseClass
Prevent helpdesk to override the port config.
-
#port_network ⇒ String
Required if ‘usage`==`vlan_tunnel`.
-
#speed ⇒ JunosPortConfigSpeedEnum
enum: ‘100m`, `10m`, `1g`, `2.5g`, `5g`, `10g`, `25g`, `40g`, `100g`,`auto`.
-
#usage ⇒ String
Port usage name.
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(usage = nil, ae_disable_lacp = SKIP, ae_idx = SKIP, ae_lacp_force_up = false, ae_lacp_slow = SKIP, aggregated = false, critical = false, description = SKIP, disable_autoneg = false, duplex = JunosPortConfigDuplexEnum::AUTO, dynamic_usage = SKIP, esilag = SKIP, mtu = 1514, networks = SKIP, no_local_overwrite = true, poe_disabled = false, port_network = SKIP, speed = JunosPortConfigSpeedEnum::AUTO) ⇒ JunosPortConfig
constructor
A new instance of JunosPortConfig.
-
#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(usage = nil, ae_disable_lacp = SKIP, ae_idx = SKIP, ae_lacp_force_up = false, ae_lacp_slow = SKIP, aggregated = false, critical = false, description = SKIP, disable_autoneg = false, duplex = JunosPortConfigDuplexEnum::AUTO, dynamic_usage = SKIP, esilag = SKIP, mtu = 1514, networks = SKIP, no_local_overwrite = true, poe_disabled = false, port_network = SKIP, speed = JunosPortConfigSpeedEnum::AUTO) ⇒ JunosPortConfig
Returns a new instance of JunosPortConfig.
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
# File 'lib/mist_api/models/junos_port_config.rb', line 150 def initialize(usage = nil, ae_disable_lacp = SKIP, ae_idx = SKIP, ae_lacp_force_up = false, ae_lacp_slow = SKIP, aggregated = false, critical = false, description = SKIP, disable_autoneg = false, duplex = JunosPortConfigDuplexEnum::AUTO, dynamic_usage = SKIP, esilag = SKIP, mtu = 1514, networks = SKIP, no_local_overwrite = true, poe_disabled = false, port_network = SKIP, speed = JunosPortConfigSpeedEnum::AUTO) @ae_disable_lacp = ae_disable_lacp unless ae_disable_lacp == SKIP @ae_idx = ae_idx unless ae_idx == SKIP @ae_lacp_force_up = ae_lacp_force_up unless ae_lacp_force_up == SKIP @ae_lacp_slow = ae_lacp_slow unless ae_lacp_slow == SKIP @aggregated = aggregated unless aggregated == SKIP @critical = critical unless critical == SKIP @description = description unless description == SKIP @disable_autoneg = disable_autoneg unless disable_autoneg == SKIP @duplex = duplex unless duplex == SKIP @dynamic_usage = dynamic_usage unless dynamic_usage == SKIP @esilag = esilag unless esilag == SKIP @mtu = mtu unless mtu == SKIP @networks = networks unless networks == SKIP @no_local_overwrite = no_local_overwrite unless no_local_overwrite == SKIP @poe_disabled = poe_disabled unless poe_disabled == SKIP @port_network = port_network unless port_network == SKIP @speed = speed unless speed == SKIP @usage = usage end |
Instance Attribute Details
#ae_disable_lacp ⇒ TrueClass | FalseClass
To disable LACP support for the AE interface
14 15 16 |
# File 'lib/mist_api/models/junos_port_config.rb', line 14 def ae_disable_lacp @ae_disable_lacp end |
#ae_idx ⇒ Integer
Users could force to use the designated AE name
18 19 20 |
# File 'lib/mist_api/models/junos_port_config.rb', line 18 def ae_idx @ae_idx end |
#ae_lacp_force_up ⇒ TrueClass | FalseClass
If ‘aggregated`==`true`, sets the state of the interface as UP when the peer has limited LACP capability. Use case: When a device connected to this AE port is ZTPing for the first time, it will not have LACP configured on the other end. Note: Turning this on will enable force-up on one of the interfaces in the bundle only
26 27 28 |
# File 'lib/mist_api/models/junos_port_config.rb', line 26 def ae_lacp_force_up @ae_lacp_force_up end |
#ae_lacp_slow ⇒ TrueClass | FalseClass
To use slow timeout
30 31 32 |
# File 'lib/mist_api/models/junos_port_config.rb', line 30 def ae_lacp_slow @ae_lacp_slow end |
#aggregated ⇒ TrueClass | FalseClass
To use slow timeout
34 35 36 |
# File 'lib/mist_api/models/junos_port_config.rb', line 34 def aggregated @aggregated end |
#critical ⇒ TrueClass | FalseClass
To generate port up/down alarm
38 39 40 |
# File 'lib/mist_api/models/junos_port_config.rb', line 38 def critical @critical end |
#description ⇒ String
To generate port up/down alarm
42 43 44 |
# File 'lib/mist_api/models/junos_port_config.rb', line 42 def description @description end |
#disable_autoneg ⇒ TrueClass | FalseClass
If ‘speed` and `duplex` are specified, whether to disable autonegotiation
46 47 48 |
# File 'lib/mist_api/models/junos_port_config.rb', line 46 def disable_autoneg @disable_autoneg end |
#duplex ⇒ JunosPortConfigDuplexEnum
enum: ‘auto`, `full`, `half`
50 51 52 |
# File 'lib/mist_api/models/junos_port_config.rb', line 50 def duplex @duplex end |
#dynamic_usage ⇒ String
Enable dynamic usage for this port. Set to ‘dynamic` to enable.
54 55 56 |
# File 'lib/mist_api/models/junos_port_config.rb', line 54 def dynamic_usage @dynamic_usage end |
#esilag ⇒ TrueClass | FalseClass
Enable dynamic usage for this port. Set to ‘dynamic` to enable.
58 59 60 |
# File 'lib/mist_api/models/junos_port_config.rb', line 58 def esilag @esilag end |
#mtu ⇒ Integer
Media maximum transmission unit (MTU) is the largest data unit that can be forwarded without fragmentation
63 64 65 |
# File 'lib/mist_api/models/junos_port_config.rb', line 63 def mtu @mtu end |
#networks ⇒ Array[String]
List of network names. Required if ‘usage`==`inet`
67 68 69 |
# File 'lib/mist_api/models/junos_port_config.rb', line 67 def networks @networks end |
#no_local_overwrite ⇒ TrueClass | FalseClass
Prevent helpdesk to override the port config
71 72 73 |
# File 'lib/mist_api/models/junos_port_config.rb', line 71 def no_local_overwrite @no_local_overwrite end |
#poe_disabled ⇒ TrueClass | FalseClass
Prevent helpdesk to override the port config
75 76 77 |
# File 'lib/mist_api/models/junos_port_config.rb', line 75 def poe_disabled @poe_disabled end |
#port_network ⇒ String
Required if ‘usage`==`vlan_tunnel`. Q-in-Q tunneling using All-in-one bundling. This also enables standard L2PT for interfaces that are not encapsulation tunnel interfaces and uses MAC rewrite operation. [View more information](www.juniper.net/documentation/us/en/software/junos/mu lticast-l2/topics/topic-map/q-in-q.html#id-understanding-qinq-tunneling-an d-vlan-translation)
84 85 86 |
# File 'lib/mist_api/models/junos_port_config.rb', line 84 def port_network @port_network end |
#speed ⇒ JunosPortConfigSpeedEnum
enum: ‘100m`, `10m`, `1g`, `2.5g`, `5g`, `10g`, `25g`, `40g`, `100g`,`auto`
89 90 91 |
# File 'lib/mist_api/models/junos_port_config.rb', line 89 def speed @speed end |
#usage ⇒ String
Port usage name. For Q-in-Q, use ‘vlan_tunnel`. If EVPN is used, use `evpn_uplink`or `evpn_downlink`
94 95 96 |
# File 'lib/mist_api/models/junos_port_config.rb', line 94 def usage @usage end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
180 181 182 183 184 185 186 187 188 189 190 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 |
# File 'lib/mist_api/models/junos_port_config.rb', line 180 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. usage = hash.key?('usage') ? hash['usage'] : nil ae_disable_lacp = hash.key?('ae_disable_lacp') ? hash['ae_disable_lacp'] : SKIP ae_idx = hash.key?('ae_idx') ? hash['ae_idx'] : SKIP ae_lacp_force_up = hash['ae_lacp_force_up'] ||= false ae_lacp_slow = hash.key?('ae_lacp_slow') ? hash['ae_lacp_slow'] : SKIP aggregated = hash['aggregated'] ||= false critical = hash['critical'] ||= false description = hash.key?('description') ? hash['description'] : SKIP disable_autoneg = hash['disable_autoneg'] ||= false duplex = hash['duplex'] ||= JunosPortConfigDuplexEnum::AUTO dynamic_usage = hash.key?('dynamic_usage') ? hash['dynamic_usage'] : SKIP esilag = hash.key?('esilag') ? hash['esilag'] : SKIP mtu = hash['mtu'] ||= 1514 networks = hash.key?('networks') ? hash['networks'] : SKIP no_local_overwrite = hash['no_local_overwrite'] ||= true poe_disabled = hash['poe_disabled'] ||= false port_network = hash.key?('port_network') ? hash['port_network'] : SKIP speed = hash['speed'] ||= JunosPortConfigSpeedEnum::AUTO # Create object from extracted values. JunosPortConfig.new(usage, ae_disable_lacp, ae_idx, ae_lacp_force_up, ae_lacp_slow, aggregated, critical, description, disable_autoneg, duplex, dynamic_usage, esilag, mtu, networks, no_local_overwrite, poe_disabled, port_network, speed) end |
.names ⇒ Object
A mapping from model property names to API property names.
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/mist_api/models/junos_port_config.rb', line 97 def self.names @_hash = {} if @_hash.nil? @_hash['ae_disable_lacp'] = 'ae_disable_lacp' @_hash['ae_idx'] = 'ae_idx' @_hash['ae_lacp_force_up'] = 'ae_lacp_force_up' @_hash['ae_lacp_slow'] = 'ae_lacp_slow' @_hash['aggregated'] = 'aggregated' @_hash['critical'] = 'critical' @_hash['description'] = 'description' @_hash['disable_autoneg'] = 'disable_autoneg' @_hash['duplex'] = 'duplex' @_hash['dynamic_usage'] = 'dynamic_usage' @_hash['esilag'] = 'esilag' @_hash['mtu'] = 'mtu' @_hash['networks'] = 'networks' @_hash['no_local_overwrite'] = 'no_local_overwrite' @_hash['poe_disabled'] = 'poe_disabled' @_hash['port_network'] = 'port_network' @_hash['speed'] = 'speed' @_hash['usage'] = 'usage' @_hash end |
.nullables ⇒ Object
An array for nullable fields
144 145 146 147 148 |
# File 'lib/mist_api/models/junos_port_config.rb', line 144 def self.nullables %w[ dynamic_usage ] end |
.optionals ⇒ Object
An array for optional fields
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/mist_api/models/junos_port_config.rb', line 121 def self.optionals %w[ ae_disable_lacp ae_idx ae_lacp_force_up ae_lacp_slow aggregated critical description disable_autoneg duplex dynamic_usage esilag mtu networks no_local_overwrite poe_disabled port_network speed ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/mist_api/models/junos_port_config.rb', line 238 def inspect class_name = self.class.name.split('::').last "<#{class_name} ae_disable_lacp: #{@ae_disable_lacp.inspect}, ae_idx: #{@ae_idx.inspect},"\ " ae_lacp_force_up: #{@ae_lacp_force_up.inspect}, ae_lacp_slow: #{@ae_lacp_slow.inspect},"\ " aggregated: #{@aggregated.inspect}, critical: #{@critical.inspect}, description:"\ " #{@description.inspect}, disable_autoneg: #{@disable_autoneg.inspect}, duplex:"\ " #{@duplex.inspect}, dynamic_usage: #{@dynamic_usage.inspect}, esilag: #{@esilag.inspect},"\ " mtu: #{@mtu.inspect}, networks: #{@networks.inspect}, no_local_overwrite:"\ " #{@no_local_overwrite.inspect}, poe_disabled: #{@poe_disabled.inspect}, port_network:"\ " #{@port_network.inspect}, speed: #{@speed.inspect}, usage: #{@usage.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
226 227 228 229 230 231 232 233 234 235 |
# File 'lib/mist_api/models/junos_port_config.rb', line 226 def to_s class_name = self.class.name.split('::').last "<#{class_name} ae_disable_lacp: #{@ae_disable_lacp}, ae_idx: #{@ae_idx}, ae_lacp_force_up:"\ " #{@ae_lacp_force_up}, ae_lacp_slow: #{@ae_lacp_slow}, aggregated: #{@aggregated},"\ " critical: #{@critical}, description: #{@description}, disable_autoneg:"\ " #{@disable_autoneg}, duplex: #{@duplex}, dynamic_usage: #{@dynamic_usage}, esilag:"\ " #{@esilag}, mtu: #{@mtu}, networks: #{@networks}, no_local_overwrite:"\ " #{@no_local_overwrite}, poe_disabled: #{@poe_disabled}, port_network: #{@port_network},"\ " speed: #{@speed}, usage: #{@usage}>" end |