Package org.openstack.client.common

Examples of org.openstack.client.common.OpenstackSession


  private OpenstackSession openstackSession = null;

  public OpenstackSession getOpenstackSession() {
    if (openstackSession == null) {
      OpenstackSession session = OpenstackSession.create();

      session.authenticate(credentials, false);

      openstackSession = session;

      ensureContainer();
    }
View Full Code Here


  OpenstackSession session;

  private OpenstackSession getSession() {
    if (this.session == null) {
      OpenstackSession session = OpenstackSession.create();
      session.authenticate(getCredentials(), true);
      this.session = session;
    }
    return this.session;
  }
View Full Code Here

  private static final Logger log = LoggerFactory.getLogger(OpenstackCloudHelpers.class);

  public OpenstackComputeClient buildOpenstackComputeClient(OpenstackCloud cloud) throws OpsException {
    try {
      OpenstackSession session = buildOpenstackSession(cloud);

      return session.getComputeClient();
    } catch (OpenstackException e) {
      throw new OpsException("Error connecting to OpenStack compute API", e);
    }
  }
View Full Code Here

    }
  }

  public OpenstackImageClient buildOpenstackImageClient(OpenstackCloud cloud) throws OpsException {
    try {
      OpenstackSession session = buildOpenstackSession(cloud);

      return session.getImageClient();
    } catch (OpenstackException e) {
      throw new OpsException("Error connecting to OpenStack image API", e);
    }
  }
View Full Code Here

    String username = cloud.username;
    String secret = cloud.password.plaintext();
    String tenant = cloud.tenant;

    OpenstackCredentials credentials = new OpenstackCredentials(authUrl, username, secret, tenant);
    OpenstackSession session = OpenstackSession.create();
    session.authenticate(credentials, true);

    session.enable(OpenstackSession.Feature.VERBOSE);

    return session;
  }
View Full Code Here

TOP

Related Classes of org.openstack.client.common.OpenstackSession

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.