Package com.fathomdb.cli.output

Examples of com.fathomdb.cli.output.ClientAction


      } else {
        throw new IllegalArgumentException("Cannot choose between: " + bestEndpoint + " and " + candidate);
      }
    }

    ClientAction action = null;

    if (bestEndpoint != null) {
      // TODO: How do we want to do this? A new tag??
      String id = key.getServiceType().getKey() + ":" + key.getItemType().getKey();
      if (id.equals("jenkins:jenkinsService")) {
        action = new ClientAction(ClientAction.ClientActionType.BROWSER, "http://" + bestEndpoint.publicIp
            + ":" + bestEndpoint.publicIp);
      }
    }

    return action;
View Full Code Here


    UntypedItem untypedItem = client.getItemUntyped(key, Format.XML);

    InetAddress sshAddress = findSshAddress(client, untypedItem);

    ClientAction action = null;
    if (sshAddress != null) {
      String user = "root";

      ProjectId project = key.getProject();
      if (project == null) {
        project = client.getProject();
      }
      if (project == null) {
        throw new CliException("Cannot determine project");
      }
      String projectKey = project.getKey();
      String serviceKey = "service-" + key.getServiceType().getKey();

      File sshKey = IoUtils.resolve("~/.credentials/ssh/" + projectKey + "/" + serviceKey);

      // Hmmm... user? key?
      action = new ClientAction(ClientAction.ClientActionType.SSH, user + "@" + sshAddress.getHostAddress(),
          sshKey.getAbsolutePath());
    }

    return action;
  }
View Full Code Here

TOP

Related Classes of com.fathomdb.cli.output.ClientAction

Copyright © 2018 www.massapicom. 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.