Examples of Access


Examples of com.woorea.openstack.keystone.model.Access

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

Examples of com.woorea.openstack.keystone.model.Access

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

Examples of com.woorea.openstack.keystone.model.Access

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

Examples of com.woorea.openstack.keystone.model.Access

  /**
   * @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))
        .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) {
     
      access = keystone.tokens().authenticate(new TokenAuthentication(access.getToken().getId())).withTenantId(tenants.getList().get(0).getId()).execute();
     
      //NovaClient novaClient = new NovaClient(KeystoneUtils.findEndpointURL(access.getServiceCatalog(), "compute", null, "public"), access.getToken().getId());
      Nova novaClient = new Nova(ExamplesConfiguration.NOVA_ENDPOINT.concat("/").concat(tenants.getList().get(0).getId()));
      novaClient.token(access.getToken().getId());
      //novaClient.enableLogging(Logger.getLogger("nova"), 100 * 1024);
     
      Flavors flavors = novaClient.flavors().list(true).execute();
      for(Flavor flavor : flavors) {
        System.out.println(flavor);
View Full Code Here

Examples of com.woorea.openstack.keystone.model.Access

                ExamplesConfiguration.KEYSTONE_ENDPOINT,
                ExamplesConfiguration.KEYSTONE_USERNAME,
                ExamplesConfiguration.KEYSTONE_PASSWORD
        );

        Access access = keystone.getAccessByTenant(ExamplesConfiguration.TENANT_NAME);

        String endpointURL = KeystoneUtils.findEndpointURL(access.getServiceCatalog(), "orchestration", null, "public");


        Heat heat = new Heat(endpointURL);
        heat.setTokenProvider(keystone
                .getProviderByTenant(ExamplesConfiguration.TENANT_NAME));
View Full Code Here

Examples of com.woorea.openstack.keystone.model.Access

    KeystoneTokenProvider keystone = new KeystoneTokenProvider(
        ExamplesConfiguration.KEYSTONE_AUTH_URL,
        ExamplesConfiguration.KEYSTONE_USERNAME,
        ExamplesConfiguration.KEYSTONE_PASSWORD);

    Access access = keystone.getAccessByTenant(ExamplesConfiguration.TENANT_NAME);

    Service glanceService = null;

    for (Service service : access.getServiceCatalog()) {
      if (service.getType().equals("image")) {
        glanceService = service;
        break;
      }
    }
View Full Code Here

Examples of com.woorea.openstack.keystone.model.Access

   */
  public static void main(String[] args) {
    Keystone keystone = new Keystone(KEYSTONE_AUTH_URL);

    // access with unscoped token
    Access access = keystone
        .tokens()
        .authenticate()
        .withUsernamePassword(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD)
        .execute();

View Full Code Here

Examples of io.fathom.cloud.identity.api.os.model.v2.Access

            throw new WebApplicationException(Status.UNAUTHORIZED);
        }

        V2AuthResponse response = new V2AuthResponse();

        Access access = response.access = new Access();
        V2Token token = access.token = new V2Token();

        ProjectData project = authentication.getProject();

        // We never pass domain; we can't build a domain token with V2
View Full Code Here

Examples of javax.persistence.Access

     * as a field during some other owning entity.
     *
     * @see ValueMetaData#addEmbeddedMetaData()
     */
    private int determineExplicitAccessType(Class<?> cls) {
        Access access = cls.getAnnotation(Access.class);
        return access == null ? AccessCode.UNKNOWN : ((access.value() ==
            AccessType.FIELD ? AccessCode.FIELD : AccessCode.PROPERTY) |
            AccessCode.EXPLICIT);
    }
View Full Code Here

Examples of javax.persistence.Access

     *         type matches the expected type
     */
    private boolean isAnnotatedAccess(Member member, AccessType type) {
      if (member == null)
        return false;
        Access anno =
            AccessController.doPrivileged(J2DoPrivHelper
                .getAnnotationAction((AnnotatedElement)member,
                Access.class));
        return anno != null && anno.value() == type;
    }   
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.