Class: MistApi::UpgradeDevicesTargets
- Defined in:
- lib/mist_api/models/upgrade_devices_targets.rb
Overview
UpgradeDevicesTargets Model.
Instance Attribute Summary collapse
-
#download_requested ⇒ Array[String]
List of devices MAC Addresses which cloud has requested to download firmware.
-
#downloaded ⇒ Array[String]
List of devices MAC Addresses which have the firmware downloaded.
-
#downloading ⇒ Array[String]
List of devices MAC Addresses which are currently downloading the firmware.
-
#failed ⇒ Array[String]
List of devices MAC Addresses which have failed to upgrade.
-
#reboot_in_progress ⇒ Array[String]
List of devices MAC Addresses which are rebooting.
-
#rebooted ⇒ Array[String]
List of devices MAC Addresses which have rebooted successfully.
-
#scheduled ⇒ Array[String]
List of devices MAC Addresses which cloud has scheduled an upgrade for.
-
#skipped ⇒ Array[String]
List of devices MAC Addresses which skipped upgrade since requested version was same as running version.
-
#total ⇒ Integer
Count of devices part of this upgrade.
-
#upgraded ⇒ Array[String]
Count of devices which have upgraded successfully.
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(download_requested = SKIP, downloaded = SKIP, downloading = SKIP, failed = SKIP, reboot_in_progress = SKIP, rebooted = SKIP, scheduled = SKIP, skipped = SKIP, total = SKIP, upgraded = SKIP) ⇒ UpgradeDevicesTargets
constructor
A new instance of UpgradeDevicesTargets.
-
#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(download_requested = SKIP, downloaded = SKIP, downloading = SKIP, failed = SKIP, reboot_in_progress = SKIP, rebooted = SKIP, scheduled = SKIP, skipped = SKIP, total = SKIP, upgraded = SKIP) ⇒ UpgradeDevicesTargets
Returns a new instance of UpgradeDevicesTargets.
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/mist_api/models/upgrade_devices_targets.rb', line 91 def initialize(download_requested = SKIP, downloaded = SKIP, downloading = SKIP, failed = SKIP, reboot_in_progress = SKIP, rebooted = SKIP, scheduled = SKIP, skipped = SKIP, total = SKIP, upgraded = SKIP) @download_requested = download_requested unless download_requested == SKIP @downloaded = downloaded unless downloaded == SKIP @downloading = downloading unless downloading == SKIP @failed = failed unless failed == SKIP @reboot_in_progress = reboot_in_progress unless reboot_in_progress == SKIP @rebooted = rebooted unless rebooted == SKIP @scheduled = scheduled unless scheduled == SKIP @skipped = skipped unless skipped == SKIP @total = total unless total == SKIP @upgraded = upgraded unless upgraded == SKIP end |
Instance Attribute Details
#download_requested ⇒ Array[String]
List of devices MAC Addresses which cloud has requested to download firmware
15 16 17 |
# File 'lib/mist_api/models/upgrade_devices_targets.rb', line 15 def download_requested @download_requested end |
#downloaded ⇒ Array[String]
List of devices MAC Addresses which have the firmware downloaded
19 20 21 |
# File 'lib/mist_api/models/upgrade_devices_targets.rb', line 19 def downloaded @downloaded end |
#downloading ⇒ Array[String]
List of devices MAC Addresses which are currently downloading the firmware
23 24 25 |
# File 'lib/mist_api/models/upgrade_devices_targets.rb', line 23 def downloading @downloading end |
#failed ⇒ Array[String]
List of devices MAC Addresses which have failed to upgrade
27 28 29 |
# File 'lib/mist_api/models/upgrade_devices_targets.rb', line 27 def failed @failed end |
#reboot_in_progress ⇒ Array[String]
List of devices MAC Addresses which are rebooting
31 32 33 |
# File 'lib/mist_api/models/upgrade_devices_targets.rb', line 31 def reboot_in_progress @reboot_in_progress end |
#rebooted ⇒ Array[String]
List of devices MAC Addresses which have rebooted successfully
35 36 37 |
# File 'lib/mist_api/models/upgrade_devices_targets.rb', line 35 def rebooted @rebooted end |
#scheduled ⇒ Array[String]
List of devices MAC Addresses which cloud has scheduled an upgrade for
39 40 41 |
# File 'lib/mist_api/models/upgrade_devices_targets.rb', line 39 def scheduled @scheduled end |
#skipped ⇒ Array[String]
List of devices MAC Addresses which skipped upgrade since requested version was same as running version. Use force to always upgrade
44 45 46 |
# File 'lib/mist_api/models/upgrade_devices_targets.rb', line 44 def skipped @skipped end |
#total ⇒ Integer
Count of devices part of this upgrade
48 49 50 |
# File 'lib/mist_api/models/upgrade_devices_targets.rb', line 48 def total @total end |
#upgraded ⇒ Array[String]
Count of devices which have upgraded successfully
52 53 54 |
# File 'lib/mist_api/models/upgrade_devices_targets.rb', line 52 def upgraded @upgraded end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/mist_api/models/upgrade_devices_targets.rb', line 108 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. download_requested = hash.key?('download_requested') ? hash['download_requested'] : SKIP downloaded = hash.key?('downloaded') ? hash['downloaded'] : SKIP downloading = hash.key?('downloading') ? hash['downloading'] : SKIP failed = hash.key?('failed') ? hash['failed'] : SKIP reboot_in_progress = hash.key?('reboot_in_progress') ? hash['reboot_in_progress'] : SKIP rebooted = hash.key?('rebooted') ? hash['rebooted'] : SKIP scheduled = hash.key?('scheduled') ? hash['scheduled'] : SKIP skipped = hash.key?('skipped') ? hash['skipped'] : SKIP total = hash.key?('total') ? hash['total'] : SKIP upgraded = hash.key?('upgraded') ? hash['upgraded'] : SKIP # Create object from extracted values. UpgradeDevicesTargets.new(download_requested, downloaded, downloading, failed, reboot_in_progress, rebooted, scheduled, skipped, total, upgraded) end |
.names ⇒ Object
A mapping from model property names to API property names.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/mist_api/models/upgrade_devices_targets.rb', line 55 def self.names @_hash = {} if @_hash.nil? @_hash['download_requested'] = 'download_requested' @_hash['downloaded'] = 'downloaded' @_hash['downloading'] = 'downloading' @_hash['failed'] = 'failed' @_hash['reboot_in_progress'] = 'reboot_in_progress' @_hash['rebooted'] = 'rebooted' @_hash['scheduled'] = 'scheduled' @_hash['skipped'] = 'skipped' @_hash['total'] = 'total' @_hash['upgraded'] = 'upgraded' @_hash end |
.nullables ⇒ Object
An array for nullable fields
87 88 89 |
# File 'lib/mist_api/models/upgrade_devices_targets.rb', line 87 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/mist_api/models/upgrade_devices_targets.rb', line 71 def self.optionals %w[ download_requested downloaded downloading failed reboot_in_progress rebooted scheduled skipped total upgraded ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
148 149 150 151 152 153 154 155 |
# File 'lib/mist_api/models/upgrade_devices_targets.rb', line 148 def inspect class_name = self.class.name.split('::').last "<#{class_name} download_requested: #{@download_requested.inspect}, downloaded:"\ " #{@downloaded.inspect}, downloading: #{@downloading.inspect}, failed: #{@failed.inspect},"\ " reboot_in_progress: #{@reboot_in_progress.inspect}, rebooted: #{@rebooted.inspect},"\ " scheduled: #{@scheduled.inspect}, skipped: #{@skipped.inspect}, total: #{@total.inspect},"\ " upgraded: #{@upgraded.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
139 140 141 142 143 144 145 |
# File 'lib/mist_api/models/upgrade_devices_targets.rb', line 139 def to_s class_name = self.class.name.split('::').last "<#{class_name} download_requested: #{@download_requested}, downloaded: #{@downloaded},"\ " downloading: #{@downloading}, failed: #{@failed}, reboot_in_progress:"\ " #{@reboot_in_progress}, rebooted: #{@rebooted}, scheduled: #{@scheduled}, skipped:"\ " #{@skipped}, total: #{@total}, upgraded: #{@upgraded}>" end |