Search in sources :

Example 1 with OpenstackSession

use of org.openstack.client.common.OpenstackSession in project platformlayer by platformlayer.

the class OpenstackCloudHelpers method buildOpenstackSession.

private OpenstackSession buildOpenstackSession(OpenstackCloud cloud) throws OpsException {
    String authUrl = cloud.endpoint;
    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;
}
Also used : OpenstackSession(org.openstack.client.common.OpenstackSession) OpenstackCredentials(org.openstack.client.OpenstackCredentials)

Example 2 with OpenstackSession

use of org.openstack.client.common.OpenstackSession in project platformlayer by platformlayer.

the class OpenstackCasStore method getSession.

private OpenstackSession getSession() {
    if (this.session == null) {
        OpenstackSession session = OpenstackSession.create();
        session.authenticate(getCredentials(), true);
        this.session = session;
    }
    return this.session;
}
Also used : OpenstackSession(org.openstack.client.common.OpenstackSession)

Example 3 with OpenstackSession

use of org.openstack.client.common.OpenstackSession in project platformlayer by platformlayer.

the class OpenstackBackupContext method getOpenstackSession.

public OpenstackSession getOpenstackSession() {
    if (openstackSession == null) {
        OpenstackSession session = OpenstackSession.create();
        session.authenticate(credentials, false);
        openstackSession = session;
        ensureContainer();
    }
    return openstackSession;
}
Also used : OpenstackSession(org.openstack.client.common.OpenstackSession)

Aggregations

OpenstackSession (org.openstack.client.common.OpenstackSession)3 OpenstackCredentials (org.openstack.client.OpenstackCredentials)1