Class: MistApi::NetworkMulticast
- Defined in:
- lib/mist_api/models/network_multicast.rb
Overview
Whether to enable multicast support (only PIM-sparse mode is supported)
Instance Attribute Summary collapse
-
#disable_igmp ⇒ TrueClass | FalseClass
If the network will only be the source of the multicast traffic, IGMP can be disabled.
-
#enabled ⇒ TrueClass | FalseClass
If the network will only be the source of the multicast traffic, IGMP can be disabled.
-
#groups ⇒ Hash[String, NetworkMulticastGroup]
Group address to RP (rendezvous point) mapping.
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(disable_igmp = false, enabled = false, groups = SKIP) ⇒ NetworkMulticast
constructor
A new instance of NetworkMulticast.
-
#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(disable_igmp = false, enabled = false, groups = SKIP) ⇒ NetworkMulticast
Returns a new instance of NetworkMulticast.
50 51 52 53 54 |
# File 'lib/mist_api/models/network_multicast.rb', line 50 def initialize(disable_igmp = false, enabled = false, groups = SKIP) @disable_igmp = disable_igmp unless disable_igmp == SKIP @enabled = enabled unless enabled == SKIP @groups = groups unless groups == SKIP end |
Instance Attribute Details
#disable_igmp ⇒ TrueClass | FalseClass
If the network will only be the source of the multicast traffic, IGMP can be disabled
15 16 17 |
# File 'lib/mist_api/models/network_multicast.rb', line 15 def disable_igmp @disable_igmp end |
#enabled ⇒ TrueClass | FalseClass
If the network will only be the source of the multicast traffic, IGMP can be disabled
20 21 22 |
# File 'lib/mist_api/models/network_multicast.rb', line 20 def enabled @enabled end |
#groups ⇒ Hash[String, NetworkMulticastGroup]
Group address to RP (rendezvous point) mapping. Property Key is the CIDR (example “225.1.0.3/32”)
25 26 27 |
# File 'lib/mist_api/models/network_multicast.rb', line 25 def groups @groups end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/mist_api/models/network_multicast.rb', line 57 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. disable_igmp = hash['disable_igmp'] ||= false enabled = hash['enabled'] ||= false groups = NetworkMulticastGroup.from_hash(hash['groups']) if hash['groups'] groups = SKIP unless hash.key?('groups') # Create object from extracted values. NetworkMulticast.new(disable_igmp, enabled, groups) end |
.names ⇒ Object
A mapping from model property names to API property names.
28 29 30 31 32 33 34 |
# File 'lib/mist_api/models/network_multicast.rb', line 28 def self.names @_hash = {} if @_hash.nil? @_hash['disable_igmp'] = 'disable_igmp' @_hash['enabled'] = 'enabled' @_hash['groups'] = 'groups' @_hash end |
.nullables ⇒ Object
An array for nullable fields
46 47 48 |
# File 'lib/mist_api/models/network_multicast.rb', line 46 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
37 38 39 40 41 42 43 |
# File 'lib/mist_api/models/network_multicast.rb', line 37 def self.optionals %w[ disable_igmp enabled groups ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
75 76 77 78 79 80 81 |
# File 'lib/mist_api/models/network_multicast.rb', line 75 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.
90 91 92 93 94 |
# File 'lib/mist_api/models/network_multicast.rb', line 90 def inspect class_name = self.class.name.split('::').last "<#{class_name} disable_igmp: #{@disable_igmp.inspect}, enabled: #{@enabled.inspect},"\ " groups: #{@groups.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
84 85 86 87 |
# File 'lib/mist_api/models/network_multicast.rb', line 84 def to_s class_name = self.class.name.split('::').last "<#{class_name} disable_igmp: #{@disable_igmp}, enabled: #{@enabled}, groups: #{@groups}>" end |