Class: MistApi::OspfAreasNetwork

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

Overview

Property key is the network name. Networks to participate in an OSPF area

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(auth_keys = SKIP, auth_password = SKIP, auth_type = OspfAreaNetworkAuthTypeEnum::NONE, bfd_minimum_interval = SKIP, dead_interval = SKIP, export_policy = SKIP, hello_interval = SKIP, import_policy = SKIP, interface_type = OspfAreaNetworkInterfaceTypeEnum::BROADCAST, metric = SKIP, no_readvertise_to_overlay = false, passive = false) ⇒ OspfAreasNetwork

Returns a new instance of OspfAreasNetwork.



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/mist_api/models/ospf_areas_network.rb', line 105

def initialize(auth_keys = SKIP, auth_password = SKIP,
               auth_type = OspfAreaNetworkAuthTypeEnum::NONE,
               bfd_minimum_interval = SKIP, dead_interval = SKIP,
               export_policy = SKIP, hello_interval = SKIP,
               import_policy = SKIP,
               interface_type = OspfAreaNetworkInterfaceTypeEnum::BROADCAST,
               metric = SKIP, no_readvertise_to_overlay = false,
               passive = false)
  @auth_keys = auth_keys unless auth_keys == SKIP
  @auth_password = auth_password unless auth_password == SKIP
  @auth_type = auth_type unless auth_type == SKIP
  @bfd_minimum_interval = bfd_minimum_interval unless bfd_minimum_interval == SKIP
  @dead_interval = dead_interval unless dead_interval == SKIP
  @export_policy = export_policy unless export_policy == SKIP
  @hello_interval = hello_interval unless hello_interval == SKIP
  @import_policy = import_policy unless import_policy == SKIP
  @interface_type = interface_type unless interface_type == SKIP
  @metric = metric unless metric == SKIP
  unless no_readvertise_to_overlay == SKIP
    @no_readvertise_to_overlay =
      no_readvertise_to_overlay
  end
  @passive = passive unless passive == SKIP
end

Instance Attribute Details

#auth_keysHash[String, String]

Required if ‘auth_type`==`md5`. Property key is the key number

Returns:

  • (Hash[String, String])


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

def auth_keys
  @auth_keys
end

#auth_passwordString

Required if ‘auth_type`==`password`, the password, max length is 8

Returns:

  • (String)


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

def auth_password
  @auth_password
end

#auth_typeOspfAreaNetworkAuthTypeEnum

auth type. enum: ‘md5`, `none`, `password`



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

def auth_type
  @auth_type
end

#bfd_minimum_intervalInteger

auth type. enum: ‘md5`, `none`, `password`

Returns:

  • (Integer)


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

def bfd_minimum_interval
  @bfd_minimum_interval
end

#dead_intervalInteger

auth type. enum: ‘md5`, `none`, `password`

Returns:

  • (Integer)


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

def dead_interval
  @dead_interval
end

#export_policyString

auth type. enum: ‘md5`, `none`, `password`

Returns:

  • (String)


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

def export_policy
  @export_policy
end

#hello_intervalInteger

auth type. enum: ‘md5`, `none`, `password`

Returns:

  • (Integer)


38
39
40
# File 'lib/mist_api/models/ospf_areas_network.rb', line 38

def hello_interval
  @hello_interval
end

#import_policyString

auth type. enum: ‘md5`, `none`, `password`

Returns:

  • (String)


42
43
44
# File 'lib/mist_api/models/ospf_areas_network.rb', line 42

def import_policy
  @import_policy
end

#interface_typeOspfAreaNetworkInterfaceTypeEnum

interface type (nbma = non-broadcast multi-access). enum: ‘broadcast`, `nbma`, `p2mp`, `p2p`



47
48
49
# File 'lib/mist_api/models/ospf_areas_network.rb', line 47

def interface_type
  @interface_type
end

#metricInteger

interface type (nbma = non-broadcast multi-access). enum: ‘broadcast`, `nbma`, `p2mp`, `p2p`

Returns:

  • (Integer)


52
53
54
# File 'lib/mist_api/models/ospf_areas_network.rb', line 52

def metric
  @metric
end

#no_readvertise_to_overlayTrueClass | FalseClass

By default, we’ll re-advertise all learned OSPF routes toward overlay

Returns:

  • (TrueClass | FalseClass)


56
57
58
# File 'lib/mist_api/models/ospf_areas_network.rb', line 56

def no_readvertise_to_overlay
  @no_readvertise_to_overlay
