Class: MistApi::MxedgeDas

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

Overview

Configure cloud-assisted dynamic authorization service on this cluster of mist edges

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(coa_servers = SKIP, enabled = false) ⇒ MxedgeDas

Returns a new instance of MxedgeDas.



44
45
46
47
# File 'lib/mist_api/models/mxedge_das.rb', line 44

def initialize(coa_servers = SKIP, enabled = false)
  @coa_servers = coa_servers unless coa_servers == SKIP
  @enabled = enabled unless enabled == SKIP
end

Instance Attribute Details

#coa_serversArray[MxedgeDasCoaServer]

Dynamic authorization clients configured to send CoA|DM to mist edges on port 3799

Returns:



16
17
18
# File 'lib/mist_api/models/mxedge_das.rb', line 16

def coa_servers
  @coa_servers
end

#enabledTrueClass | FalseClass

Dynamic authorization clients configured to send CoA|DM to mist edges on port 3799

Returns:

  • (TrueClass | FalseClass)


21
22
23
# File 'lib/mist_api/models/mxedge_das.rb', line 21

def enabled
  @enabled
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/mist_api/models/mxedge_das.rb', line 50

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  # Parameter is an array, so we need to iterate through it
  coa_servers = nil
  unless hash['coa_servers'].nil?
    coa_servers = []
    hash['coa_servers'].each do |structure|
      coa_servers << (MxedgeDasCoaServer.from_hash(structure) if structure)
    end
  end

  coa_servers = SKIP unless hash.key?('coa_servers')
  enabled = hash['enabled'] ||= false

  # Create object from extracted values.
  MxedgeDas.new(coa_servers,
                enabled)
end

.namesObject

A mapping from model property names to API property names.



24
25
26
27
28
29
# File 'lib/mist_api/models/mxedge_das.rb', line 24

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['coa_servers'] = 'coa_servers'
  @_hash['enabled'] = 'enabled'
  @_hash
end

.nullablesObject

An array for nullable fields



40
41
42
# File 'lib/mist_api/models/mxedge_das.rb', line 40

def self.nullables
  []
end

.optionalsObject

An array for optional fields



32
33
34
35
36
37
# File 'lib/mist_api/models/mxedge_das.rb', line 32

def self.optionals
  %w[
    coa_servers
    enabled
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



78
79
80
81
# File 'lib/mist_api/models/mxedge_das.rb', line 78

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} coa_servers: #{@coa_servers.inspect}, enabled: #{@enabled.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



72
73
74
75
# File 'lib/mist_api/models/mxedge_das.rb', line 72

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} coa_servers: #{@coa_servers}, enabled: #{@enabled}>"
end