Package com.woorea.openstack.keystone

Examples of com.woorea.openstack.keystone.Keystone.token()


    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();
View Full Code Here


                ExamplesConfiguration.KEYSTONE_PASSWORD))
        .execute();
    // use the token in the following requests
    keystone.setTokenProvider(new OpenStackSimpleTokenProvider(access
        .getToken().getId()));
    keystone.token(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
View Full Code Here

        .authenticate()
        .withUsernamePassword(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD)
        .execute();

    // use the token in the following requests
    keystone.token(access.getToken().getId());

    Tenants tenants = keystone.tenants().list().execute();

    // try to exchange token using the first tenant
    if (tenants.getList().size() > 0) {
View Full Code Here

   
    Keystone keystone = new Keystone(ExamplesConfiguration.KEYSTONE_AUTH_URL);
    Access access = keystone.tokens().authenticate(new UsernamePassword(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD)).execute();
   
    //use the token in the following requests
    keystone.token(access.getToken().getId());
   
    Tenants tenants = keystone.tenants().list().execute();
   
    //try to exchange token using the first tenant
    if(tenants.getList().size() > 0) {
View Full Code Here

    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());
  }
}
View Full Code Here

    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);
 
View Full Code Here

    Access access = keystone.tokens().authenticate(
        new UsernamePassword(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD))
        .execute();
   
    //use the token in the following requests
    keystone.token(access.getToken().getId());
   
    Tenants tenants = keystone.tenants().list().execute();
   
    //try to exchange token using the first tenant
    if(tenants.getList().size() > 0) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.