Class: MistApi::SettingSsr

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

Overview

SettingSsr Model.

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(auto_upgrade = SKIP, conductor_hosts = SKIP, conductor_token = SKIP, disable_stats = SKIP, proxy = SKIP) ⇒ SettingSsr

Returns a new instance of SettingSsr.



59
60
61
62
63
64
65
66
# File 'lib/mist_api/models/setting_ssr.rb', line 59

def initialize(auto_upgrade = SKIP, conductor_hosts = SKIP,
               conductor_token = SKIP, disable_stats = SKIP, proxy = SKIP)
  @auto_upgrade = auto_upgrade unless auto_upgrade == SKIP
  @conductor_hosts = conductor_hosts unless conductor_hosts == SKIP
  @conductor_token = conductor_token unless conductor_token == SKIP
  @disable_stats = disable_stats unless disable_stats == SKIP
  @proxy = proxy unless proxy == SKIP
end

Instance Attribute Details

#auto_upgradeSettingSsrAutoUpgrade

auto_upgrade device first time it is onboarded



14
15
16
# File 'lib/mist_api/models/setting_ssr.rb', line 14

def auto_upgrade
  @auto_upgrade
end

#conductor_hostsArray[String]

List of Conductor IP Addresses or Hosts to be used by the SSR Devices

Returns:

  • (Array[String])


18
19
20
# File 'lib/mist_api/models/setting_ssr.rb', line 18

def conductor_hosts
  @conductor_hosts
end

#conductor_tokenString

Token to be used by the SSR Devices to connect to the Conductor

Returns:

  • (String)


22
23
24
# File 'lib/mist_api/models/setting_ssr.rb', line 22

def conductor_token
  @conductor_token
end

#disable_statsTrueClass | FalseClass

Disable stats collection on SSR devices

Returns:

  • (TrueClass | FalseClass)


26
27
28
# File 'lib/mist_api/models/setting_ssr.rb', line 26

def disable_stats
  @disable_stats
end

#proxySsrProxy

SSR proxy configuration to talk to Mist

Returns:



30
31
32
# File 'lib/mist_api/models/setting_ssr.rb', line 30

def proxy
  @proxy
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/mist_api/models/setting_ssr.rb', line 69

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  auto_upgrade = SettingSsrAutoUpgrade.from_hash(hash['auto_upgrade']) if hash['auto_upgrade']
  conductor_hosts =
    hash.key?('conductor_hosts') ? hash['conductor_hosts'] : SKIP
  conductor_token =
    hash.key?('conductor_token') ? hash['conductor_token'] : SKIP
  disable_stats = hash.key?('disable_stats') ? hash['disable_stats'] : SKIP
  proxy = SsrProxy.from_hash(hash['proxy']) if hash['proxy']

  # Create object from extracted values.
  SettingSsr.new(auto_upgrade,
                 conductor_hosts,
                 conductor_token,
                 disable_stats,
                 proxy)
end

.namesObject

A mapping from model property names to API property names.



33
34
35
36
37
38
39
40
41
# File 'lib/mist_api/models/setting_ssr.rb', line 33

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['auto_upgrade'] = 'auto_upgrade'
  @_hash['conductor_hosts'] = 'conductor_hosts'
  @_hash['conductor_token'] = 'conductor_token'
  @_hash['disable_stats'] = 'disable_stats'
  @_hash['proxy'] = 'proxy'
  @_hash
end

.nullablesObject

An array for nullable fields



55
56
57
# File 'lib/mist_api/models/setting_ssr.rb', line 55

def self.nullables
  []
end

.optionalsObject

An array for optional fields



44
45
46
47
48
49
50
51
52
# File 'lib/mist_api/models/setting_ssr.rb', line 44

def self.optionals
  %w[
    auto_upgrade
    conductor_hosts
    conductor_token
    disable_stats
    proxy
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



97
98
99
100
101
102
# File 'lib/mist_api/models/setting_ssr.rb', line 97

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} auto_upgrade: #{@auto_upgrade.inspect}, conductor_hosts:"\
  " #{@conductor_hosts.inspect}, conductor_token: #{@conductor_token.inspect}, disable_stats:"\
  " #{@disable_stats.inspect}, proxy: #{@proxy.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



90
91
92
93
94
# File 'lib/mist_api/models/setting_ssr.rb', line 90

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} auto_upgrade: #{@auto_upgrade}, conductor_hosts: #{@conductor_hosts},"\
  " conductor_token: #{@conductor_token}, disable_stats: #{@disable_stats}, proxy: #{@proxy}>"
end