Class: MistApi::NetworkMulticast

Inherits:
BaseModel
  • Object
show all
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

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(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_igmpTrueClass | FalseClass

If the network will only be the source of the multicast traffic, IGMP can be disabled

Returns:

  • (TrueClass | FalseClass)


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

def disable_igmp
  @disable_igmp
end

#enabledTrueClass | FalseClass

If the network will only be the source of the multicast traffic, IGMP can be disabled

Returns:

  • (TrueClass | FalseClass)


20
21
22
# File 'lib/mist_api/models/network_multicast.rb', line 20

def enabled
  @enabled
end

#groupsHash[String, NetworkMulticastGroup]

Group address to RP (rendezvous point) mapping. Property Key is the CIDR (example “225.1.0.3/32”)

Returns:



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

.namesObject

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

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

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.

Parameters:



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

#inspectObject

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_sObject

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