Tabnine Logo
Servers.getList
Code IndexAdd Tabnine to your IDE (free)

How to use
getList
method
in
com.woorea.openstack.nova.model.Servers

Best Java code snippets using com.woorea.openstack.nova.model.Servers.getList (Showing top 9 results out of 315)

origin: woorea/openstack-java-sdk

@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());
}
origin: com.att.cdp/cdp-pal-openstack

for (com.woorea.openstack.nova.model.Server server : servers.getList()) {
  Addresses allocatedAddresses = server.getAddresses();
  Map<String, List<Address>> addressMap = allocatedAddresses.getAddresses();
origin: woorea/openstack-java-sdk

  public static void main(String[] args) throws InterruptedException {
    Keystone keystone = new Keystone(ExamplesConfiguration.KEYSTONE_AUTH_URL);
    Access access = keystone.tokens().authenticate(new UsernamePassword(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD))
        .withTenantName(ExamplesConfiguration.TENANT_NAME)
        .execute();

    //use the token in the following requests
    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();
    }
  }
}
origin: com.att.cdp/cdp-pal-openstack

com.woorea.openstack.nova.model.Servers servers = nova.getClient()
    .servers().list(true).execute();
if (servers != null && servers.getList() != null) {
  for (com.woorea.openstack.nova.model.Server s : servers
      .getList()) {
    list.add(new OpenStackServer(context, s));
origin: com.att.cdp/cdp-pal-openstack

/**
 * @see com.att.cdp.zones.ComputeService#findAllServersUsingKey(java.lang.String)
 */
@SuppressWarnings("nls")
@Override
public List<String> findAllServersUsingKey(String keyPair) throws ZoneException {
  checkArg(keyPair, "keyPair");
  connect();
  trackRequest();
  RequestState.put(RequestState.SERVICE, "Compute");
  RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint());
  RequestState.put(RequestState.KEYPAIR, keyPair);
  List<String> users = new ArrayList<String>();
  try {
    Servers servers = nova.getClient().servers().list(false).execute();
    for (com.woorea.openstack.nova.model.Server server : servers.getList()) {
      if (keyPair.equals(server.getKeyName())) {
        users.add(server.getId());
      }
    }
  } catch (OpenStackBaseException ex) {
    ExceptionMapper.mapException(ex);
  }
  return users;
}
origin: com.att.cdp/cdp-pal-openstack

try {
  com.woorea.openstack.nova.model.Servers servers = nova.getClient().servers().list(true).execute();
  for (com.woorea.openstack.nova.model.Server s : servers.getList()) {
    if (name != null) {
      if (s.getName().matches(name)) {
origin: com.att.cdp/cdp-pal-openstack

try {
  com.woorea.openstack.nova.model.Servers servers = nova.getClient().servers().list(true).execute();
  for (com.woorea.openstack.nova.model.Server s : servers.getList()) {
    list.add(new OpenStackServer(context, s));
origin: com.att.cdp/cdp-pal-openstack

com.woorea.openstack.nova.model.Servers servers = nova.getClient()
    .servers().list(true).execute();
for (com.woorea.openstack.nova.model.Server s : servers.getList()) {
  if (name != null) {
    if (s.getName().matches(name)) {
origin: com.att.cdp/cdp-pal-openstack

/**
 * @see com.att.cdp.zones.ComputeService#findAllServersUsingKey(java.lang.String)
 */
@SuppressWarnings("nls")
@Override
public List<String> findAllServersUsingKey(String keyPair)
    throws ZoneException {
  checkArg(keyPair, "keyPair");
  connect();
  Context context = getContext();
  trackRequest();
  RequestState.put(RequestState.KEYPAIR, keyPair);
  RequestState.put(RequestState.SERVICE, "Compute");
  RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint());
  List<String> users = new ArrayList<>();
  try {
    Servers servers = nova.getClient().servers().list(false).execute();
    for (com.woorea.openstack.nova.model.Server server : servers
        .getList()) {
      if (keyPair.equals(server.getKeyName())) {
        users.add(server.getId());
      }
    }
  } catch (OpenStackBaseException ex) {
    ExceptionMapper.mapException(ex);
  }
  return users;
}
com.woorea.openstack.nova.modelServersgetList

Popular methods of Servers

    Popular in Java

    • Updating database using SQL prepared statement
    • getSystemService (Context)
    • getOriginalFilename (MultipartFile)
      Return the original filename in the client's filesystem.This may contain path information depending
    • findViewById (Activity)
    • Menu (java.awt)
    • InputStream (java.io)
      A readable source of bytes.Most clients will use input streams that read data from the file system (
    • Thread (java.lang)
      A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
    • BigDecimal (java.math)
      An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
    • Selector (java.nio.channels)
      A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
    • TimerTask (java.util)
      The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
    • Github Copilot alternatives
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Tabnine for your IDE now