Module: Jamf::ComputerRecoveryLock

Included in:
Computer
Defined in:
lib/jamf/api/jamf_pro/mixins/computer_recovery_lock.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.

TODO: When POSTing to api/preview/mdm/commands is no longer in Preview, implement that endpoint and then add the setting of the recovery lock to this module.

See learn.jamf.com/bundle/technical-articles/page/Recovery_Lock_Enablement_in_macOS_Using_the_Jamf_Pro_API.html

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

RECOVERY_LOCK_PW_RSRC_SUFFIX =

The JPAPI resource for a single computer’s RecoveryLock password is Jamf::Computer::JPAPI_INVENTORY_RSRC then the computer’s ID then this

'view-recovery-lock-password'

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(includer) ⇒ Object

when this module is included, also extend our Class Methods



42
43
44
45
# File 'lib/jamf/api/jamf_pro/mixins/computer_recovery_lock.rb', line 42

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

Instance Method Details

#inventory_data(section: 'GENERAL') ⇒ Object

Get the JPAPI inventory data for this computer, either by section or all sections.



151
152
153
# File 'lib/jamf/api/jamf_pro/mixins/computer_recovery_lock.rb', line 151

def inventory_data(section: 'GENERAL')
  self.class.inventory_data @id, section: section, cnx: @cnx
end

#management_idObject

Get the MDM ‘managementID’ of this computer.



159
160
161
# File 'lib/jamf/api/jamf_pro/mixins/computer_recovery_lock.rb', line 159

def management_id
  inventory_data.general.managementId
end

#recovery_lock_passwordObject

Get the recovery lock password for this Computer instance



143
144
145
# File 'lib/jamf/api/jamf_pro/mixins/computer_recovery_lock.rb', line 143

def recovery_lock_password
  self.class.recovery_lock_password @id, cnx: @cnx
end