Method: JSS::Computer.all
- Defined in:
- lib/jss/api_object/computer.rb
.all(refresh = false, api: JSS.api) ⇒ Array<Hash{:name=>String, :id=> Integer}>
A larger set of info about the computers in the JSS.
Casper 9.4 introduced the API Resource /computers/subset/basic that returns an array of hashes with more data than just /computers/ (which was just :name and :id). Similar to /mobildevices/, this new list includes :udid, :serial_number, and :mac_address, as well as :model, :managed, :building, :department, :username, and :report_date
Because this requires a different, unusual, resource path, we’re completely re-defining APIObject.all for JSS::Computer. Hopefully some day the original /computers/ resource will be updated to return this data.
326 327 328 329 330 331 332 333 |
# File 'lib/jss/api_object/computer.rb', line 326 def self.all(refresh = false, api: JSS.api) cache = api.object_list_cache cache_key = self::RSRC_LIST_KEY cache[cache_key] = nil if refresh return cache[cache_key] if cache[cache_key] cache[cache_key] = api.get_rsrc(self::LIST_RSRC)[cache_key] end |