Class: MistApi::GwRoutingPolicyTermMatching

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

Overview

zero or more criteria/filter can be specified to match the term, all criteria have to be met

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_path = SKIP, community = SKIP, network = SKIP, prefix = SKIP, protocol = SKIP, route_exists = SKIP, vpn_neighbor_mac = SKIP, vpn_path = SKIP, vpn_path_sla = SKIP) ⇒ GwRoutingPolicyTermMatching

Returns a new instance of GwRoutingPolicyTermMatching.



87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/mist_api/models/gw_routing_policy_term_matching.rb', line 87

def initialize(as_path = SKIP, community = SKIP, network = SKIP,
               prefix = SKIP, protocol = SKIP, route_exists = SKIP,
               vpn_neighbor_mac = SKIP, vpn_path = SKIP,
               vpn_path_sla = SKIP)
  @as_path = as_path unless as_path == SKIP
  @community = community unless community == SKIP
  @network = network unless network == SKIP
  @prefix = prefix unless prefix == SKIP
  @protocol = protocol unless protocol == SKIP
  @route_exists = route_exists unless route_exists == SKIP
  @vpn_neighbor_mac = vpn_neighbor_mac unless vpn_neighbor_mac == SKIP
  @vpn_path = vpn_path unless vpn_path == SKIP
  @vpn_path_sla = vpn_path_sla unless vpn_path_sla == SKIP
end

Instance Attribute Details

#as_pathArray[Object]

TODO: Write general description for this method

Returns:

  • (Array[Object])


15
16
17
# File 'lib/mist_api/models/gw_routing_policy_term_matching.rb', line 15

def as_path
  @as_path
end

#communityArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


19
20
21
# File 'lib/mist_api/models/gw_routing_policy_term_matching.rb', line 19

def community
  @community
end

#networkArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


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

def network
  @network
end

#prefixArray[String]

zero or more criteria/filter can be specified to match the term, all criteria have to be met

Returns:

  • (Array[String])


28
29
30
# File 'lib/mist_api/models/gw_routing_policy_term_matching.rb', line 28

def prefix
  @prefix
end

#protocolArray[GwRoutingPolicyTermMatchingProtocolEnum]

zero or more criteria/filter can be specified to match the term, all criteria have to be met



33
34
35
# File 'lib/mist_api/models/gw_routing_policy_term_matching.rb', line 33

def protocol
  @protocol
end

#route_existsGwRoutingPolicyTermMatchingRouteExists

zero or more criteria/filter can be specified to match the term, all criteria have to be met



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

def route_exists
  @route_exists
end

#vpn_neighbor_macArray[String]

overlay-facing criteria (used for bgp_config where via=vpn)

Returns:

  • (Array[String])


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

def vpn_neighbor_mac
  @vpn_neighbor_mac
end

#vpn_pathArray[String]

overlay-facing criteria (used for bgp_config where via=vpn). ordered-

Returns:

  • (Array[String])


46
47
48
# File 'lib/mist_api/models/gw_routing_policy_term_matching.rb', line 46

def vpn_path
  @vpn_path
end

#vpn_path_slaGwRoutingPolicyTermMatchingVpnPathSla

overlay-facing criteria (used for bgp_config where via=vpn). ordered-



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

def vpn_path_sla
  @vpn_path_sla
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  as_path = hash.key?('as_path') ? APIHelper.deserialize_union_type(
    UnionTypeLookUp.get(:BgpAs3), hash['as_path']
  ) : SKIP
  community = hash.key?('community') ? hash['community'] : SKIP
  network = hash.key?('network') ? hash['network'] : SKIP
  prefix = hash.key?('prefix') ? hash['prefix'] : SKIP
  protocol = hash.key?('protocol') ? hash['protocol'] : SKIP
  route_exists = GwRoutingPolicyTermMatchingRouteExists.from_hash(hash['route_exists']) if
    hash['route_exists']
  vpn_neighbor_mac =
    hash.key?('vpn_neighbor_mac') ? hash['vpn_neighbor_mac'] : SKIP
  vpn_path = hash.key?('vpn_path') ? hash['vpn_path'] : SKIP
  vpn_path_sla = GwRoutingPolicyTermMatchingVpnPathSla.from_hash(hash['vpn_path_sla']) if
    hash['vpn_path_sla']

  # Create object from extracted values.
  GwRoutingPolicyTermMatching.new(as_path,
                                  community,
                                  network,
                                  prefix,
                                  protocol,
                                  route_exists,
                                  vpn_neighbor_mac,
                                  vpn_path,
                                  vpn_path_sla)
end

.namesObject

A mapping from model property names to API property names.



53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/mist_api/models/gw_routing_policy_term_matching.rb', line 53

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['as_path'] = 'as_path'
  @_hash['community'] = 'community'
  @_hash['network'] = 'network'
  @_hash['prefix'] = 'prefix'
  @_hash['protocol'] = 'protocol'
  @_hash['route_exists'] = 'route_exists'
  @_hash['vpn_neighbor_mac'] = 'vpn_neighbor_mac'
  @_hash['vpn_path'] = 'vpn_path'
  @_hash['vpn_path_sla'] = 'vpn_path_sla'
  @_hash
end

.nullablesObject

An array for nullable fields



83
84
85
# File 'lib/mist_api/models/gw_routing_policy_term_matching.rb', line 83

def self.nullables
  []
end

.optionalsObject

An array for optional fields



68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/mist_api/models/gw_routing_policy_term_matching.rb', line 68

def self.optionals
  %w[
    as_path
    community
    network
    prefix
    protocol
    route_exists
    vpn_neighbor_mac
    vpn_path
    vpn_path_sla
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



136
137
138
139
140
141
142
# File 'lib/mist_api/models/gw_routing_policy_term_matching.rb', line 136

def self.validate(value)
  return true if value.instance_of? self

  return false unless value.instance_of? Hash

  true
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



154
155
156
157
158
159
160
# File 'lib/mist_api/models/gw_routing_policy_term_matching.rb', line 154

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} as_path: #{@as_path.inspect}, community: #{@community.inspect}, network:"\
  " #{@network.inspect}, prefix: #{@prefix.inspect}, protocol: #{@protocol.inspect},"\
  " route_exists: #{@route_exists.inspect}, vpn_neighbor_mac: #{@vpn_neighbor_mac.inspect},"\
  " vpn_path: #{@vpn_path.inspect}, vpn_path_sla: #{@vpn_path_sla.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



145
146
147
148
149
150
151
# File 'lib/mist_api/models/gw_routing_policy_term_matching.rb', line 145

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} as_path: #{@as_path}, community: #{@community}, network: #{@network},"\
  " prefix: #{@prefix}, protocol: #{@protocol}, route_exists: #{@route_exists},"\
  " vpn_neighbor_mac: #{@vpn_neighbor_mac}, vpn_path: #{@vpn_path}, vpn_path_sla:"\
  " #{@vpn_path_sla}>"
end