lib/jss/api_object/management_history.rb
# Return the raw management history for a Computer or Mobile Device
#
# WARNING: It's huge, better to use a subset.
#
# NOTE: This returns the raw JSON data from the API, parsed into
# a ruby Hash. Use the subset-specific methods to retrieve more consistent
# arrays of ruby-jss objects for each kind of history event, e.g.
# JSS::Computer.audits(id) or JSS::MobileDevice.audits(id) to get an array
# of JSS::ManagementHistory::AuditEvent objects
#
# @param ident [Integer,String] An identifier (id, name, serialnumber,
#   macadress or udid) of the computer or device for which to retrieve history
#
# @param subset[Symbol] the subset to return, rather than full history.
#
# @param api[JSS::APIConnection] an API connection to use for the query.
#   Defaults to the corrently active API. See {JSS::APIConnection}
#
# @return [Hash,Array] The raw full history or subset requested
#
Return the raw management history for a Computer or Mobile Device
WARNING: It's huge, better to use a subset.

This returns the raw JSON data from the API, parsed into
a ruby Hash. Use the subset-specific methods to retrieve more consistent
arrays of ruby-jss objects for each kind of history event, e.g.
Return the raw management history for a Computer or Mobile Device WARNING : It ' s huge better to use a subset . This returns the raw JSON data from the API parsed into a ruby Hash . Use the subset - specific methods to retrieve more consistent arrays of ruby - jss objects for each kind of history event e . g .
def management_history(ident, subset = nil, api: JSS.api)
        id = valid_id ident, api: api
        raise JSS::NoSuchItemError, "No #{self::RSRC_OBJECT_KEY} matches identifier: #{ident}" unless id
        if self == JSS::Computer
          @hist_subsets ||= HIST_COMPUTER_SUBSETS
          @hist_rsrc ||= HIST_COMPUTER_RSRC
          @hist_key ||= HIST_COMPUTER_KEY
        else
          @hist_subsets ||= HIST_DEVICE_SUBSETS
          @hist_rsrc ||= HIST_DEVICE_RSRC
          @hist_key ||= HIST_DEVICE_KEY
        end
        if subset
          raise "Subset must be one of :#{@hist_subsets.join ', :'}" unless @hist_subsets.include? subset
          subset_rsrc = @hist_rsrc + "/id/#{id}/subset/#{subset}"
          api.get_rsrc(subset_rsrc)[@hist_key][subset]
        else
          api.get_rsrc(@hist_rsrc + "/id/#{id}")[@hist_key]
        end
      end
def management_history ( ident , subset = nil , api : JSS . api ) id = valid_id ident , api : api raise JSS :: NoSuchItemError , "No #{self::RSRC_OBJECT_KEY} matches identifier: #{ident}" unless id if self == JSS :: Computer @hist_subsets ||= HIST_COMPUTER_SUBSETS @hist_rsrc ||= HIST_COMPUTER_RSRC @hist_key ||= HIST_COMPUTER_KEY else @hist_subsets ||= HIST_DEVICE_SUBSETS @hist_rsrc ||= HIST_DEVICE_RSRC @hist_key ||= HIST_DEVICE_KEY end if subset raise "Subset must be one of :#{@hist_subsets.join ', :'}" unless @hist_subsets . include? subset subset_rsrc = @hist_rsrc + "/id/#{id}/subset/#{subset}" api . get_rsrc ( subset_rsrc ) [ @hist_key ] [ subset ] else api . get_rsrc ( @hist_rsrc + "/id/#{id}" ) [ @hist_key ] end end
Return the raw management history for a Computer or Mobile Device
WARNING: It's huge, better to use a subset.
Return the raw management history for a Computer or Mobile Device WARNING : It ' s huge better to use a subset .
The raw full history or subset requested
The raw full history or subset requested
Hash,Array
ident
An identifier (id, name, serialnumber, macadress or udid) of the computer or device for which to retrieve history
An identifier ( id name serialnumber macadress or udid ) of the computer or device for which to retrieve history
subset
the subset to return, rather than full history.
the subset to return rather than full history .
api
an API connection to use for the query. Defaults to the corrently active API. See {JSS::APIConnection}
an API connection to use for the query . Defaults to the corrently active API . See { JSS :: APIConnection }