public class ServerServiceImpl extends BaseComputeServices implements ServerService
BaseOpenStackService.Invocation<R>| Constructor and Description |
|---|
ServerServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
ActionResponse |
action(String serverId,
Action action)
Executes the specified Action such as RESUME, PAUSE, START, STOP ...
|
ActionResponse |
addSecurityGroup(String serverId,
String secGroupName)
Associates the specified Server Group by name to the Server by it's identifier
|
VolumeAttachment |
attachVolume(String serverId,
String volumeId,
String device)
attach the volume to the given server
|
ActionResponse |
backupServer(String serverId,
BackupOptions options)
{
#invokeAction(String, String) |
Server |
boot(ServerCreate server)
Create (boot) a new Server
|
Server |
bootAndWaitActive(ServerCreate server,
int maxWaitTime)
Create (boot) a new Server
|
ActionResponse |
changeAdminPassword(String serverId,
String adminPassword)
Changes the admin/root password on the server
|
ActionResponse |
confirmResize(String serverId)
Confirm that the resize worked, thus removing the original server
|
String |
createSnapshot(String serverId,
String snapshotName)
Creates the snapshot for a Server
|
ActionResponse |
delete(String serverId)
Delete (i.e shut down and delete the image) of the server
|
ActionResponse |
deleteMetadataItem(String serverId,
String key)
Removes the specified metadata item via the specified
key and serverId |
ActionResponse |
detachVolume(String serverId,
String attachmentId)
detach the volume to the given server
|
Map<String,? extends Number> |
diagnostics(String serverId)
Gets usage information about the server.
|
ServerPassword |
evacuate(String serverId,
EvacuateOptions options)
Evacuates a server identified with
serverId from a failed host to a new host |
Server |
get(String serverId)
Get the specified server by ID
|
String |
getConsoleOutput(String serverId,
int numLines)
Will attempt to tail and return the last
numLines from the given servers console. |
Map<String,String> |
getMetadata(String serverId)
Returns the metadata for the specified server
|
ServerPassword |
getPassword(String serverId)
Returns the encrypted password for the specified server which can be decrypted with
the private key
|
VNCConsole |
getVNCConsole(String serverId,
VNCConsole.Type type)
Obtains the VNC Console connection information for the given server and VNC Console Type
|
InstanceActionsService |
instanceActions()
The instance actions service extension (os-instance-actions)
|
InterfaceService |
interfaces()
The interface attachment service extension (os-interface)
|
List<? extends Server> |
list()
List all servers (detailed) that the current tenant has access to
|
List<? extends Server> |
list(boolean detail)
List all servers (detailed / brief) that the current tenant has access to
|
List<? extends Server> |
list(Map<String,String> filteringParams)
Returns list of servers filtered by parameters.
|
List<? extends Server> |
listAll(boolean detail)
List all servers for all tenants (detailed / brief)
|
ActionResponse |
liveMigrate(String serverId,
LiveMigrateOptions options)
Live-migrates a server identified with
serverId to a new host without rebooting |
ActionResponse |
migrateServer(String serverId)
Only user with admin role can do this.
|
ActionResponse |
reboot(String serverId,
RebootType type)
Reboot a server by SOFT (software-level) or HARD (hardware power cycle)
|
ActionResponse |
rebuild(String serverId,
RebuildOptions options)
Rebuilds the specified server
|
ActionResponse |
removeSecurityGroup(String serverId,
String secGroupName)
Removes the specified Server Group by name from the Server by it's identifier
|
ActionResponse |
resetState(String serverId,
Server.Status state)
Resets the state of a server to a specified
state |
ActionResponse |
resize(String serverId,
String flavorId)
Resize a server's resources.
|
ActionResponse |
revertResize(String serverId)
Revert a previous resize, switching back to the old server
|
ServerCreateBuilder |
serverBuilder() |
Server |
update(String serverId,
ServerUpdateOptions options)
Updates an existing Server instance
|
Map<String,String> |
updateMetadata(String serverId,
Map<String,String> metadata)
Creates or replaces metadata items for the specified server
|
Server |
waitForServerStatus(String serverId,
Server.Status status,
int maxWait,
TimeUnit maxWaitUnit)
Will poll the Server waiting for the
Status to match or an Error state occurs for the maxWait |
invokeAction, invokeActionWithResponsedelete, deleteWithResponse, get, getProvider, getServiceVersion, getXOpenstackRequestId, head, patch, patchWithResponse, post, postWithResponse, put, request, toList, uripublic List<? extends Server> list()
list in interface ServerServicepublic List<? extends Server> list(boolean detail)
list in interface ServerServicedetail - if true all attributes will be populated, false (brief) will be ID, Name and Linkspublic List<? extends Server> listAll(boolean detail)
listAll in interface ServerServicedetail - if true all attributes will be populated, false (brief) will be ID, Name and Linkspublic List<? extends Server> list(Map<String,String> filteringParams)
list in interface ServerServicefilteringParams - map (name, value) of filtering parameterspublic Server get(String serverId)
get in interface ServerServiceserverId - the server idpublic Server boot(ServerCreate server)
boot in interface ServerServiceserver - the server to bootpublic Server bootAndWaitActive(ServerCreate server, int maxWaitTime)
bootAndWaitActive in interface ServerServiceserver - the server to bootmaxWaitTime - the max time to wait in milliseconds for the server to become ACTIVEpublic ActionResponse delete(String serverId)
delete in interface ServerServiceserverId - the server identifierpublic ActionResponse action(String serverId, Action action)
Action for
all possible actionsaction in interface ServerServiceserverId - the server identifier to execute the action againstaction - the action the specified actionpublic String createSnapshot(String serverId, String snapshotName)
createSnapshot in interface ServerServiceserverId - the server idsnapshotName - the snapshot namepublic ActionResponse reboot(String serverId, RebootType type)
reboot in interface ServerServiceserverId - the server idtype - the type of rebootpublic ActionResponse rebuild(String serverId, RebuildOptions options)
rebuild in interface ServerServiceserverId - the server idoptions - additional options used during the rebuild. (OPTIONAL, can be null)public ActionResponse resize(String serverId, String flavorId)
ServerService.confirmResize(String), the old server
will be kept around and you'll be able to roll back to the old flavor quick with ServerService.revertResize(String). All resizes
will be automatically confirmed after 24 hours.resize in interface ServerServiceserverId - the server identifierflavorId - the new flavor id to resize topublic ActionResponse addSecurityGroup(String serverId, String secGroupName)
addSecurityGroup in interface ServerServiceserverId - the server identifiersecGroupName - the security group namepublic ActionResponse removeSecurityGroup(String serverId, String secGroupName)
removeSecurityGroup in interface ServerServiceserverId - the server identifiersecGroupName - the security group namepublic ActionResponse confirmResize(String serverId)
confirmResize in interface ServerServiceserverId - the server identifierpublic ActionResponse revertResize(String serverId)
revertResize in interface ServerServiceserverId - the server identifierpublic String getConsoleOutput(String serverId, int numLines)
numLines from the given servers console.getConsoleOutput in interface ServerServiceserverId - the server identifiernumLines - the number of console lines to return.
If lower or equal than zero, the whole console content will be returned.public VNCConsole getVNCConsole(String serverId, VNCConsole.Type type)
getVNCConsole in interface ServerServiceserverId - the server identifiertype - the VNC Console typepublic Map<String,? extends Number> diagnostics(String serverId)
diagnostics in interface ServerServiceserverId - the server idpublic ServerCreateBuilder serverBuilder()
serverBuilder in interface ServerServicepublic VolumeAttachment attachVolume(String serverId, String volumeId, String device)
attachVolume in interface ServerServiceserverId - the server identifiervolumeId - the volume identifierdevice - the device to attach the volume to, ex /dev/vdapublic ActionResponse detachVolume(String serverId, String attachmentId)
detachVolume in interface ServerServiceserverId - the server identifierattachmentId - the attachment identifierpublic ActionResponse migrateServer(String serverId)
ServerService.confirmResize(String), the old server
will be kept around and you'll be able to roll back to the old host quick with ServerService.revertResize(String). All resizes
will be automatically confirmed after 24 hours.migrateServer in interface ServerServiceserverId - the server identifierpublic ActionResponse liveMigrate(String serverId, LiveMigrateOptions options)
serverId to a new host without rebootingliveMigrate in interface ServerServiceserverId - the server identifieroptions - live migration optionspublic ActionResponse resetState(String serverId, Server.Status state)
stateresetState in interface ServerServiceserverId - the server identifierstate - the new server statepublic ActionResponse backupServer(String serverId, BackupOptions options)
#invokeAction(String, String)backupServer in interface ServerServiceserverId - the server identifieroptions - the backup optionspublic ActionResponse changeAdminPassword(String serverId, String adminPassword)
changeAdminPassword in interface ServerServiceserverId - the server identifieradminPassword - the new passwordpublic Server waitForServerStatus(String serverId, Server.Status status, int maxWait, TimeUnit maxWaitUnit)
Status to match or an Error state occurs for the maxWaitwaitForServerStatus in interface ServerServiceserverId - the server identifierstatus - the status to wait formaxWait - the max wait timemaxWaitUnit - the unit the max wait time was specified inpublic Map<String,String> getMetadata(String serverId)
getMetadata in interface ServerServiceserverId - the server identifierpublic Map<String,String> updateMetadata(String serverId, Map<String,String> metadata)
updateMetadata in interface ServerServiceserverId - the server identifiermetadata - the metadata to create or updatepublic ActionResponse deleteMetadataItem(String serverId, String key)
key and serverIddeleteMetadataItem in interface ServerServiceserverId - the server identifierkey - the metadata key to removepublic Server update(String serverId, ServerUpdateOptions options)
ServerServiceupdate in interface ServerServiceserverId - the server identifieroptions - the options used to updatepublic InterfaceService interfaces()
ServerServiceinterfaces in interface ServerServicepublic InstanceActionsService instanceActions()
ServerServiceinstanceActions in interface ServerServicepublic ServerPassword getPassword(String serverId)
getPassword in interface ServerServiceserverId - the server identifierpublic ServerPassword evacuate(String serverId, EvacuateOptions options)
serverId from a failed host to a new hostevacuate in interface ServerServiceserverId - the server identifieroptions - evaucate optionsCopyright © 2017. All rights reserved.