public class JaxrsComputeCloudClient extends Object implements ComputeCloudClient
Constructor and Description |
---|
JaxrsComputeCloudClient(URI apiEndpoint,
ComputeCloudUser user,
String password,
javax.ws.rs.client.Client client) |
Modifier and Type | Method and Description |
---|---|
void |
authenticate()
Authenticates the client and stores an authentication token to allow
other methods to be called.
|
void |
close()
Closes the client connection.
|
void |
createInstanceOrchestration(String name,
ComputeCloudInstanceOrchestrationConfig params)
Creates an orchestration with the specified name that contains a
launchplan for an instance with the specified configuration.
|
void |
deleteOrchestration(String name)
Deletes an orchestration with the specified name.
|
Collection<ImageListEntry> |
getImageListEntries(String imageListName)
Retrieves imagelist entries for a specified imagelist
|
Collection<ImageList> |
getImageLists(ImageListSourceType sourceType)
Retrieve the list of imagelist according to source type
|
InstanceOrchestration |
getInstanceOrchestration(String name)
Gets a subset of properties from an instance orchestration created from
ComputeCloudClient.createInstanceOrchestration(java.lang.String, com.oracle.cloud.compute.jenkins.client.ComputeCloudInstanceOrchestrationConfig) |
Collection<SecurityList> |
getSecurityLists()
Retrieves the security lists
|
Collection<Shape> |
getShapes()
Retrieves the CPU and memory details of all the available shapes.
|
SSHKey |
getSSHKey(String name)
Retrieves an SSH key of the current user.
|
Collection<SSHKey> |
getSSHKeys()
Retrieves the SSH keys of the current user.
|
void |
startOrchestration(String name)
Starts an orchestration with the specified name.
|
void |
stopOrchestration(String name)
Stops an orchestration with the specified name.
|
String |
toString() |
public JaxrsComputeCloudClient(URI apiEndpoint, ComputeCloudUser user, String password, javax.ws.rs.client.Client client)
public void close()
ComputeCloudClient
close
in interface ComputeCloudClient
close
in interface AutoCloseable
public void authenticate() throws ComputeCloudClientException
ComputeCloudClient
authenticate
in interface ComputeCloudClient
ComputeCloudClientUnauthorizedException
- if authentication failedComputeCloudClientException
- if an error occurs communicating with
the endpoint serverpublic Collection<Shape> getShapes() throws ComputeCloudClientException
ComputeCloudClient
getShapes
in interface ComputeCloudClient
Shape
objectsComputeCloudClientUnauthorizedException
- if the authentication
token has timed out or the user is not authorizedComputeCloudClientException
- if an error occurs communicating with
the endpoint serverpublic Collection<SecurityList> getSecurityLists() throws ComputeCloudClientException
ComputeCloudClient
getSecurityLists
in interface ComputeCloudClient
SecurityList
ComputeCloudClientUnauthorizedException
- if the authentication
token has timed out or the user is not authorizedComputeCloudClientException
- if an error occurs communicating with
the endpoint serverpublic Collection<SSHKey> getSSHKeys() throws ComputeCloudClientException
ComputeCloudClient
getSSHKeys
in interface ComputeCloudClient
SSHKey
ComputeCloudClientUnauthorizedException
- if the authentication
token has timed out or the user is not authorizedComputeCloudClientException
- if an error occurs communicating with
the endpoint serverpublic SSHKey getSSHKey(String name) throws ComputeCloudClientException
ComputeCloudClient
getSSHKey
in interface ComputeCloudClient
name
- of SSH keyComputeCloudClientUnauthorizedException
- if the authentication
token has timed out or the user is not authorizedComputeCloudClientException
- if an error occurs communicating with
the endpoint serverpublic Collection<ImageList> getImageLists(ImageListSourceType sourceType) throws ComputeCloudClientException
ComputeCloudClient
getImageLists
in interface ComputeCloudClient
ImageList
ComputeCloudClientException
- if an error occurs communicating with
the endpoint serverpublic Collection<ImageListEntry> getImageListEntries(String imageListName) throws ComputeCloudClientException
ComputeCloudClient
getImageListEntries
in interface ComputeCloudClient
imageListName
- ImageList name which used to get related versionsImageListEntry
ComputeCloudClientException
- if an error occurs communicating with
the endpoint serverpublic void createInstanceOrchestration(String name, ComputeCloudInstanceOrchestrationConfig params) throws ComputeCloudClientException
ComputeCloudClient
createInstanceOrchestration
in interface ComputeCloudClient
name
- the orchestration nameparams
- the instance configurationComputeCloudClientUnauthorizedException
- if the authentication
token has timed out or the user is not authorizedComputeCloudClientException
- if an error occurs communicating with
the endpoint serverpublic InstanceOrchestration getInstanceOrchestration(String name) throws ComputeCloudClientException
ComputeCloudClient
ComputeCloudClient.createInstanceOrchestration(java.lang.String, com.oracle.cloud.compute.jenkins.client.ComputeCloudInstanceOrchestrationConfig)
getInstanceOrchestration
in interface ComputeCloudClient
name
- the orchestration nameInstanceOrchestration
instance with the specified nameComputeCloudClientUnauthorizedException
- if the authentication
token has timed out or the user is not authorizedComputeCloudClientException
- if an error occurs communicating with
the endpoint serverpublic void startOrchestration(String name) throws ComputeCloudClientException
ComputeCloudClient
startOrchestration
in interface ComputeCloudClient
name
- the orchestration nameComputeCloudClientUnauthorizedException
- if the authentication
token has timed out or the user is not authorizedComputeCloudClientException
- if an error occurs communicating with
the endpoint serverpublic void stopOrchestration(String name) throws ComputeCloudClientException
ComputeCloudClient
stopOrchestration
in interface ComputeCloudClient
name
- the orchestration nameComputeCloudClientUnauthorizedException
- if the authentication
token has timed out or the user is not authorizedComputeCloudClientException
- if an error occurs communicating with
the endpoint serverpublic void deleteOrchestration(String name) throws ComputeCloudClientException
ComputeCloudClient
deleteOrchestration
in interface ComputeCloudClient
name
- the orchestration nameComputeCloudClientUnauthorizedException
- if the authentication
token has timed out or the user is not authorizedComputeCloudClientException
- if an error occurs communicating with
the endpoint serverCopyright © 2016–2018. All rights reserved.