Skip to main content

Update a computer

PATCH 

/computers/:computerId

Changes a computer's policy, directory bridging or EDR integration. The first matching rule wins:

  1. If the body contains a non-empty ip, only the last known IP address is updated and the rest of the body is ignored. A plain user may do this only for a computer that user can administer (directly or through a group); otherwise 403. An ip that is empty or null is ignored and the request falls through to rule 2.
  2. Otherwise the caller must be superadmin or admin (403 for a plain user), and policy, directory_bridging / system_domain and edr_integration are applied together in one save.

Notes on the body:

  • edr_integration is a top-level field in the request body holding the id of an EDR configuration. The server stores it at config.policies.edr_integration, and that is where responses show it. The id must be a valid 24-character object id (anything else, including an empty string, returns 400 ValidationError) but it is stored without checking that the EDR configuration exists.
  • policy.manage_local_sids is accepted but ignored; the stored value is kept.
  • policy.strict_secure can be true only while protect mode (policy.secure) ends up true.
  • Scan mode cannot be turned off while offline access management is enabled on the computer.
  • directory_bridging and system_domain apply to Linux and macOS computers only (422 otherwise). system_domain is required when directory_bridging is centrify, powerbroker, sssd or directory_utility, and must name a configured directory (LDAP) domain. For secureone or none the domain is cleared and the computer is marked non-domain. system_domain without directory_bridging returns 422.
  • Changing policy on a Linux computer also stages or applies sudoers policy.

The body can be JSON or urlencoded (nested keys such as policy[scan]=true work). A body sent with any other content type is not parsed and the request is treated as an empty update. An empty update ({}, or fields the route does not know) saves nothing new and returns the computer with 200. Unknown fields such as cn are ignored. Boolean policy values sent as the strings "true" or "false" are accepted; a policy value that is not an object is ignored. Malformed JSON returns 400 with {error}.

Required role: any authenticated user for an ip update of a computer the user administers; otherwise superadmin or admin.

Request​

Responses​

Success. When only ip was sent the body is {message}; otherwise it is the full updated computer.