Method: Jamf::PatchTitle.all_source_ids

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

.all_source_ids(refresh = false, api: nil, cnx: Jamf.cnx) ⇒ Array<Integer>

Returns an Array of unique source_ids used by active Patches

e.g. if there are patches that come from one internal source and two external sources this might return [1,3,4].

Regardless of how many patches come from each source, the source id appears only once in this array.

Parameters:

  • refresh (Boolean) (defaults to: false)

    should the data be re-queried from the API?

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

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

Returns:

  • (Array<Integer>)

    the ids of the patch sources used in the JSS



221
222
223
224
225
# File 'lib/jamf/api/classic/api_objects/patch_title.rb', line 221

def self.all_source_ids(refresh = false, api: nil, cnx: Jamf.cnx)
  cnx = api if api

  all(refresh, cnx: cnx).map { |i| i[:source_id] }.sort.uniq
end