Class: MistApi::SwitchVrfInstance
- Defined in:
- lib/mist_api/models/switch_vrf_instance.rb
Overview
SwitchVrfInstance Model.
Instance Attribute Summary collapse
-
#aggregate_routes ⇒ Hash[String, AggregateRoute]
Property key is the destination subnet (e.g. “172.16.3.0/24”).
-
#aggregate_routes6 ⇒ Hash[String, AggregateRoute]
Property key is the destination subnet (e.g. “2a02:1234:420a:10c9::/64”).
-
#evpn_auto_loopback_subnet ⇒ String
Property key is the destination subnet (e.g. “2a02:1234:420a:10c9::/64”).
-
#evpn_auto_loopback_subnet6 ⇒ String
Property key is the destination subnet (e.g. “2a02:1234:420a:10c9::/64”).
-
#extra_routes ⇒ Hash[String, VrfExtraRoute]
Property key is the destination CIDR (e.g. “10.0.0.0/8”).
-
#extra_routes6 ⇒ Hash[String, VrfExtraRoute]
Property key is the destination CIDR (e.g. “2a02:1234:420a:10c9::/64”).
-
#networks ⇒ Array[String]
Property key is the destination CIDR (e.g. “2a02:1234:420a:10c9::/64”).
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.
Instance Method Summary collapse
-
#initialize(aggregate_routes = SKIP, aggregate_routes6 = SKIP, evpn_auto_loopback_subnet = SKIP, evpn_auto_loopback_subnet6 = SKIP, extra_routes = SKIP, extra_routes6 = SKIP, networks = SKIP) ⇒ SwitchVrfInstance
constructor
A new instance of SwitchVrfInstance.
-
#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(aggregate_routes = SKIP, aggregate_routes6 = SKIP, evpn_auto_loopback_subnet = SKIP, evpn_auto_loopback_subnet6 = SKIP, extra_routes = SKIP, extra_routes6 = SKIP, networks = SKIP) ⇒ SwitchVrfInstance
Returns a new instance of SwitchVrfInstance.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/mist_api/models/switch_vrf_instance.rb', line 71 def initialize(aggregate_routes = SKIP, aggregate_routes6 = SKIP, evpn_auto_loopback_subnet = SKIP, evpn_auto_loopback_subnet6 = SKIP, extra_routes = SKIP, extra_routes6 = SKIP, networks = SKIP) @aggregate_routes = aggregate_routes unless aggregate_routes == SKIP @aggregate_routes6 = aggregate_routes6 unless aggregate_routes6 == SKIP unless evpn_auto_loopback_subnet == SKIP @evpn_auto_loopback_subnet = evpn_auto_loopback_subnet end unless evpn_auto_loopback_subnet6 == SKIP @evpn_auto_loopback_subnet6 = evpn_auto_loopback_subnet6 end @extra_routes = extra_routes unless extra_routes == SKIP @extra_routes6 = extra_routes6 unless extra_routes6 == SKIP @networks = networks unless networks == SKIP end |
Instance Attribute Details
#aggregate_routes ⇒ Hash[String, AggregateRoute]
Property key is the destination subnet (e.g. “172.16.3.0/24”)
14 15 16 |
# File 'lib/mist_api/models/switch_vrf_instance.rb', line 14 def aggregate_routes @aggregate_routes end |
#aggregate_routes6 ⇒ Hash[String, AggregateRoute]
Property key is the destination subnet (e.g. “2a02:1234:420a:10c9::/64”)
18 19 20 |
# File 'lib/mist_api/models/switch_vrf_instance.rb', line 18 def aggregate_routes6 @aggregate_routes6 end |
#evpn_auto_loopback_subnet ⇒ String
Property key is the destination subnet (e.g. “2a02:1234:420a:10c9::/64”)
22 23 24 |
# File 'lib/mist_api/models/switch_vrf_instance.rb', line 22 def evpn_auto_loopback_subnet @evpn_auto_loopback_subnet end |
#evpn_auto_loopback_subnet6 ⇒ String
Property key is the destination subnet (e.g. “2a02:1234:420a:10c9::/64”)
26 27 28 |
# File 'lib/mist_api/models/switch_vrf_instance.rb', line 26 def evpn_auto_loopback_subnet6 @evpn_auto_loopback_subnet6 end |
#extra_routes ⇒ Hash[String, VrfExtraRoute]
Property key is the destination CIDR (e.g. “10.0.0.0/8”)
30 31 32 |
# File 'lib/mist_api/models/switch_vrf_instance.rb', line 30 def extra_routes @extra_routes end |
#extra_routes6 ⇒ Hash[String, VrfExtraRoute]
Property key is the destination CIDR (e.g. “2a02:1234:420a:10c9::/64”)
34 35 36 |
# File 'lib/mist_api/models/switch_vrf_instance.rb', line 34 def extra_routes6 @extra_routes6 end |
#networks ⇒ Array[String]
Property key is the destination CIDR (e.g. “2a02:1234:420a:10c9::/64”)
38 39 40 |
# File 'lib/mist_api/models/switch_vrf_instance.rb', line 38 def networks @networks end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/mist_api/models/switch_vrf_instance.rb', line 91 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. aggregate_routes = AggregateRoute.from_hash(hash['aggregate_routes']) if hash['aggregate_routes'] aggregate_routes = SKIP unless hash.key?('aggregate_routes') aggregate_routes6 = AggregateRoute.from_hash(hash['aggregate_routes6']) if hash['aggregate_routes6'] aggregate_routes6 = SKIP unless hash.key?('aggregate_routes6') evpn_auto_loopback_subnet = hash.key?('evpn_auto_loopback_subnet') ? hash['evpn_auto_loopback_subnet'] : SKIP evpn_auto_loopback_subnet6 = hash.key?('evpn_auto_loopback_subnet6') ? hash['evpn_auto_loopback_subnet6'] : SKIP extra_routes = VrfExtraRoute.from_hash(hash['extra_routes']) if hash['extra_routes'] extra_routes = SKIP unless hash.key?('extra_routes') extra_routes6 = VrfExtraRoute.from_hash(hash['extra_routes6']) if hash['extra_routes6'] extra_routes6 = SKIP unless hash.key?('extra_routes6') networks = hash.key?('networks') ? hash['networks'] : SKIP # Create object from extracted values. SwitchVrfInstance.new(aggregate_routes, aggregate_routes6, evpn_auto_loopback_subnet, evpn_auto_loopback_subnet6, extra_routes, extra_routes6, networks) end |
.names ⇒ Object
A mapping from model property names to API property names.
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/mist_api/models/switch_vrf_instance.rb', line 41 def self.names @_hash = {} if @_hash.nil? @_hash['aggregate_routes'] = 'aggregate_routes' @_hash['aggregate_routes6'] = 'aggregate_routes6' @_hash['evpn_auto_loopback_subnet'] = 'evpn_auto_loopback_subnet' @_hash['evpn_auto_loopback_subnet6'] = 'evpn_auto_loopback_subnet6' @_hash['extra_routes'] = 'extra_routes' @_hash['extra_routes6'] = 'extra_routes6' @_hash['networks'] = 'networks' @_hash end |
.nullables ⇒ Object
An array for nullable fields
67 68 69 |
# File 'lib/mist_api/models/switch_vrf_instance.rb', line 67 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/mist_api/models/switch_vrf_instance.rb', line 54 def self.optionals %w[ aggregate_routes aggregate_routes6 evpn_auto_loopback_subnet evpn_auto_loopback_subnet6 extra_routes extra_routes6 networks ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
135 136 137 138 139 140 141 142 |
# File 'lib/mist_api/models/switch_vrf_instance.rb', line 135 def inspect class_name = self.class.name.split('::').last "<#{class_name} aggregate_routes: #{@aggregate_routes.inspect}, aggregate_routes6:"\ " #{@aggregate_routes6.inspect}, evpn_auto_loopback_subnet:"\ " #{@evpn_auto_loopback_subnet.inspect}, evpn_auto_loopback_subnet6:"\ " #{@evpn_auto_loopback_subnet6.inspect}, extra_routes: #{@extra_routes.inspect},"\ " extra_routes6: #{@extra_routes6.inspect}, networks: #{@networks.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
126 127 128 129 130 131 132 |
# File 'lib/mist_api/models/switch_vrf_instance.rb', line 126 def to_s class_name = self.class.name.split('::').last "<#{class_name} aggregate_routes: #{@aggregate_routes}, aggregate_routes6:"\ " #{@aggregate_routes6}, evpn_auto_loopback_subnet: #{@evpn_auto_loopback_subnet},"\ " evpn_auto_loopback_subnet6: #{@evpn_auto_loopback_subnet6}, extra_routes:"\ " #{@extra_routes}, extra_routes6: #{@extra_routes6}, networks: #{@networks}>" end |