end

#passiveTrueClass | FalseClass

Whether to send OSPF-Hello

Returns:

  • (TrueClass | FalseClass)


60
61
62
# File 'lib/mist_api/models/ospf_areas_network.rb', line 60

def passive
  @passive
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/mist_api/models/ospf_areas_network.rb', line 131

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  auth_keys = hash.key?('auth_keys') ? hash['auth_keys'] : SKIP
  auth_password = hash.key?('auth_password') ? hash['auth_password'] : SKIP
  auth_type = hash['auth_type'] ||= OspfAreaNetworkAuthTypeEnum::NONE
  bfd_minimum_interval =
    hash.key?('bfd_minimum_interval') ? hash['bfd_minimum_interval'] : SKIP
  dead_interval = hash.key?('dead_interval') ? hash['dead_interval'] : SKIP
  export_policy = hash.key?('export_policy') ? hash['export_policy'] : SKIP
  hello_interval =
    hash.key?('hello_interval') ? hash['hello_interval'] : SKIP
  import_policy = hash.key?('import_policy') ? hash['import_policy'] : SKIP
  interface_type =
    hash['interface_type'] ||= OspfAreaNetworkInterfaceTypeEnum::BROADCAST
  metric = hash.key?('metric') ? hash['metric'] : SKIP
  no_readvertise_to_overlay = hash['no_readvertise_to_overlay'] ||= false
  passive = hash['passive'] ||= false

  # Create object from extracted values.
  OspfAreasNetwork.new(auth_keys,
                       auth_password,
                       auth_type,
                       bfd_minimum_interval,
                       dead_interval,
                       export_policy,
                       hello_interval,
                       import_policy,
                       interface_type,
                       metric,
                       no_readvertise_to_overlay,
                       passive)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['auth_keys'] = 'auth_keys'
  @_hash['auth_password'] = 'auth_password'
  @_hash['auth_type'] = 'auth_type'
  @_hash['bfd_minimum_interval'] = 'bfd_minimum_interval'
  @_hash['dead_interval'] = 'dead_interval'
  @_hash['export_policy'] = 'export_policy'
  @_hash['hello_interval'] = 'hello_interval'
  @_hash['import_policy'] = 'import_policy'
  @_hash['interface_type'] = 'interface_type'
  @_hash['metric'] = 'metric'
  @_hash['no_readvertise_to_overlay'] = 'no_readvertise_to_overlay'
  @_hash['passive'] = 'passive'
  @_hash
end

.nullablesObject

An array for nullable fields



99
100
101
102
103
# File 'lib/mist_api/models/ospf_areas_network.rb', line 99

def self.nullables
  %w[
    metric
  ]
end

.optionalsObject

An array for optional fields



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/mist_api/models/ospf_areas_network.rb', line 81

def self.optionals
  %w[
    auth_keys
    auth_password
    auth_type
    bfd_minimum_interval
    dead_interval
    export_policy
    hello_interval
    import_policy
    interface_type
    metric
    no_readvertise_to_overlay
    passive
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



177
178
179
180
181
182
183
184
185
186
# File 'lib/mist_api/models/ospf_areas_network.rb', line 177

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} auth_keys: #{@auth_keys.inspect}, auth_password: #{@auth_password.inspect},"\
  " auth_type: #{@auth_type.inspect}, bfd_minimum_interval: #{@bfd_minimum_interval.inspect},"\
  " dead_interval: #{@dead_interval.inspect}, export_policy: #{@export_policy.inspect},"\
  " hello_interval: #{@hello_interval.inspect}, import_policy: #{@import_policy.inspect},"\
  " interface_type: #{@interface_type.inspect}, metric: #{@metric.inspect},"\
  " no_readvertise_to_overlay: #{@no_readvertise_to_overlay.inspect}, passive:"\
  " #{@passive.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



167
168
169
170
171
172
173
174
# File 'lib/mist_api/models/ospf_areas_network.rb', line 167

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} auth_keys: #{@auth_keys}, auth_password: #{@auth_password}, auth_type:"\
  " #{@auth_type}, bfd_minimum_interval: #{@bfd_minimum_interval}, dead_interval:"\
  " #{@dead_interval}, export_policy: #{@export_policy}, hello_interval: #{@hello_interval},"\
  " import_policy: #{@import_policy}, interface_type: #{@interface_type}, metric: #{@metric},"\
  " no_readvertise_to_overlay: #{@no_readvertise_to_overlay}, passive: #{@passive}>"
end