Package com.woorea.openstack.console.utils

Examples of com.woorea.openstack.console.utils.Table


  @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),
          new Column("name", 10, Column.ALIGN_LEFT)
        };
      }

      @Override
      public String[] getRow(Server server) {
        return new String[]{
          server.getId(),
          server.getName()
        };
      }
    });
    System.out.println(t.render());
  }
View Full Code Here


      tenant.setEnabled(Boolean.TRUE);
    }
   
    tenant = keystone.tenants().create(tenant).execute();
   
    Table t = new Table(new TableModel<Tenant>(Arrays.asList(tenant)) {

      @Override
      public Column[] getHeaders() {
        return new Column[]{
          new Column("id", 32, Column.ALIGN_LEFT),
          new Column("name", 10, Column.ALIGN_LEFT),
          new Column("description", 32, Column.ALIGN_LEFT),
          new Column("enabled", 7, Column.ALIGN_LEFT)
        };
      }

      @Override
      public String[] getRow(Tenant tenant) {
        return new String[]{
          tenant.getId(),
          tenant.getName(),
          tenant.getDescription(),
          tenant.getEnabled().toString()
        };
      }
    });
    System.out.println(t.render());
  }
View Full Code Here

  public void execute(Keystone keystone, CommandLine cmd) {
   
    String[] args = cmd.getArgs();
    if(args.length == 1) {
      User user = keystone.users().show(args[0]).execute();
      Table t = new Table(new TableModel<User>(Arrays.asList(user)) {

        @Override
        public Column[] getHeaders() {
          return new Column[]{
            new Column("id", 32, Column.ALIGN_LEFT),
            new Column("name", 10, Column.ALIGN_LEFT),
            new Column("email", 22, Column.ALIGN_LEFT),
            new Column("tenant", 32, Column.ALIGN_LEFT),
            new Column("enabled", 7, Column.ALIGN_LEFT)
          };
        }

        @Override
        public String[] getRow(User user) {
          return new String[]{
            user.getId(),
            user.getName(),
            user.getEmail(),
            user.getTenantId(),
            user.getEnabled().toString()
          };
        }
      });
      System.out.println(t.render());
    }
  }
View Full Code Here

  @Override
  public void execute(Keystone keystone, CommandLine cmd) {
   
    final Roles roles = keystone.roles().list().execute();
   
    Table t = new Table(new TableModel<Role>(roles.getList()) {

      @Override
      public Column[] getHeaders() {
        return new Column[]{
          new Column("id", 32, Column.ALIGN_LEFT),
          new Column("name", 10, Column.ALIGN_LEFT),
          new Column("description", 32, Column.ALIGN_LEFT),
          new Column("enabled", 7, Column.ALIGN_LEFT),
        };
      }

      @Override
      public String[] getRow(Role role) {
        return new String[]{
            role.getId(),
            role.getName(),
            role.getDescription(),
            role.getEnabled()
        };
      }
    });
    System.out.println(t.render());
  }
View Full Code Here

  @Override
  public void execute(Keystone keystone, CommandLine cmd) {
   
    final Users users = keystone.users().list().execute();
   
    Table t = new Table(new TableModel<User>(users.getList()) {

      @Override
      public Column[] getHeaders() {
        return new Column[]{
          new Column("id", 32, Column.ALIGN_LEFT),
          new Column("name", 10, Column.ALIGN_LEFT),
          new Column("email", 22, Column.ALIGN_LEFT),
          new Column("tenant", 32, Column.ALIGN_LEFT),
          new Column("enabled", 7, Column.ALIGN_LEFT)
        };
      }

      @Override
      public String[] getRow(User user) {
        return new String[]{
          user.getId(),
          user.getName(),
          user.getEmail(),
          user.getTenantId(),
          user.getEnabled().toString()
        };
      }
    });
    System.out.println(t.render());
  }
View Full Code Here

      role.setEnabled("True");
    }
   
    role = keystone.roles().create(role).execute();
   
    Table t = new Table(new TableModel<Role>(Arrays.asList(role)) {

      @Override
      public Column[] getHeaders() {
        return new Column[]{
          new Column("id", 32, Column.ALIGN_LEFT),
          new Column("name", 10, Column.ALIGN_LEFT),
          new Column("description", 32, Column.ALIGN_LEFT),
          new Column("enabled", 7, Column.ALIGN_LEFT)
        };
      }

      @Override
      public String[] getRow(Role tenant) {
        return new String[]{
          tenant.getId(),
          tenant.getName(),
          tenant.getDescription(),
          tenant.getEnabled().toString()
        };
      }
    });
    System.out.println(t.render());
  }
View Full Code Here

  @Override
  public void execute(Keystone keystone, CommandLine args) {
   
    final Tenants tenants = keystone.tenants().list().execute();
   
    Table t = new Table(new TableModel<Tenant>(tenants.getList()) {

      @Override
      public Column[] getHeaders() {
        return new Column[]{
          new Column("id", 32, Column.ALIGN_LEFT),
          new Column("name", 32, Column.ALIGN_LEFT),
          new Column("description", 32, Column.ALIGN_LEFT),
          new Column("enabled", 7, Column.ALIGN_LEFT)
        };
      }

      @Override
      public String[] getRow(Tenant tenant) {
        return new String[]{
          tenant.getId(),
          tenant.getName(),
          tenant.getDescription(),
          tenant.getEnabled().toString()
        };
      }
    });
    System.out.println(t.render());
  }
View Full Code Here

      user.setEnabled(Boolean.TRUE);
    }
   
    user = keystone.users().create(user).execute();
   
    Table t = new Table(new TableModel<User>(Arrays.asList(user)) {

      @Override
      public Column[] getHeaders() {
        return new Column[]{
          new Column("id", 32, Column.ALIGN_LEFT),
          new Column("name", 10, Column.ALIGN_LEFT),
          new Column("email", 22, Column.ALIGN_LEFT),
          new Column("tenant", 32, Column.ALIGN_LEFT),
          new Column("enabled", 7, Column.ALIGN_LEFT)
        };
      }

      @Override
      public String[] getRow(User user) {
        return new String[]{
          user.getId(),
          user.getName(),
          user.getEmail(),
          user.getTenantId(),
          user.getEnabled().toString()
        };
      }
    });
    System.out.println(t.render());
  }
View Full Code Here

  @Override
  public void execute(Keystone keystone, CommandLine cmd) {
   
    final Services services = keystone.services().list().execute();
   
    Table t = new Table(new TableModel<Service>(services.getList()) {

      @Override
      public Column[] getHeaders() {
        return new Column[]{
          new Column("id", 32, Column.ALIGN_LEFT),
          new Column("type", 10, Column.ALIGN_LEFT),
          new Column("name", 10, Column.ALIGN_LEFT),
          new Column("description", 32, Column.ALIGN_LEFT)
        };
      }

      @Override
      public String[] getRow(Service service) {
        return new String[]{
          service.getId(),
          service.getType(),
          service.getName(),
          service.getDescription()
        };
      }
    });
    System.out.println(t.render());
  }
View Full Code Here

TOP

Related Classes of com.woorea.openstack.console.utils.Table

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.