Method: Jamf::Prestage::ClassMethods#assigned_prestage_id

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

#assigned_prestage_id(sn, cnx: Jamf.cnx) ⇒ String?

The id of the prestage to which the given serialNumber is assigned. nil if not assigned or not in ADE.

NOTE: If a serial number isn’t assigned to any prestage, it may really be unassigned or it may not exist in your ADE. To see if a SN exists in one of your Device Enrollment instances, use Jamf::DeviceEnrollment.include?

Parameters:

  • sn (String)

    the serial number to look for

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

    the API connection to use

Returns:

  • (String, nil)

    The id of prestage to which the SN is assigned



123
124
125
# File 'lib/jamf/api/jamf_pro/mixins/prestage.rb', line 123

def assigned_prestage_id(sn, cnx: Jamf.cnx)
  serials_by_prestage_id(cnx: cnx)[sn]
end