Package com.woorea.openstack.keystone.utils

Examples of com.woorea.openstack.keystone.utils.KeystoneTokenProvider


    /**
     * @param args
     */
    public static void main(String[] args) throws InterruptedException {
        KeystoneTokenProvider keystone = new KeystoneTokenProvider(
                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));

        CreateStackParam param = new CreateStackParam();
        param.setStackName("helloWorld");
        param.setTimeoutMinutes(1);
View Full Code Here


  /**
   * @param args
   */
  public static void main(String[] args) {
    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;
      }
    }

    if (glanceService == null) {
      throw new RuntimeException("Glance service not found");
    }

    for (Endpoint endpoint : glanceService.getEndpoints()) {
      Glance glance = new Glance(endpoint.getPublicURL() + "/v1");
      glance.setTokenProvider(keystone
          .getProviderByTenant(ExamplesConfiguration.TENANT_NAME));

      // Creating a new image
      Image newImage = new Image();
      newImage.setDiskFormat("raw");
View Full Code Here

TOP

Related Classes of com.woorea.openstack.keystone.utils.KeystoneTokenProvider

Copyright © 2018 www.massapicom. 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.