Restore an archived computer
POST/computers/archived/:targetComputerId/restore
Moves a retired (archived) computer back into the active inventory under its original id. By default the archived copy is deleted after a successful restore.
Required role: superadmin or admin.
The route does not check the id first, so a malformed id returns 422 rather than the plain-text 404.
The restored computer keeps its original id. Without preservecopy=true the archived record is deleted after the 200 is sent. Restoring an id whose archived copy is still present while an active computer already has that id returns 409 with the message Computer <id> is already active.; an id with no archived copy returns 409 with the message No stale computer with ID: <id>.
Request
Responses
- 200
- 401
- 403
- 409
- 422
- 500
- 501
The computer was restored.
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).
No archived computer with that id, or a computer with that id is already active.
The id is not a valid object id. Message: Invalid RetiredComputer ID: "<id>".
The save failed unexpectedly.
active=false was requested.