Class: MistApi::UpgradeSiteDevicesCounts
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- MistApi::UpgradeSiteDevicesCounts
- Defined in:
- lib/mist_api/models/upgrade_site_devices_counts.rb
Overview
UpgradeSiteDevicesCounts Model.
Instance Attribute Summary collapse
-
#download_requested ⇒ Integer
Count of devices which cloud has requested to download firmware.
-
#downloaded ⇒ Integer
Count of ap’s which have the firmware downloaded.
-
#failed ⇒ Integer
Count of devices which have failed to upgrade.
-
#reboot_in_progress ⇒ Integer
Count of devices which are rebooting.
-
#rebooted ⇒ Integer
Count of devices which have rebooted successfully.
-
#scheduled ⇒ Integer
Count of devices which cloud has scheduled an upgrade for.
-
#skipped ⇒ Integer
Count of devices which skipped upgrade since requested version was same as running version.
-
#total ⇒ Integer
Count of devices part of this upgrade.
-
#upgraded ⇒ Integer
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, failed = SKIP, reboot_in_progress = SKIP, rebooted = SKIP, scheduled = SKIP, skipped = SKIP, total = SKIP, upgraded = SKIP) ⇒ UpgradeSiteDevicesCounts
constructor
A new instance of UpgradeSiteDevicesCounts.
-
#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, failed = SKIP, reboot_in_progress = SKIP, rebooted = SKIP, scheduled = SKIP, skipped = SKIP, total = SKIP, upgraded = SKIP) ⇒ UpgradeSiteDevicesCounts
Returns a new instance of UpgradeSiteDevicesCounts.
84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/mist_api/models/upgrade_site_devices_counts.rb', line 84 def initialize(download_requested = SKIP, downloaded = 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 @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 ⇒ Integer
Count of devices which cloud has requested to download firmware
14 15 16 |
# File 'lib/mist_api/models/upgrade_site_devices_counts.rb', line 14 def download_requested @download_requested end |
#downloaded ⇒ Integer
Count of ap’s which have the firmware downloaded
18 19 20 |
# File 'lib/mist_api/models/upgrade_site_devices_counts.rb', line 18 def downloaded @downloaded end |
#failed ⇒ Integer
Count of devices which have failed to upgrade
22 23 24 |
# File 'lib/mist_api/models/upgrade_site_devices_counts.rb', line 22 def failed @failed end |
#reboot_in_progress ⇒ Integer
Count of devices which are rebooting
26 27 28 |
# File 'lib/mist_api/models/upgrade_site_devices_counts.rb', line 26 def reboot_in_progress @reboot_in_progress end |
#rebooted ⇒ Integer
Count of devices which have rebooted successfully
30 31 32 |
# File 'lib/mist_api/models/upgrade_site_devices_counts.rb', line 30 def rebooted @rebooted end |
#scheduled ⇒ Integer
Count of devices which cloud has scheduled an upgrade for
34 35 36 |
# File 'lib/mist_api/models/upgrade_site_devices_counts.rb', line 34 def scheduled @scheduled end |
#skipped ⇒ Integer
Count of devices which skipped upgrade since requested version was same as running version. Use force to always upgrade
39 40 41 |
# File 'lib/mist_api/models/upgrade_site_devices_counts.rb', line 39 def skipped @skipped end |
#total ⇒ Integer
Count of devices part of this upgrade
43 44 45 |
# File 'lib/mist_api/models/upgrade_site_devices_counts.rb', line 43 def total @total end |
#upgraded ⇒ Integer
Count of devices which have upgraded successfully
47 48 49 |
# File 'lib/mist_api/models/upgrade_site_devices_counts.rb', line 47 def upgraded @upgraded end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/mist_api/models/upgrade_site_devices_counts.rb', line 99 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 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. UpgradeSiteDevicesCounts.new(download_requested, downloaded, failed, reboot_in_progress, rebooted, scheduled, skipped, total, upgraded) end |
.names ⇒ Object
A mapping from model property names to API property names.
50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/mist_api/models/upgrade_site_devices_counts.rb', line 50 def self.names @_hash = {} if @_hash.nil? @_hash['download_requested'] = 'download_requested' @_hash['downloaded'] = 'downloaded' @_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
80 81 82 |
# File 'lib/mist_api/models/upgrade_site_devices_counts.rb', line 80 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/mist_api/models/upgrade_site_devices_counts.rb', line 65 def self.optionals %w[ download_requested downloaded failed reboot_in_progress rebooted scheduled skipped total upgraded ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
136 137 138 139 140 141 142 143 |
# File 'lib/mist_api/models/upgrade_site_devices_counts.rb', line 136 def inspect class_name = self.class.name.split('::').last "<#{class_name} download_requested: #{@download_requested.inspect}, downloaded:"\ " #{@downloaded.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.
128 129 130 131 132 133 |
# File 'lib/mist_api/models/upgrade_site_devices_counts.rb', line 128 def to_s class_name = self.class.name.split('::').last "<#{class_name} download_requested: #{@download_requested}, downloaded: #{@downloaded},"\ " failed: #{@failed}, reboot_in_progress: #{@reboot_in_progress}, rebooted: #{@rebooted},"\ " scheduled: #{@scheduled}, skipped: #{@skipped}, total: #{@total}, upgraded: #{@upgraded}>" end |