private GetHostResponse getHost(RestApi.RequestContext context) {
        String hostNameString = context.pathParameters().getStringOrThrow("hostname");
        HostName hostName = new HostName(hostNameString);
        try {
            Host host = orchestrator.getHost(hostName);

            URI applicationUri = context.baseRequestURL()
                    .withPath(Path.parse( "/orchestrator/v1/instances/" + host.getApplicationInstanceReference().asString()))
                    .asURI();

            List<HostService> hostServices = host.getServiceInstances().stream()
                    .map(serviceInstance -> new HostService(
                            serviceInstance.getServiceCluster().clusterId().s(),
                            serviceInstance.getServiceCluster().serviceType().s(),
                            serviceInstance.configId().s(),
                            serviceInstance.serviceStatus().name()))
                    .toList();

            return new GetHostResponse(
                    host.getHostName().s(),
                    host.getHostInfo().status().name(),
                    host.getHostInfo().suspendedSince().map(Instant::toString).orElse(null),
                    applicationUri.toString(),
                    hostServices);
        } catch (UncheckedTimeoutException e) {
            log.log(Level.FINE, () -> "Failed to get host " + hostName + ": " + e.getMessage());
            throw restApiExceptionFromTimeout("getHost", hostName, e);
        } catch (HostNameNotFoundException e) {
            log.log(Level.FINE, () -> "Host not found: " + hostName);
            throw new RestApiException.NotFound(e);
        }
    }
@Test
    void getHost_works() {
        Orchestrator orchestrator = mock(Orchestrator.class);
        RestApiTestDriver testDriver = createTestDriver(orchestrator);

        HostName hostName = new HostName("hostname");

        ServiceInstance serviceInstance = new ServiceInstance(
                new ConfigId("configId"),
                hostName,
                ServiceStatus.UP);
        ServiceCluster serviceCluster = new ServiceCluster(
                new ClusterId("clusterId"),
                new ServiceType("serviceType"),
                Set.of(serviceInstance));
        serviceInstance.setServiceCluster(serviceCluster);

        Host host = new Host(
                hostName,
                HostInfo.createSuspended(HostStatus.ALLOWED_TO_BE_DOWN, Instant.EPOCH),
                new ApplicationInstanceReference(
                        new TenantId("tenantId"),
                        new ApplicationInstanceId("applicationId")),
                List.of(serviceInstance));
        when(orchestrator.getHost(hostName)).thenReturn(host);

        HttpResponse httpResponse = executeRequest(testDriver, Method.GET, "/orchestrator/v1/hosts/hostname", null);
        GetHostResponse response = parseResponseContent(testDriver, httpResponse, GetHostResponse.class);

        assertEquals("http://localhost/orchestrator/v1/instances/tenantId%3AapplicationId", response.applicationUrl());
        assertEquals("hostname", response.hostname());
        assertEquals("ALLOWED_TO_BE_DOWN", response.state());
        assertEquals("1970-01-01T00:00:00Z", response.suspendedSince());
        assertEquals(1, response.services().size());
        assertEquals("clusterId", response.services().get(0).clusterId);
        assertEquals("configId", response.services().get(0).configId);
        assertEquals("UP", response.services().get(0).serviceStatus);
        assertEquals("serviceType", response.services().get(0).serviceType);
    }