Discard the staged sudoers for a Linux computer
DELETE/computers/:computerId/sudoers
Deletes the staged sudoers so the computer falls back to the last scanned sudoers, and refreshes the admin inventory from it.
sudoersHash must equal the hash of the currently staged document.
Checks run in this order: non-Linux (400 Can only unstage sudoers content for Linux systems); Protect enabled, meaning Scan and Secure are both on (409 Cannot delete staged sudoers when Protect is enabled, nothing can be discarded while Protect is
on, even with no hash); missing sudoersHash (400); hash mismatch (409 Provided hash of <x> does not match found hash of <y>); no staged document (404 JSON NotFoundError No Staged Sudoers Exists, whatever hash was sent).
Required role: superadmin or admin.
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 409
- default
Staged sudoers discarded. The body is an empty JSON object.
Bad request. Access routes: InvalidQuery 'Invalid Access Duration Requested.' for a bad t. Any route: InvalidQuery 'illegal key "$ne" in query|body' when a query or body key starts with $. Malformed JSON gives an untyped {error} body. Sudoers routes: BadRequestError for a non-Linux computer, a missing or empty sudoers_blob, or a missing sudoersHash. Admin add/remove on Linux: BadRequestError carrying the sudoers service message. Missing or malformed ids on the admin routes are 422, not 400.
No token, or the token is invalid or expired. The body is {message}: No auth token provided when no token is sent, otherwise the token check's message (jwt expired, jwt malformed, invalid signature, invalid token, jwt signature is required). Send Authorization: Bearer <token> exactly: the server drops the first seven characters of the header and reads the rest as the token, so a different scheme or an extra space fails. If Authorization is absent, the server reads a token field in the body, then a token query parameter, then x-access-token. Routes that validate query fields reject ?token= with 400 InvalidQuery.
The token's role is not allowed for this operation, or the token's scopes exclude the route
(Scope not allowed by token).
Either the computer id is invalid (plain-text Invalid Computer ID) or no staged sudoers exists (JSON ErrorTyped, name NotFoundError).
The request conflicts with the current state of the resource.
Failure reported by the sudoers service, passed through with that service's HTTP status and a {message} body. A 500 is returned when the service fails unexpectedly (a missing Linux service-account password, or a non-string sudoers_blob).