Method: Jamf::Prestage::ClassMethods#serials_by_prestage_id

Defined in:
lib/jamf/api/jamf_pro/mixins/prestage.rb

#serials_by_prestage_id(refresh = false, cnx: Jamf.cnx) ⇒ Hash {String => Integer}

Return all scoped serial numbers and the id of the prestage they are assigned to.

Parameters:

  • refresh (Boolean) (defaults to: false)

    re-read the list from the API? DEPRECATED: the data is always read from the API. If making many calls at once, consider capturing serials_by_prestage_id in your own variable

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

    the API connection to use

Returns:

  • (Hash {String => Integer})

    The Serials and prestage IDs



98
99
100
101
# File 'lib/jamf/api/jamf_pro/mixins/prestage.rb', line 98

def serials_by_prestage_id(refresh = false, cnx: Jamf.cnx) # rubocop:disable Lint/UnusedMethodArgument
  api_reponse = ALL_SCOPES_OBJECT.new cnx.jp_get(scope_path)
  api_reponse.serialsByPrestageId.transform_keys(&:to_s)
end