Examples of HostDeregisterResponse


Examples of com.spotify.helios.common.protocol.HostDeregisterResponse

  @Timed
  @ExceptionMetered
  public HostDeregisterResponse delete(@PathParam("id") final String host) {
    try {
      model.deregisterHost(host);
      return new HostDeregisterResponse(HostDeregisterResponse.Status.OK, host);
    } catch (HostNotFoundException e) {
      throw notFound(new HostDeregisterResponse(HostDeregisterResponse.Status.NOT_FOUND, host));
    } catch (HostStillInUseException e) {
      throw badRequest(new HostDeregisterResponse(HostDeregisterResponse.Status.JOBS_STILL_DEPLOYED,
                                                  host));
    }
  }
View Full Code Here

Examples of com.spotify.helios.common.protocol.HostDeregisterResponse

  public void testDeregisterHostThatDoesntExist() throws Exception {
    startDefaultMaster();
    final String host = testHost();
    final HeliosClient client = defaultClient();

    final HostDeregisterResponse deregisterResponse = client.deregisterHost(host).get();
    assertEquals(HostDeregisterResponse.Status.NOT_FOUND, deregisterResponse.getStatus());
  }
View Full Code Here

Examples of com.spotify.helios.common.protocol.HostDeregisterResponse

    // Kill off agent
    agent.stopAsync().awaitTerminated();

    // Deregister agent
    final HostDeregisterResponse deregisterResponse = client.deregisterHost(host).get();
    assertEquals(HostDeregisterResponse.Status.OK, deregisterResponse.getStatus());

    // Verify that it's possible to remove the job
    final JobDeleteResponse deleteResponse = client.deleteJob(jobId).get();
    assertEquals(JobDeleteResponse.Status.OK, deleteResponse.getStatus());
  }
View Full Code Here

Examples of com.spotify.helios.common.protocol.HostDeregisterResponse

    out.printf("Deregistering host %s%n", host);

    int code = 0;

    final HostDeregisterResponse response = client.deregisterHost(host).get();
    out.printf("%s: ", host);
    if (response.getStatus() == HostDeregisterResponse.Status.OK) {
      out.printf("done%n");
    } else {
      out.printf("failed: %s%n", response);

      if (response.getStatus() == HostDeregisterResponse.Status.NOT_FOUND) {
        final HostResolver resolver = HostResolver.create(client);
        final List<String> resolved = resolver.getSortedMatches(host);
        if (!resolved.isEmpty()) {
          out.println("We didn't find your hostname, but we did find some possible matches for you:"
              + "\n    " + Joiner.on("\n    ").join(resolved) + "\n");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.