Class: MistApi::SiteMxtunnelAdditionalMxtunnel
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- MistApi::SiteMxtunnelAdditionalMxtunnel
- Defined in:
- lib/mist_api/models/site_mxtunnel_additional_mxtunnel.rb
Overview
SiteMxtunnelAdditionalMxtunnel Model.
Instance Attribute Summary collapse
-
#clusters ⇒ Array[SiteMxtunnelCluster]
For AP, how to connect to tunterm or RadSec Proxy.
-
#hello_interval ⇒ Integer
In seconds, used as heartbeat to detect if a tunnel is alive.
-
#hello_retries ⇒ Integer
In seconds, used as heartbeat to detect if a tunnel is alive.
-
#protocol ⇒ SiteMxtunnelProtocolEnum
enum: ‘ip`, `udp`.
-
#vlan_ids ⇒ Array[Integer]
enum: ‘ip`, `udp`.
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(clusters = SKIP, hello_interval = 60, hello_retries = 7, protocol = SKIP, vlan_ids = SKIP) ⇒ SiteMxtunnelAdditionalMxtunnel
constructor
A new instance of SiteMxtunnelAdditionalMxtunnel.
-
#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(clusters = SKIP, hello_interval = 60, hello_retries = 7, protocol = SKIP, vlan_ids = SKIP) ⇒ SiteMxtunnelAdditionalMxtunnel
Returns a new instance of SiteMxtunnelAdditionalMxtunnel.
61 62 63 64 65 66 67 68 |
# File 'lib/mist_api/models/site_mxtunnel_additional_mxtunnel.rb', line 61 def initialize(clusters = SKIP, hello_interval = 60, hello_retries = 7, protocol = SKIP, vlan_ids = SKIP) @clusters = clusters unless clusters == SKIP @hello_interval = hello_interval unless hello_interval == SKIP @hello_retries = hello_retries unless hello_retries == SKIP @protocol = protocol unless protocol == SKIP @vlan_ids = vlan_ids unless vlan_ids == SKIP end |
Instance Attribute Details
#clusters ⇒ Array[SiteMxtunnelCluster]
For AP, how to connect to tunterm or RadSec Proxy
14 15 16 |
# File 'lib/mist_api/models/site_mxtunnel_additional_mxtunnel.rb', line 14 def clusters @clusters end |
#hello_interval ⇒ Integer
In seconds, used as heartbeat to detect if a tunnel is alive. AP will try another peer after missing N hellos specified by hello_retries
19 20 21 |
# File 'lib/mist_api/models/site_mxtunnel_additional_mxtunnel.rb', line 19 def hello_interval @hello_interval end |
#hello_retries ⇒ Integer
In seconds, used as heartbeat to detect if a tunnel is alive. AP will try another peer after missing N hellos specified by hello_retries
24 25 26 |
# File 'lib/mist_api/models/site_mxtunnel_additional_mxtunnel.rb', line 24 def hello_retries @hello_retries end |
#protocol ⇒ SiteMxtunnelProtocolEnum
enum: ‘ip`, `udp`
28 29 30 |
# File 'lib/mist_api/models/site_mxtunnel_additional_mxtunnel.rb', line 28 def protocol @protocol end |
#vlan_ids ⇒ Array[Integer]
enum: ‘ip`, `udp`
32 33 34 |
# File 'lib/mist_api/models/site_mxtunnel_additional_mxtunnel.rb', line 32 def vlan_ids @vlan_ids end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/mist_api/models/site_mxtunnel_additional_mxtunnel.rb', line 71 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. # Parameter is an array, so we need to iterate through it clusters = nil unless hash['clusters'].nil? clusters = [] hash['clusters'].each do |structure| clusters << (SiteMxtunnelCluster.from_hash(structure) if structure) end end clusters = SKIP unless hash.key?('clusters') hello_interval = hash['hello_interval'] ||= 60 hello_retries = hash['hello_retries'] ||= 7 protocol = hash.key?('protocol') ? hash['protocol'] : SKIP vlan_ids = hash.key?('vlan_ids') ? hash['vlan_ids'] : SKIP # Create object from extracted values. SiteMxtunnelAdditionalMxtunnel.new(clusters, hello_interval, hello_retries, protocol, vlan_ids) end |
.names ⇒ Object
A mapping from model property names to API property names.
35 36 37 38 39 40 41 42 43 |
# File 'lib/mist_api/models/site_mxtunnel_additional_mxtunnel.rb', line 35 def self.names @_hash = {} if @_hash.nil? @_hash['clusters'] = 'clusters' @_hash['hello_interval'] = 'hello_interval' @_hash['hello_retries'] = 'hello_retries' @_hash['protocol'] = 'protocol' @_hash['vlan_ids'] = 'vlan_ids' @_hash end |
.nullables ⇒ Object
An array for nullable fields
57 58 59 |
# File 'lib/mist_api/models/site_mxtunnel_additional_mxtunnel.rb', line 57 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
46 47 48 49 50 51 52 53 54 |
# File 'lib/mist_api/models/site_mxtunnel_additional_mxtunnel.rb', line 46 def self.optionals %w[ clusters hello_interval hello_retries protocol vlan_ids ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
106 107 108 109 110 111 |
# File 'lib/mist_api/models/site_mxtunnel_additional_mxtunnel.rb', line 106 def inspect class_name = self.class.name.split('::').last "<#{class_name} clusters: #{@clusters.inspect}, hello_interval: #{@hello_interval.inspect},"\ " hello_retries: #{@hello_retries.inspect}, protocol: #{@protocol.inspect}, vlan_ids:"\ " #{@vlan_ids.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
99 100 101 102 103 |
# File 'lib/mist_api/models/site_mxtunnel_additional_mxtunnel.rb', line 99 def to_s class_name = self.class.name.split('::').last "<#{class_name} clusters: #{@clusters}, hello_interval: #{@hello_interval}, hello_retries:"\ " #{@hello_retries}, protocol: #{@protocol}, vlan_ids: #{@vlan_ids}>" end |