Class: MistApi::VpnPath

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/vpn_path.rb

Overview

VpnPath Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(bfd_profile = VpnPathBfdProfileEnum::BROADBAND, bfd_use_tunnel_mode = false, ip = SKIP, peer_paths = SKIP, pod = 1, traffic_shaping = SKIP) ⇒ VpnPath

Returns a new instance of VpnPath.



65
66
67
68
69
70
71
72
73
74
# File 'lib/mist_api/models/vpn_path.rb', line 65

def initialize(bfd_profile = VpnPathBfdProfileEnum::BROADBAND,
               bfd_use_tunnel_mode = false, ip = SKIP, peer_paths = SKIP,
               pod = 1, traffic_shaping = SKIP)
  @bfd_profile = bfd_profile unless bfd_profile == SKIP
  @bfd_use_tunnel_mode = bfd_use_tunnel_mode unless bfd_use_tunnel_mode == SKIP
  @ip = ip unless ip == SKIP
  @peer_paths = peer_paths unless peer_paths == SKIP
  @pod = pod unless pod == SKIP
  @traffic_shaping = traffic_shaping unless traffic_shaping == SKIP
end

Instance Attribute Details

#bfd_profileVpnPathBfdProfileEnum

enum: ‘broadband`, `lte`



14
15
16
# File 'lib/mist_api/models/vpn_path.rb', line 14

def bfd_profile
  @bfd_profile
end

#bfd_use_tunnel_modeTrueClass | FalseClass

If ‘type`==`mesh` and for SSR only, whether to use tunnel mode

Returns:

  • (TrueClass | FalseClass)


18
19
20
# File 'lib/mist_api/models/vpn_path.rb', line 18

def bfd_use_tunnel_mode
  @bfd_use_tunnel_mode
end

#ipString

If different from the wan port

Returns:

  • (String)


22
23
24
# File 'lib/mist_api/models/vpn_path.rb', line 22

def ip
  @ip
end

#peer_pathsHash[String, VpnPathPeerPathsPeer]

If ‘type`==`mesh`, Property key is the Peer Interface name

Returns:



26
27
28
# File 'lib/mist_api/models/vpn_path.rb', line 26

def peer_paths
  @peer_paths
end

#podInteger

If ‘type`==`mesh`, Property key is the Peer Interface name

Returns:

  • (Integer)


30
31
32
# File 'lib/mist_api/models/vpn_path.rb', line 30

def pod
  @pod
end

#traffic_shapingVpnPathTrafficShaping

If ‘type`==`mesh`, Property key is the Peer Interface name

Returns:

  • (VpnPathTrafficShaping)


34
35
36
# File 'lib/mist_api/models/vpn_path.rb', line 34

def traffic_shaping
  @traffic_shaping
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/mist_api/models/vpn_path.rb', line 77

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  bfd_profile = hash['bfd_profile'] ||= VpnPathBfdProfileEnum::BROADBAND
  bfd_use_tunnel_mode = hash['bfd_use_tunnel_mode'] ||= false
  ip = hash.key?('ip') ? hash['ip'] : SKIP
  peer_paths = VpnPathPeerPathsPeer.from_hash(hash['peer_paths']) if hash['peer_paths']

  peer_paths = SKIP unless hash.key?('peer_paths')
  pod = hash['pod'] ||= 1
  traffic_shaping = VpnPathTrafficShaping.from_hash(hash['traffic_shaping']) if
    hash['traffic_shaping']

  # Create object from extracted values.
  VpnPath.new(bfd_profile,
              bfd_use_tunnel_mode,
              ip,
              peer_paths,
              pod,
              traffic_shaping)
end

.namesObject

A mapping from model property names to API property names.



37
38
39
40
41
42
43
44
45
46
# File 'lib/mist_api/models/vpn_path.rb', line 37

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['bfd_profile'] = 'bfd_profile'
  @_hash['bfd_use_tunnel_mode'] = 'bfd_use_tunnel_mode'
  @_hash['ip'] = 'ip'
  @_hash['peer_paths'] = 'peer_paths'
  @_hash['pod'] = 'pod'
  @_hash['traffic_shaping'] = 'traffic_shaping'
  @_hash
end

.nullablesObject

An array for nullable fields



61
62
63
# File 'lib/mist_api/models/vpn_path.rb', line 61

def self.nullables
  []
end

.optionalsObject

An array for optional fields



49
50
51
52
53
54
55
56
57
58
# File 'lib/mist_api/models/vpn_path.rb', line 49

def self.optionals
  %w[
    bfd_profile
    bfd_use_tunnel_mode
    ip
    peer_paths
    pod
    traffic_shaping
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



109
110
111
112
113
114
# File 'lib/mist_api/models/vpn_path.rb', line 109

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} bfd_profile: #{@bfd_profile.inspect}, bfd_use_tunnel_mode:"\
  " #{@bfd_use_tunnel_mode.inspect}, ip: #{@ip.inspect}, peer_paths: #{@peer_paths.inspect},"\
  " pod: #{@pod.inspect}, traffic_shaping: #{@traffic_shaping.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



101
102
103
104
105
106
# File 'lib/mist_api/models/vpn_path.rb', line 101

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} bfd_profile: #{@bfd_profile}, bfd_use_tunnel_mode: #{@bfd_use_tunnel_mode},"\
  " ip: #{@ip}, peer_paths: #{@peer_paths}, pod: #{@pod}, traffic_shaping:"\
  " #{@traffic_shaping}>"
end