public interface ServerService
| 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)
Sets up a new backup schedule service for the given
serverId |
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 |
List<? extends Server> list()
List<? extends Server> list(boolean detail)
detail - if true all attributes will be populated, false (brief) will be ID, Name and LinksList<? extends Server> list(Map<String,String> filteringParams)
filteringParams - map (name, value) of filtering parametersList<? extends Server> listAll(boolean detail)
detail - if true all attributes will be populated, false (brief) will be ID, Name and LinksServer get(String serverId)
serverId - the server idServer boot(ServerCreate server)
server - the server to bootServer bootAndWaitActive(ServerCreate server, int maxWaitTime)
server - the server to bootmaxWaitTime - the max time to wait in milliseconds for the server to become ACTIVEActionResponse delete(String serverId)
serverId - the server identifierActionResponse action(String serverId, Action action)
Action for
all possible actionsserverId - the server identifier to execute the action againstaction - the action the specified actionActionResponse reboot(String serverId, RebootType type)
serverId - the server idtype - the type of rebootActionResponse rebuild(String serverId, RebuildOptions options)
serverId - the server idoptions - additional options used during the rebuild. (OPTIONAL, can be null)ActionResponse resize(String serverId, String flavorId)
confirmResize(String), the old server
will be kept around and you'll be able to roll back to the old flavor quick with revertResize(String). All resizes
will be automatically confirmed after 24 hours.serverId - the server identifierflavorId - the new flavor id to resize toActionResponse confirmResize(String serverId)
serverId - the server identifierActionResponse revertResize(String serverId)
serverId - the server identifierString createSnapshot(String serverId, String snapshotName)
serverId - the server idsnapshotName - the snapshot nameActionResponse addSecurityGroup(String serverId, String secGroupName)
serverId - the server identifiersecGroupName - the security group nameActionResponse removeSecurityGroup(String serverId, String secGroupName)
serverId - the server identifiersecGroupName - the security group nameMap<String,? extends Number> diagnostics(String serverId)
serverId - the server idServerCreateBuilder serverBuilder()
String getConsoleOutput(String serverId, int numLines)
numLines from the given servers console.serverId - the server identifiernumLines - the number of console lines to return.
If lower or equal than zero, the whole console content will be returned.VNCConsole getVNCConsole(String serverId, VNCConsole.Type type)
serverId - the server identifiertype - the VNC Console typeVolumeAttachment attachVolume(String serverId, String volumeId, String device)
serverId - the server identifiervolumeId - the volume identifierdevice - the device to attach the volume to, ex /dev/vdaActionResponse changeAdminPassword(String serverId, String adminPassword)
serverId - the server identifieradminPassword - the new passwordActionResponse detachVolume(String serverId, String attachmentId)
serverId - the server identifierattachmentId - the attachment identifierActionResponse migrateServer(String serverId)
confirmResize(String), the old server
will be kept around and you'll be able to roll back to the old host quick with revertResize(String). All resizes
will be automatically confirmed after 24 hours.serverId - the server identifierActionResponse liveMigrate(String serverId, LiveMigrateOptions options)
serverId to a new host without rebootingserverId - the server identifieroptions - live migration optionsActionResponse resetState(String serverId, Server.Status state)
stateserverId - the server identifierstate - the new server stateActionResponse backupServer(String serverId, BackupOptions options)
serverIdserverId - the server identifieroptions - the backup optionsServer waitForServerStatus(String serverId, Server.Status status, int maxWait, TimeUnit maxWaitUnit)
Status to match or an Error state occurs for the maxWaitserverId - the server identifierstatus - the status to wait formaxWait - the max wait timemaxWaitUnit - the unit the max wait time was specified inMap<String,String> getMetadata(String serverId)
serverId - the server identifierMap<String,String> updateMetadata(String serverId, Map<String,String> metadata)
serverId - the server identifiermetadata - the metadata to create or updateActionResponse deleteMetadataItem(String serverId, String key)
key and serverIdserverId - the server identifierkey - the metadata key to removeServer update(String serverId, ServerUpdateOptions options)
serverId - the server identifieroptions - the options used to updateInterfaceService interfaces()
InstanceActionsService instanceActions()
ServerPassword getPassword(String serverId)
serverId - the server identifierServerPassword evacuate(String serverId, EvacuateOptions options)
serverId from a failed host to a new hostserverId - the server identifieroptions - evaucate optionsCopyright © 2017. All rights reserved.