Module: Jamf::MacOSManagedUpdates

Included in:
Computer, ComputerGroup
Defined in:
lib/jamf/api/jamf_pro/mixins/macos_managed_updates.rb

Overview

This module should be mixed in to Jamf::Computer and Jamf::ComputerGroup

It provides access to the macos-managed-software-updates JPAPI resource for managed OS update commands to managed macs running Big Sur or higher.

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

MANAGED_SW_UPDATES_RSRC =

These resources in the Jamf Pro API can be used to send Managed macOS updates to clients running Big Sur or higher

'v1/macos-managed-software-updates'
MANAGED_SW_UPDATES_AVAILABLE_VERSIONS_RSRC =

GETting this resource provides a list of available OS versions

"#{MANAGED_SW_UPDATES_RSRC}/available-updates"
MANAGED_SW_UPDATES_SEND_UPDATES_RSRC =

POSTing JSON data to this resource will send the MDM commands to install os updates For details about the data to send, see developer.jamf.com/jamf-pro/reference/post_v1-macos-managed-software-updates-send-updates

"#{MANAGED_SW_UPDATES_RSRC}/send-updates"
DOWNLOAD_AND_INSTALL =

These are the options available in Jamf::OAPISchemas::MacOsManagedSoftwareUpdate::UPDATE_ACTION_OPTIONS

'DOWNLOAD_AND_INSTALL'
DOWNLOAD_ONLY =
'DOWNLOAD_ONLY'
UPDATE_ACTIONS =

for easier use of these values as the updateAction

{
  install: DOWNLOAD_AND_INSTALL,
  download: DOWNLOAD_ONLY
}

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(includer) ⇒ Object

when this module is included, also extend our Class Methods



35
36
37
38
# File 'lib/jamf/api/jamf_pro/mixins/macos_managed_updates.rb', line 35

def self.included(includer)
  Jamf.load_msg "--> #{includer} is including #{self}"
  includer.extend(ClassMethods)
end

Instance Method Details

#send_managed_os_update(updateAction:, maxDeferrals: nil, version: nil, skipVersionVerification: false, applyMajorUpdate: false, forceRestart: false) ⇒ Object

Send a managed update command to an instance of Computer or ComputerGroup. This just calls the class method of the same name.



169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/jamf/api/jamf_pro/mixins/macos_managed_updates.rb', line 169

def send_managed_os_update(updateAction:, maxDeferrals: nil, version: nil, skipVersionVerification: false, applyMajorUpdate: false, forceRestart: false)
  deviceIds = is_a?(Jamf::Computer) ? @id : nil
  groupId = is_a?(Jamf::Computer) ? nil : @id

  self.class.send_managed_os_update(
    deviceIds: deviceIds,
    groupId: groupId,
    maxDeferrals: maxDeferrals,
    version: version,
    skipVersionVerification: skipVersionVerification,
    applyMajorUpdate: applyMajorUpdate,
    forceRestart: forceRestart,
    updateAction: updateAction,
    cnx: @cnx
  )
end