private PatchHostResponse patch(RestApi.RequestContext context, PatchHostRequest request) {
        String hostNameString = context.pathParameters().getStringOrThrow("hostname");
        HostName hostName = new HostName(hostNameString);

        if (request.state != null) {
            HostStatus state;
            try {
                state = HostStatus.valueOf(request.state);
            } catch (IllegalArgumentException dummy) {
                throw new RestApiException.BadRequest("Bad state in request: '" + request.state + "'");
            }

            try {
                orchestrator.setNodeStatus(hostName, state);
            } catch (HostNameNotFoundException e) {
                log.log(Level.FINE, () -> "Host not found: " + hostName);
                throw new RestApiException.NotFound(e);
            } catch (UncheckedTimeoutException e) {
                log.log(Level.FINE, () -> "Failed to patch " + hostName + ": " + e.getMessage());
                throw restApiExceptionFromTimeout("patch", hostName, e);
            } catch (OrchestrationException e) {
                String message = "Failed to set " + hostName + " to " + state + ": " + e.getMessage();
                log.log(Level.FINE, message, e);
                throw new RestApiException.InternalServerError(message);
            }
        }

        PatchHostResponse response = new PatchHostResponse();
        response.description = "ok";
        return response;
    }
Tweak internal Orchestrator state for host.
orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HostRequestHandler.java