Restore a retired system
PUT/systems/:targetComputerId
Moves a retired (archived) system back to the active systems list under its original id.
targetComputerId is the original id of the system (the old_id of the retired record). By default the retired copy is deleted after a successful restore. The same operation is available at POST /computers/archived/{targetComputerId}/restore. The request has no body.
Required role: admin or superadmin.
active is parsed only as a boolean flag: any value other than false restores. With preservecopy=true the retired record stays in the retired list and a second call returns 409 because the system is now active. The 200 body is {message, restoredId} as documented.
Request
Responses
- 200
- 401
- 403
- 409
- 422
- 501
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).
There is no retired system with that original id (No stale computer with ID: ...; a well-formed id that matches nothing, including the all-zero id), or the system is already active (Computer ... is already active.). Typed error body ConflictError.
The id is not a valid object id. Typed error body UnprocessableEntityError.
active=false (retiring a system) is not implemented. Typed error body.