Class: MistApi::GwRoutingPolicyTermAction
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- MistApi::GwRoutingPolicyTermAction
- Defined in:
- lib/mist_api/models/gw_routing_policy_term_action.rb
Overview
When used as import policy
Instance Attribute Summary collapse
-
#accept ⇒ TrueClass | FalseClass
TODO: Write general description for this method.
-
#add_community ⇒ Array[String]
TODO: Write general description for this method.
-
#add_target_vrfs ⇒ Array[String]
For SSR, hub decides how VRF routes are leaked on spoke.
-
#community ⇒ Array[String]
When used as export policy, optional.
-
#exclude_as_path ⇒ Array[String]
When used as export policy, optional.
-
#exclude_community ⇒ Array[String]
When used as export policy, optional.
-
#export_communities ⇒ Array[String]
When used as export policy, optional.
-
#local_preference ⇒ Object
Optional, for an import policy, local_preference can be changed, value in range 1-4294967294.
-
#prepend_as_path ⇒ Array[String]
When used as export policy, optional.
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.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(accept = SKIP, add_community = SKIP, add_target_vrfs = SKIP, community = SKIP, exclude_as_path = SKIP, exclude_community = SKIP, export_communities = SKIP, local_preference = SKIP, prepend_as_path = SKIP) ⇒ GwRoutingPolicyTermAction
constructor
A new instance of GwRoutingPolicyTermAction.
-
#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(accept = SKIP, add_community = SKIP, add_target_vrfs = SKIP, community = SKIP, exclude_as_path = SKIP, exclude_community = SKIP, export_communities = SKIP, local_preference = SKIP, prepend_as_path = SKIP) ⇒ GwRoutingPolicyTermAction
Returns a new instance of GwRoutingPolicyTermAction.
85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/mist_api/models/gw_routing_policy_term_action.rb', line 85 def initialize(accept = SKIP, add_community = SKIP, add_target_vrfs = SKIP, community = SKIP, exclude_as_path = SKIP, exclude_community = SKIP, export_communities = SKIP, local_preference = SKIP, prepend_as_path = SKIP) @accept = accept unless accept == SKIP @add_community = add_community unless add_community == SKIP @add_target_vrfs = add_target_vrfs unless add_target_vrfs == SKIP @community = community unless community == SKIP @exclude_as_path = exclude_as_path unless exclude_as_path == SKIP @exclude_community = exclude_community unless exclude_community == SKIP @export_communities = export_communities unless export_communities == SKIP @local_preference = local_preference unless local_preference == SKIP @prepend_as_path = prepend_as_path unless prepend_as_path == SKIP end |
Instance Attribute Details
#accept ⇒ TrueClass | FalseClass
TODO: Write general description for this method
14 15 16 |
# File 'lib/mist_api/models/gw_routing_policy_term_action.rb', line 14 def accept @accept end |
#add_community ⇒ Array[String]
TODO: Write general description for this method
18 19 20 |
# File 'lib/mist_api/models/gw_routing_policy_term_action.rb', line 18 def add_community @add_community end |
#add_target_vrfs ⇒ Array[String]
For SSR, hub decides how VRF routes are leaked on spoke
22 23 24 |
# File 'lib/mist_api/models/gw_routing_policy_term_action.rb', line 22 def add_target_vrfs @add_target_vrfs end |
#community ⇒ Array[String]
When used as export policy, optional
26 27 28 |
# File 'lib/mist_api/models/gw_routing_policy_term_action.rb', line 26 def community @community end |
#exclude_as_path ⇒ Array[String]
When used as export policy, optional. To exclude certain AS
30 31 32 |
# File 'lib/mist_api/models/gw_routing_policy_term_action.rb', line 30 def exclude_as_path @exclude_as_path end |
#exclude_community ⇒ Array[String]
When used as export policy, optional. To exclude certain AS
34 35 36 |
# File 'lib/mist_api/models/gw_routing_policy_term_action.rb', line 34 def exclude_community @exclude_community end |
#export_communities ⇒ Array[String]
When used as export policy, optional
38 39 40 |
# File 'lib/mist_api/models/gw_routing_policy_term_action.rb', line 38 def export_communities @export_communities end |
#local_preference ⇒ Object
Optional, for an import policy, local_preference can be changed, value in range 1-4294967294. Can be a Variable (e.g. ‘{bgp_as}`)
43 44 45 |
# File 'lib/mist_api/models/gw_routing_policy_term_action.rb', line 43 def local_preference @local_preference end |
#prepend_as_path ⇒ Array[String]
When used as export policy, optional. By default, the local AS will be prepended, to change it. Can be a Variable (e.g. ‘{as_path}`)
48 49 50 |
# File 'lib/mist_api/models/gw_routing_policy_term_action.rb', line 48 def prepend_as_path @prepend_as_path end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
101 102 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_action.rb', line 101 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. accept = hash.key?('accept') ? hash['accept'] : SKIP add_community = hash.key?('add_community') ? hash['add_community'] : SKIP add_target_vrfs = hash.key?('add_target_vrfs') ? hash['add_target_vrfs'] : SKIP community = hash.key?('community') ? hash['community'] : SKIP exclude_as_path = hash.key?('exclude_as_path') ? hash['exclude_as_path'] : SKIP exclude_community = hash.key?('exclude_community') ? hash['exclude_community'] : SKIP export_communities = hash.key?('export_communities') ? hash['export_communities'] : SKIP local_preference = hash.key?('local_preference') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:RoutingPolicyLocalPreference), hash['local_preference'] ) : SKIP prepend_as_path = hash.key?('prepend_as_path') ? hash['prepend_as_path'] : SKIP # Create object from extracted values. GwRoutingPolicyTermAction.new(accept, add_community, add_target_vrfs, community, exclude_as_path, exclude_community, export_communities, local_preference, prepend_as_path) end |
.names ⇒ Object
A mapping from model property names to API property names.
51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/mist_api/models/gw_routing_policy_term_action.rb', line 51 def self.names @_hash = {} if @_hash.nil? @_hash['accept'] = 'accept' @_hash['add_community'] = 'add_community' @_hash['add_target_vrfs'] = 'add_target_vrfs' @_hash['community'] = 'community' @_hash['exclude_as_path'] = 'exclude_as_path' @_hash['exclude_community'] = 'exclude_community' @_hash['export_communities'] = 'export_communities' @_hash['local_preference'] = 'local_preference' @_hash['prepend_as_path'] = 'prepend_as_path' @_hash end |
.nullables ⇒ Object
An array for nullable fields
81 82 83 |
# File 'lib/mist_api/models/gw_routing_policy_term_action.rb', line 81 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/mist_api/models/gw_routing_policy_term_action.rb', line 66 def self.optionals %w[ accept add_community add_target_vrfs community exclude_as_path exclude_community export_communities local_preference prepend_as_path ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
136 137 138 139 140 141 142 |
# File 'lib/mist_api/models/gw_routing_policy_term_action.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
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
154 155 156 157 158 159 160 161 162 |
# File 'lib/mist_api/models/gw_routing_policy_term_action.rb', line 154 def inspect class_name = self.class.name.split('::').last "<#{class_name} accept: #{@accept.inspect}, add_community: #{@add_community.inspect},"\ " add_target_vrfs: #{@add_target_vrfs.inspect}, community: #{@community.inspect},"\ " exclude_as_path: #{@exclude_as_path.inspect}, exclude_community:"\ " #{@exclude_community.inspect}, export_communities: #{@export_communities.inspect},"\ " local_preference: #{@local_preference.inspect}, prepend_as_path:"\ " #{@prepend_as_path.inspect}>" end |
#to_s ⇒ Object
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_action.rb', line 145 def to_s class_name = self.class.name.split('::').last "<#{class_name} accept: #{@accept}, add_community: #{@add_community}, add_target_vrfs:"\ " #{@add_target_vrfs}, community: #{@community}, exclude_as_path: #{@exclude_as_path},"\ " exclude_community: #{@exclude_community}, export_communities: #{@export_communities},"\ " local_preference: #{@local_preference}, prepend_as_path: #{@prepend_as_path}>" end |