congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Tenant.getId
Code IndexAdd Tabnine to your IDE (free)

How to use
getId
method
in
com.woorea.openstack.keystone.model.Tenant

Best Java code snippets using com.woorea.openstack.keystone.model.Tenant.getId (Showing top 14 results out of 315)

origin: woorea/openstack-java-sdk

  @Override
  public String[] getRow(Tenant tenant) {
    return new String[]{
      tenant.getId(),
      tenant.getName(),
      tenant.getDescription(),
      tenant.getEnabled().toString()
    };
  }
});
origin: woorea/openstack-java-sdk

  @Override
  public String[] getRow(Tenant tenant) {
    return new String[]{
      tenant.getId(),
      tenant.getName(),
      tenant.getDescription(),
      tenant.getEnabled().toString()
    };
  }
});
origin: woorea/openstack-java-sdk

public static void main(String[] args) {
  Keystone client = new Keystone(KEYSTONE_ENDPOINT);
  client.setTokenProvider(new OpenStackSimpleTokenProvider("secret0"));
  client.tenants().delete("36c481aec1d54fc49190c92c3ef6840a").execute();
  Tenant tenant = client.tenants().create(new Tenant("new_api")).execute();
  System.out.println(tenant);
  System.out.println(client.tenants().list().execute());
  client.tenants().delete(tenant.getId()).execute();
}

origin: com.att.cdp/cdp-pal-openstack

  /**
   * Create the Tenant object implementation for the OpenStack provider
   * 
   * @param context
   *            The OpenStack context we are servicing
   * @param tenant
   *            The OpenStack tenant definition
   */
  public OpenStackTenant(OpenStackContext context, com.woorea.openstack.keystone.model.Tenant tenant) {
    super(context);
    setId(tenant.getId());
    setName(tenant.getName());
    setDescription(tenant.getDescription());
    setEnabled(tenant.getEnabled());

    Properties properties = context.getProperties();
    setName(properties.getProperty(ContextFactory.PROPERTY_TENANT));
  }
}
origin: com.att.cdp/cdp-pal-openstack

/**
 * Creates the super class from the specified context object. This is then used to obtain the Access object.
 * 
 * @param context
 *            The OpenStackCOntext object to obtain the Access object
 */
public Connector(OpenStackContext context) {
  /*
   * Allow the specification of a client connector to override the default mechanism of the service
   * loader. This is needed to support use within an OSGi container.
   */
  clientConnector = context.getClientConnector();
  configuration = ConfigurationFactory.getConfiguration();
  logger = configuration.getApplicationLogger();
  identity = (CommonIdentityService) context.getIdentityService();
  access = identity.getAccess();
  access.getToken().getTenant().getId();
}
origin: woorea/openstack-java-sdk

    .withTenantId(tenants.getList().get(0).getId())
    .execute();
Nova novaClient = new Nova(ExamplesConfiguration.NOVA_ENDPOINT.concat("/").concat(tenants.getList().get(0).getId()));
novaClient.token(access.getToken().getId());
origin: woorea/openstack-java-sdk

access = keystone.tokens().authenticate(new TokenAuthentication(access.getToken().getId())).withTenantId(tenants.getList().get(0).getId()).execute();
Nova novaClient = new Nova(ExamplesConfiguration.NOVA_ENDPOINT.concat("/").concat(tenants.getList().get(0).getId()));
novaClient.token(access.getToken().getId());
origin: woorea/openstack-java-sdk

/**
 * @param args
 */
public static void main(String[] args) {
  Keystone keystone = new Keystone(ExamplesConfiguration.KEYSTONE_AUTH_URL);
  Access access = keystone.tokens().authenticate(new UsernamePassword(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD))
      .withTenantName("demo")
      .execute();
  
  //use the token in the following requests
  keystone.token(access.getToken().getId());
    
  //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);
  }
  
}
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: woorea/openstack-java-sdk

  .withTenantId(tenants.getList().get(0).getId()).execute();
  .getList().get(0).getId()));
nova.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken()
  .getId()));
origin: woorea/openstack-java-sdk

  /**
   * @param args
   */
  public static void main(String[] args) {
    Keystone keystone = new Keystone(ExamplesConfiguration.KEYSTONE_AUTH_URL);
    // access with unscoped token
    Access access = keystone.tokens().authenticate(
        new UsernamePassword(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD))
        .execute();
    // use the token in the following requests
    keystone.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId()));

    Tenants tenants = keystone.tenants().list().execute();
    // try to exchange token using the first tenant
    if (tenants.getList().size() > 0) {
      // access with tenant
      access = keystone.tokens().authenticate(new TokenAuthentication(access.getToken().getId())).withTenantId(tenants.getList().get(0).getId()).execute();

      Quantum quantum = new Quantum(KeystoneUtils.findEndpointURL(access.getServiceCatalog(), "network",	null, "public"));
      quantum.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId()));

      Networks networks = quantum.networks().list().execute();
      for (Network network : networks) {
        System.out.println(network);
      }
    } else {
      System.out.println("No tenants found!");
    }
  }
}
origin: woorea/openstack-java-sdk

access = keystone.tokens().authenticate(new TokenAuthentication(access.getToken().getId())).withTenantId(tenants.getList().get(0).getId()).execute();
origin: woorea/openstack-java-sdk

  /**
   * @param args
   */
  public static void main(String[] args) {
    Keystone keystone = new Keystone(ExamplesConfiguration.KEYSTONE_AUTH_URL);
    //access with unscoped token
    Access access = keystone.tokens().authenticate(
        new UsernamePassword(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD))
        .execute();

    access = keystone.tokens().authenticate(new TokenAuthentication(access.getToken().getId())).withTenantName("admin").execute();

    Tenant tenant = new Tenant();
    tenant.setName("benn.cs");
    tenant.setDescription("benn.cs");
    tenant.setEnabled(true);
    //Get the adminURL client and use the token got above
    keystone = new Keystone("http://keystone.x.org/v2.0");
    keystone.token(access.getToken().getId());
    tenant = keystone.tenants().create(tenant).execute();
    System.out.println(tenant);
    keystone.tenants().delete(tenant.getId());
  }
}
origin: woorea/openstack-java-sdk

access = keystone.tokens().authenticate(new TokenAuthentication(access.getToken().getId())).withTenantId(tenants.getList().get(0).getId()).execute();
com.woorea.openstack.keystone.modelTenantgetId

Popular methods of Tenant

  • <init>
  • getDescription
  • getEnabled
  • getName
  • setDescription
  • setEnabled
  • setName

Popular in Java

  • Making http requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSystemService (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • Kernel (java.awt.image)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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