Package com.woorea.openstack.nova.model

Examples of com.woorea.openstack.nova.model.Servers


    keystone.token(access.getToken().getId());

    Nova novaClient = new Nova(ExamplesConfiguration.NOVA_ENDPOINT.concat("/").concat(access.getToken().getTenant().getId()));
    novaClient.token(access.getToken().getId());

    Servers servers = novaClient.servers().list(true).execute();
    if(servers.getList().size() > 0) {

      // Server has to be in activated state.
      ServersResource.StopServer stopServer = novaClient.servers().stop(servers.getList().get(0).getId());
      stopServer.endpoint(ExamplesConfiguration.NOVA_ENDPOINT);
      stopServer.execute();

      // Wait until server shutdown. Or 400 error occurs.
      Thread.sleep(5000);

      ServersResource.StartServer startServer = novaClient.servers().start(servers.getList().get(0).getId());
      startServer.endpoint(ExamplesConfiguration.NOVA_ENDPOINT);
      startServer.execute();
    }
  }
View Full Code Here


    //NovaClient novaClient = new NovaClient(KeystoneUtils.findEndpointURL(access.getServiceCatalog(), "compute", null, "public"), access.getToken().getId());
    Nova novaClient = new Nova(ExamplesConfiguration.NOVA_ENDPOINT.concat("/").concat(access.getToken().getTenant().getId()));
    novaClient.token(access.getToken().getId());
    //novaClient.enableLogging(Logger.getLogger("nova"), 100 * 1024);
   
    Servers servers = novaClient.servers().list(true).execute();
    for(Server server : servers) {
      System.out.println(server);
    }
   
  }
View Full Code Here

  }

  @Override
  public void execute(Nova nova, CommandLine cmd) {
   
    final Servers servers = nova.servers().list(true).execute();
   
    Table t = new Table(new TableModel<Server>(servers.getList()) {

      @Override
      public Column[] getHeaders() {
        return new Column[]{
          new Column("id", 32, Column.ALIGN_LEFT),
View Full Code Here

TOP

Related Classes of com.woorea.openstack.nova.model.Servers

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.