-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Code below provided by Rick Schuler:
def classic_lock_computer(self, id: int) -> Union[str, None]:
"""
Create a new class in Jamf Pro.
Args:
new_class (Computer Id):
Integer Id of the Device to lock
Returns:
If creation is successful, the ID of the machine
otherwise, None.
"""
data = f"<computer_command><general><command>DeviceLock</command><passcode>885344</passcode></general><computers><computer><id>{id}</id></computer></computers></computer_command>"
class_response: Response = self.make_api_request("/JSSResource/computercommands/command/DeviceLock", data=data, method=[jamf.HTTPMethod.POST](http://jamf.httpmethod.post/), classic=True)
if class_response:
if class_response.status_code == 201:
xml_data = ET.fromstring(class_response.text)
return xml_data.findtext('id')
else:
return None
Metadata
Metadata
Assignees
Labels
No labels