org.jclouds.elasticstack
Interface ElasticStackClient


public interface ElasticStackClient

Provides synchronous access to elasticstack.

Author:
Adrian Cole
See Also:
ElasticStackAsyncClient,

Method Summary
 ServerInfo createAndStartServer(Server server)
          create and start a new server
 DriveInfo createDrive(Drive createDrive)
          create a new drive
 ServerInfo createServer(Server server)
          create a new server
 void destroyDrive(String uuid)
          Destroy a drive
 void destroyServer(String uuid)
          Destroy a server
 DriveInfo getDriveInfo(String uuid)
           
 ServerInfo getServerInfo(String uuid)
           
 void imageDrive(String source, String destination)
          Image a drive from another drive.
 void imageDrive(String source, String destination, ImageConversionType conversionType)
           
 Set<? extends DriveInfo> listDriveInfo()
          Get all drives info
 Set<String> listDrives()
          list of drive uuids in your account
 Set<? extends ServerInfo> listServerInfo()
          Get all servers info
 Set<String> listServers()
          list of server uuids in your account
 Payload readDrive(String uuid, long offset, long size)
          Read binary data from a drive
 void resetServer(String uuid)
          Reset a server
 DriveInfo setDriveData(String uuid, DriveData driveData)
          set extra drive data
 ServerInfo setServerConfiguration(String uuid, Server server)
          set server configuration
 void shutdownServer(String uuid)
          Shutdown a server

Sends the server an ACPI power-down event.

 void startServer(String uuid)
          Start a server
 void stopServer(String uuid)
          Stop a server

Kills the server immediately, equivalent to a power failure.

 void writeDrive(String uuid, Payload content)
          Write binary data to a drive
 void writeDrive(String uuid, Payload content, long offset)
           
 

Method Detail

listServers

Set<String> listServers()
list of server uuids in your account

Returns:
or empty set if no servers are found

listServerInfo

Set<? extends ServerInfo> listServerInfo()
Get all servers info

Returns:
or empty set if no servers are found

getServerInfo

ServerInfo getServerInfo(String uuid)
Parameters:
uuid - what to get
Returns:
null, if not found

createServer

ServerInfo createServer(Server server)
create a new server

Parameters:
server -
Returns:
newly created server

setServerConfiguration

ServerInfo setServerConfiguration(String uuid,
                                  Server server)
set server configuration

Parameters:
uuid - what server to change
serverData - what values to change
Returns:
new data

destroyServer

void destroyServer(String uuid)
Destroy a server

Parameters:
uuid - what to destroy

startServer

void startServer(String uuid)
Start a server

Parameters:
uuid - what to start

stopServer

void stopServer(String uuid)
Stop a server

Kills the server immediately, equivalent to a power failure. Server reverts to a stopped status if it is persistent and is automatically destroyed otherwise.

Parameters:
uuid - what to stop

shutdownServer

void shutdownServer(String uuid)
Shutdown a server

Sends the server an ACPI power-down event. Server reverts to a stopped status if it is persistent and is automatically destroyed otherwise.

note

behaviour on shutdown depends on how your server OS is set up to respond to an ACPI power button signal.

Parameters:
uuid - what to shutdown

resetServer

void resetServer(String uuid)
Reset a server

Parameters:
uuid - what to reset

listDrives

Set<String> listDrives()
list of drive uuids in your account

Returns:
or empty set if no drives are found

listDriveInfo

Set<? extends DriveInfo> listDriveInfo()
Get all drives info

Returns:
or empty set if no drives are found

getDriveInfo

DriveInfo getDriveInfo(String uuid)
Parameters:
uuid - what to get
Returns:
null, if not found

createDrive

DriveInfo createDrive(Drive createDrive)
create a new drive

Parameters:
createDrive - required parameters: name, size
Returns:
newly created drive

setDriveData

DriveInfo setDriveData(String uuid,
                       DriveData driveData)
set extra drive data

Parameters:
uuid - what drive to change
driveData - what values to change
Returns:
new data

destroyDrive

void destroyDrive(String uuid)
Destroy a drive

Parameters:
uuid - what to delete

createAndStartServer

ServerInfo createAndStartServer(Server server)
create and start a new server

Parameters:
server -
Returns:
newly created server

imageDrive

void imageDrive(String source,
                String destination)
Image a drive from another drive. The actual imaging process is asynchronous, with progress reported via drive info.

Parameters:
source - drive to copy from
destination - drive to copy to

imageDrive

void imageDrive(String source,
                String destination,
                ImageConversionType conversionType)
Parameters:
conversionType - Supports 'gzip' or 'gunzip' conversions.
See Also:
imageDrive(String, String)

readDrive

Payload readDrive(String uuid,
                  long offset,
                  long size)
Read binary data from a drive

Parameters:
uuid - drive to read
offset - start at the specified offset in bytes
size - the specified size in bytes; must be <=4096k
Returns:
binary content of the drive.

writeDrive

void writeDrive(String uuid,
                Payload content)
Write binary data to a drive

Parameters:
uuid - drive to write
content - what to write.
  • Binary data (Content-Type: application/octet-stream)
  • Supports raw data or Content-Encoding: gzip
  • Does not support Transfer-Encoding: chunked

writeDrive

void writeDrive(String uuid,
                Payload content,
                long offset)
Parameters:
offset - the byte offset in the target drive at which to start writing, not an offset in the input stream.
See Also:
writeDrive(String, Payload)


Copyright © 2009-2011 jclouds. All Rights Reserved.