Package org.openstack4j.openstack.client
Class OSClientBuilder.ClientV2
- java.lang.Object
-
- org.openstack4j.openstack.client.OSClientBuilder<OSClient.OSClientV2,IOSClientBuilder.V2>
-
- org.openstack4j.openstack.client.OSClientBuilder.ClientV2
-
- All Implemented Interfaces:
IOSClientBuilder<OSClient.OSClientV2,IOSClientBuilder.V2>
,IOSClientBuilder.V2
- Enclosing class:
- OSClientBuilder<R,T extends IOSClientBuilder<R,T>>
public static class OSClientBuilder.ClientV2 extends OSClientBuilder<OSClient.OSClientV2,IOSClientBuilder.V2> implements IOSClientBuilder.V2
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openstack4j.openstack.client.OSClientBuilder
OSClientBuilder.ClientV2, OSClientBuilder.ClientV3
-
Nested classes/interfaces inherited from interface org.openstack4j.api.client.IOSClientBuilder
IOSClientBuilder.V2, IOSClientBuilder.V3
-
-
Constructor Summary
Constructors Constructor Description ClientV2()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OSClient.OSClientV2
authenticate()
Attempts to connect, authenticated and obtain an authorization access entity which contains a token, service catalog and endpoints from the controller.OSClientBuilder.ClientV2
raxApiKey(boolean raxApiKey)
Use Rackspace API Key Authentication Admin Extension to authenticateOSClientBuilder.ClientV2
tenantId(String tenantId)
The tenant/project to authenticate as (some clouds such as HP use tenantId vs tenantName)OSClientBuilder.ClientV2
tenantName(String tenantName)
The tenant/project to authenticate asOSClientBuilder.ClientV2
token(String tokenId)
Allows authentication via an existing Token versusIOSClientBuilder.credentials(String, String)
.-
Methods inherited from class org.openstack4j.openstack.client.OSClientBuilder
credentials, endpoint, perspective, provider, useNonStrictSSLClient, withConfig
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openstack4j.api.client.IOSClientBuilder
credentials, endpoint, perspective, provider, useNonStrictSSLClient, withConfig
-
-
-
-
Method Detail
-
tenantName
public OSClientBuilder.ClientV2 tenantName(String tenantName)
Description copied from interface:IOSClientBuilder.V2
The tenant/project to authenticate as- Specified by:
tenantName
in interfaceIOSClientBuilder.V2
- Parameters:
tenantName
- the tenant/project name- Returns:
- self for method chaining
-
tenantId
public OSClientBuilder.ClientV2 tenantId(String tenantId)
Description copied from interface:IOSClientBuilder.V2
The tenant/project to authenticate as (some clouds such as HP use tenantId vs tenantName)- Specified by:
tenantId
in interfaceIOSClientBuilder.V2
- Parameters:
tenantId
- the tenant/project id- Returns:
- self for method chaining
-
raxApiKey
public OSClientBuilder.ClientV2 raxApiKey(boolean raxApiKey)
Description copied from interface:IOSClientBuilder.V2
Use Rackspace API Key Authentication Admin Extension to authenticate- Specified by:
raxApiKey
in interfaceIOSClientBuilder.V2
- Parameters:
raxApiKey
- true if enabled- Returns:
- self for method chaining
-
authenticate
public OSClient.OSClientV2 authenticate() throws AuthenticationException
Description copied from interface:IOSClientBuilder
Attempts to connect, authenticated and obtain an authorization access entity which contains a token, service catalog and endpoints from the controller. As a result a client will be returned encapsulating the authorized access and corresponding API access- Specified by:
authenticate
in interfaceIOSClientBuilder<OSClient.OSClientV2,IOSClientBuilder.V2>
- Returns:
- the authenticated client
- Throws:
AuthenticationException
- if the credentials or default tenant is invalid
-
token
public OSClientBuilder.ClientV2 token(String tokenId)
Description copied from interface:IOSClientBuilder.V2
Allows authentication via an existing Token versusIOSClientBuilder.credentials(String, String)
. Note: TheIOSClientBuilder.V2.tenantId(String)
orIOSClientBuilder.V2.tenantName(String)
will required when using this method for authentication.- Specified by:
token
in interfaceIOSClientBuilder.V2
- Parameters:
tokenId
- the token identifier- Returns:
- self for method chaining
-
-