Method: Jamf::Computer.management_data

Defined in:
lib/jamf/api/classic/api_objects/computer.rb

.management_data(ident, subset: nil, only: nil, api: nil, cnx: Jamf.cnx) ⇒ Hash, Array

The ‘computer management’ data for a given computer by id, looked up on the fly.

Without specifying a subset:, the entire dataset is returned as a hash of arrays, one per subset

If a subset is given then only that array is returned, and it contains hashes with data about each item (usually :name and :id)

If the only: param is provided with a subset, it is used as a hash-key to map the array to just those values, so subset: :smart_groups, only: :name will return an array of names of smartgroups that contain the computer.

Parameters:

  • ident (Integer, String)

    An identifier (id, name, serialnumber, macadress or udid) of the computer for which to retrieve Application Usage

  • subset (Symbol) (defaults to: nil)

    Fetch only a subset of data, as an array. must be one of the symbols in MGMT_DATA_SUBSETS

  • only (Symbol) (defaults to: nil)

    When fetching a subset, only return one value per item in the array. meaningless without a subset.

  • cnx (Jamf::Connection) (defaults to: Jamf.cnx)

    an API connection to use for the query. Defaults to the corrently active API. See Jamf::Connection

Returns:

  • (Hash)

    Without a subset:, a hash of all subsets, each of which is an Array

  • (Array)

    With a subset:, an array of items in that subset, possibly limited to just certain values with only:



559
560
561
562
563
564
565
566
567
568
569
570
# File 'lib/jamf/api/classic/api_objects/computer.rb', line 559

def self.management_data(ident, subset: nil, only: nil, api: nil, cnx: Jamf.cnx)
  cnx = api if api

  id = valid_id ident, cnx: cnx
  raise "No computer matches identifier: #{ident}" unless id

  if subset
    management_data_subset id, subset: subset, only: only, cnx: cnx
  else
    full_management_data id, cnx: cnx
  end
end