Class: MistApi::EvpnOptionsUnderlay

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

Overview

EvpnOptionsUnderlay 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(as_base = 65001, routed_id_prefix = SKIP, subnet = SKIP, use_ipv6 = false) ⇒ EvpnOptionsUnderlay

Returns a new instance of EvpnOptionsUnderlay.



54
55
56
57
58
59
60
# File 'lib/mist_api/models/evpn_options_underlay.rb', line 54

def initialize(as_base = 65001, routed_id_prefix = SKIP, subnet = SKIP,
               use_ipv6 = false)
  @as_base = as_base unless as_base == SKIP
  @routed_id_prefix = routed_id_prefix unless routed_id_prefix == SKIP
  @subnet = subnet unless subnet == SKIP
  @use_ipv6 = use_ipv6 unless use_ipv6 == SKIP
end

Instance Attribute Details

#as_baseInteger

Underlay BGP Base AS Number

Returns:

  • (Integer)


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

def as_base
  @as_base
end

#routed_id_prefixString

Underlay BGP Base AS Number

Returns:

  • (String)


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

def routed_id_prefix
  @routed_id_prefix
end

#subnetString

Underlay subnet, by default, ‘10.255.240.0/20`, or `fd31:5700::/64` for ipv6

Returns:

  • (String)


23
24
25
# File 'lib/mist_api/models/evpn_options_underlay.rb', line 23

def subnet
  @subnet
end

#use_ipv6TrueClass | FalseClass

If v6 is desired for underlay

Returns:

  • (TrueClass | FalseClass)


27
28
29
# File 'lib/mist_api/models/evpn_options_underlay.rb', line 27

def use_ipv6
  @use_ipv6
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/mist_api/models/evpn_options_underlay.rb', line 63

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  as_base = hash['as_base'] ||= 65001
  routed_id_prefix =
    hash.key?('routed_id_prefix') ? hash['routed_id_prefix'] : SKIP
  subnet = hash.key?('subnet') ? hash['subnet'] : SKIP
  use_ipv6 = hash['use_ipv6'] ||= false

  # Create object from extracted values.
  EvpnOptionsUnderlay.new(as_base,
                          routed_id_prefix,
                          subnet,
                          use_ipv6)
end

.namesObject

A mapping from model property names to API property names.



30
31
32
33
34
35
36
37
# File 'lib/mist_api/models/evpn_options_underlay.rb', line 30

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['as_base'] = 'as_base'
  @_hash['routed_id_prefix'] = 'routed_id_prefix'
  @_hash['subnet'] = 'subnet'
  @_hash['use_ipv6'] = 'use_ipv6'
  @_hash
end

.nullablesObject

An array for nullable fields



50
51
52
# File 'lib/mist_api/models/evpn_options_underlay.rb', line 50

def self.nullables
  []
end

.optionalsObject

An array for optional fields



40
41
42
43
44
45
46
47
# File 'lib/mist_api/models/evpn_options_underlay.rb', line 40

def self.optionals
  %w[
    as_base
    routed_id_prefix
    subnet
    use_ipv6
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



88
89
90
91
92
# File 'lib/mist_api/models/evpn_options_underlay.rb', line 88

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} as_base: #{@as_base.inspect}, routed_id_prefix:"\
  " #{@routed_id_prefix.inspect}, subnet: #{@subnet.inspect}, use_ipv6: #{@use_ipv6.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



81
82
83
84
85
# File 'lib/mist_api/models/evpn_options_underlay.rb', line 81

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} as_base: #{@as_base}, routed_id_prefix: #{@routed_id_prefix}, subnet:"\
  " #{@subnet}, use_ipv6: #{@use_ipv6}>"
end