public void token(String token) { setTokenProvider(new OpenStackSimpleTokenProvider(token)); }
public void token(String token) { setTokenProvider(new OpenStackSimpleTokenProvider(token)); }
public void token(String token) { setTokenProvider(new OpenStackSimpleTokenProvider(token)); }
public void token(String token) { setTokenProvider(new OpenStackSimpleTokenProvider(token)); }
public void token(String token) { setTokenProvider(new OpenStackSimpleTokenProvider(token)); }
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(); }
@Override public void execute(Console console, CommandLine args) { if(args.getArgs().length == 1) { Keystone keystone = new Keystone((String) console.getProperty("keystone.endpoint")); Access access = keystone.tokens().authenticate( new UsernamePassword( console.getProperty("keystone.username"), console.getProperty("keystone.password") ) ) .withTenantName(console.getProperty("keystone.tenant_name")) .execute(); System.out.println(console.getProperty("nova.endpoint")); Nova client = new Nova(console.getProperty("nova.endpoint")+args.getArgs()[0]); client.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId())); NovaEnvironment environment = new NovaEnvironment(console.getEnvironment(), client); environment.register(new NovaServerList()); console.setEnvironment(environment); } }
/** * @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!"); } } }
.execute(); keystone.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId())); quantumClient.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId()));
context.setTenant(tenant); tokenProvider = new OpenStackSimpleTokenProvider(access.getToken().getId()); getKeystone().setTokenProvider(tokenProvider);
ceilometer.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId()));
nova.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken() .getId()));
keystone.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId())); swift.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId()));
/** * @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)) .withTenantName("admin") .execute(); User user = new User(); user.setEmail("luis@woorea.es"); user.setUsername("luis.gervaso"); user.setPassword("password.0"); user.setName("Luis"); user.setEnabled(Boolean.TRUE); keystone = new Keystone("http://keystone.x.org/v2.0"); keystone.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId())); //keystone.enableLogging(Logger.getLogger("keystone"), 10000); user = keystone.users().create(user).execute(); System.out.println(user); keystone.users().delete(user.getId()).execute(); } }
.execute(); keystone.setTokenProvider(new OpenStackSimpleTokenProvider(access .getToken().getId())); keystone.token(access.getToken().getId()); Quantum quantum = new Quantum(KeystoneUtils.findEndpointURL( access.getServiceCatalog(), "network", null, "public")); quantum.setTokenProvider(new OpenStackSimpleTokenProvider(access .getToken().getId())); NetworkForCreate netcreate = new NetworkForCreate();
@Override public void execute(Console console, CommandLine args) { Keystone client = new Keystone(console.getProperty("keystone.endpoint")); Access access = client.tokens() .authenticate(new UsernamePassword( console.getProperty("keystone.username"), console.getProperty("keystone.password") )) .withTenantName(console.getProperty("keystone.tenant_name")) .execute(); client.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId())); KeystoneEnvironment environment = new KeystoneEnvironment(console.getEnvironment(), client); environment.register(new KeystoneTenantList()); environment.register(new KeystoneTenantCreate()); environment.register(new KeystoneTenantDelete()); environment.register(new KeystoneUserList()); environment.register(new KeystoneUserCreate()); environment.register(new KeystoneUserDelete()); environment.register(new KeystoneRoleList()); environment.register(new KeystoneRoleDelete()); environment.register(new KeystoneServiceList()); console.setEnvironment(environment); }