org.jclouds.cloudservers
Interface CloudServersClient


public interface CloudServersClient

Provides access to Cloud Servers via their REST API.

All commands return a Future of the result from Cloud Servers. Any exceptions incurred during processing will be wrapped in an ExecutionException as documented in Future.get().

Author:
Adrian Cole
See Also:
CloudServersAsyncClient,

Method Summary
 void changeAdminPass(int id, String adminPass)
          This operation allows you to change the administrative password.
 void confirmResizeServer(int id)
          The resize function converts an existing server to a different flavor, in essence, scaling the server up or down.
 Image createImageFromServer(String imageName, int serverId)
          This operation creates a new image for the given server ID.
 Server createServer(String name, int imageId, int flavorId, CreateServerOptions... options)
          This operation asynchronously provisions a new server.
 SharedIpGroup createSharedIpGroup(String name, CreateSharedIpGroupOptions... options)
          This operation creates a new shared IP group.
 boolean deleteBackupSchedule(int serverId)
          Delete backup schedule for the specified server.
 boolean deleteImage(int id)
          This operation deletes an image from the system.
 boolean deleteServer(int id)
          This operation deletes a cloud server instance from the system.
 boolean deleteSharedIpGroup(int id)
          This operation deletes the specified shared IP group.
 Addresses getAddresses(int serverId)
          List all server addresses returns empty set if the server doesn't exist
 BackupSchedule getBackupSchedule(int serverId)
          List the backup schedule for the specified server
 Flavor getFlavor(int id)
          This operation returns details of the specified flavor.
 Image getImage(int id)
          This operation returns details of the specified image.
 Limits getLimits()
          All accounts, by default, have a preconfigured set of thresholds (or limits) to manage capacity and prevent abuse of the system.
 Server getServer(int id)
          This operation returns details of the specified server.
 SharedIpGroup getSharedIpGroup(int id)
          This operation returns details of the specified shared IP group.
 Set<Flavor> listFlavors(ListOptions... options)
          List available flavors (IDs and names only) in order to retrieve all details, pass the option withDetails()
 Set<Image> listImages(ListOptions... options)
          List available images (IDs and names only) in order to retrieve all details, pass the option withDetails()
 Set<String> listPrivateAddresses(int serverId)
          List all private server addresses returns empty set if the server doesn't exist
 Set<String> listPublicAddresses(int serverId)
          List all public server addresses returns empty set if the server doesn't exist
 Set<Server> listServers(ListOptions... options)
          List all servers (IDs and names only) This operation provides a list of servers associated with your identity.
 Set<SharedIpGroup> listSharedIpGroups(ListOptions... options)
          List shared IP groups (IDs and names only) in order to retrieve all details, pass the option withDetails()
 void rebootServer(int id, RebootType rebootType)
          The reboot function allows for either a soft or hard reboot of a server.
 void rebuildServer(int id, RebuildServerOptions... options)
          The rebuild function removes all data on the server and replaces it with the specified image.
 void renameServer(int id, String newName)
          This operation allows you to update the name of the server.
 void replaceBackupSchedule(int id, BackupSchedule backupSchedule)
          Enable/update the backup schedule for the specified server
 void resizeServer(int id, int flavorId)
          The resize function converts an existing server to a different flavor, in essence, scaling the server up or down.
 void revertResizeServer(int id)
          The resize function converts an existing server to a different flavor, in essence, scaling the server up or down.
 void shareIp(String addressToShare, int serverToTosignBindressTo, int sharedIpGroup, boolean configureServer)
          /** This operation allows you share an IP address to the specified server

This operation shares an IP from an existing server in the specified shared IP group to another specified server in the same group.

 void unshareIp(String addressToShare, int serverToTosignBindressTo)
          This operation removes a shared IP address from the specified server.
 

Method Detail

getLimits

Limits getLimits()
All accounts, by default, have a preconfigured set of thresholds (or limits) to manage capacity and prevent abuse of the system. The system recognizes two kinds of limits: rate limits and absolute limits. Rate limits are thresholds that are reset after a certain amount of time passes. Absolute limits are fixed.

Returns:
limits on the account

listServers

Set<Server> listServers(ListOptions... options)
List all servers (IDs and names only) This operation provides a list of servers associated with your identity. Servers that have been deleted are not included in this list.

in order to retrieve all details, pass the option withDetails()


getServer

Server getServer(int id)
This operation returns details of the specified server.

Returns:
null, if the server is not found
See Also:
Server

deleteServer

boolean deleteServer(int id)
This operation deletes a cloud server instance from the system.

Note: When a server is deleted, all images created from that server are also removed.

Returns:
false if the server is not found
See Also:
Server

rebootServer

void rebootServer(int id,
                  RebootType rebootType)
The reboot function allows for either a soft or hard reboot of a server.

Status Transition:

ACTIVE - REBOOT - ACTIVE (soft reboot)

ACTIVE - HARD_REBOOT - ACTIVE (hard reboot)

Parameters:
rebootType - With a soft reboot, the operating system is signaled to restart, which allows for a graceful shutdown of all processes. A hard reboot is the equivalent of power cycling the server.

resizeServer

void resizeServer(int id,
                  int flavorId)
The resize function converts an existing server to a different flavor, in essence, scaling the server up or down. The original server is saved for a period of time to allow rollback if there is a problem. All resizes should be tested and explicitly confirmed, at which time the original server is removed. All resizes are automatically confirmed after 24 hours if they are not confirmed or reverted.

Status Transition:

ACTIVE - QUEUE_RESIZE - PREP_RESIZE - VERIFY_RESIZE

ACTIVE - QUEUE_RESIZE - ACTIVE (on error)


confirmResizeServer

void confirmResizeServer(int id)
The resize function converts an existing server to a different flavor, in essence, scaling the server up or down. The original server is saved for a period of time to allow rollback if there is a problem. All resizes should be tested and explicitly confirmed, at which time the original server is removed. All resizes are automatically confirmed after 24 hours if they are not confirmed or reverted.

Status Transition:

VERIFY_RESIZE - ACTIVE


revertResizeServer

void revertResizeServer(int id)
The resize function converts an existing server to a different flavor, in essence, scaling the server up or down. The original server is saved for a period of time to allow rollback if there is a problem. All resizes should be tested and explicitly reverted, at which time the original server is removed. All resizes are automatically reverted after 24 hours if they are not reverted or reverted.

Status Transition:

VERIFY_RESIZE - ACTIVE


createServer

Server createServer(String name,
                    int imageId,
                    int flavorId,
                    CreateServerOptions... options)
This operation asynchronously provisions a new server. The progress of this operation depends on several factors including location of the requested image, network i/o, host load, and the selected flavor. The progress of the request can be checked by performing a GET on /server/id, which will return a progress attribute (0-100% completion). A password will be randomly generated for you and returned in the response object. For security reasons, it will not be returned in subsequent GET calls against a given server ID.

Parameters:
options - - used to specify extra files, metadata, or ip parameters during server creation.

rebuildServer

void rebuildServer(int id,
                   RebuildServerOptions... options)
The rebuild function removes all data on the server and replaces it with the specified image. Server ID and IP addresses remain the same.

Status Transition:

ACTIVE - REBUILD - ACTIVE

ACTIVE - REBUILD - ERROR (on error)

Parameters:
options - - imageId is an optional argument. If it is not specified, the server is rebuilt with the original imageId.

shareIp

void shareIp(String addressToShare,
             int serverToTosignBindressTo,
             int sharedIpGroup,
             boolean configureServer)
/** This operation allows you share an IP address to the specified server

This operation shares an IP from an existing server in the specified shared IP group to another specified server in the same group. The operation modifies cloud network restrictions to allow IP traffic for the given IP to/from the server specified.

Status Transition: ACTIVE - SHARE_IP - ACTIVE (if configureServer is true) ACTIVE - SHARE_IP_NO_CONFIG - ACTIVE

Parameters:
configureServer -

if set to true, the server is configured with the new address, though the address is not enabled. Note that configuring the server does require a reboot.

If set to false, does not bind the IP to the server itself. A heartbeat facility (e.g. keepalived) can then be used within the servers to perform health checks and manage IP failover.


unshareIp

void unshareIp(String addressToShare,
               int serverToTosignBindressTo)
This operation removes a shared IP address from the specified server.

Status Transition: ACTIVE - DELETE_IP - ACTIVE

Parameters:
addressToShare -
serverToTosignBindressTo -

changeAdminPass

void changeAdminPass(int id,
                     String adminPass)
This operation allows you to change the administrative password.

Status Transition: ACTIVE - PASSWORD - ACTIVE


renameServer

void renameServer(int id,
                  String newName)
This operation allows you to update the name of the server. This operation changes the name of the server in the Cloud Servers system and does not change the server host name itself.

Status Transition: ACTIVE - PASSWORD - ACTIVE


listFlavors

Set<Flavor> listFlavors(ListOptions... options)
List available flavors (IDs and names only) in order to retrieve all details, pass the option withDetails()


getFlavor

Flavor getFlavor(int id)
This operation returns details of the specified flavor.

Returns:
null, if the flavor is not found
See Also:
Flavor

listImages

Set<Image> listImages(ListOptions... options)
List available images (IDs and names only) in order to retrieve all details, pass the option withDetails()


getImage

Image getImage(int id)
This operation returns details of the specified image.

Returns:
null, if the image is not found
See Also:
Image

deleteImage

boolean deleteImage(int id)
This operation deletes an image from the system.

Note: Images are immediately removed. Currently, there are no state transitions to track the delete operation.

Returns:
false if the image is not found
See Also:
Image

createImageFromServer

Image createImageFromServer(String imageName,
                            int serverId)
This operation creates a new image for the given server ID. Once complete, a new image will be available that can be used to rebuild or create servers. Specifying the same image name as an existing custom image replaces the image. The image creation status can be queried by performing a GET on /images/id and examining the status and progress attributes. Status Transition:

QUEUED - PREPARING - SAVING - ACTIVE

QUEUED - PREPARING - SAVING - FAILED (on error)

Note: At present, image creation is an asynchronous operation, so coordinating the creation with data quiescence, etc. is currently not possible.

Throws:
ResourceNotFoundException - if the server is not found
See Also:
Image

listSharedIpGroups

Set<SharedIpGroup> listSharedIpGroups(ListOptions... options)
List shared IP groups (IDs and names only) in order to retrieve all details, pass the option withDetails()


getSharedIpGroup

SharedIpGroup getSharedIpGroup(int id)
This operation returns details of the specified shared IP group.

Returns:
null, if the shared ip group is not found
See Also:
SharedIpGroup

createSharedIpGroup

SharedIpGroup createSharedIpGroup(String name,
                                  CreateSharedIpGroupOptions... options)
This operation creates a new shared IP group. Please note, all responses to requests for shared_ip_groups return an array of servers. However, on a create request, the shared IP group can be created empty or can be initially populated with a single server. Use CreateSharedIpGroupOptions to specify an server.


deleteSharedIpGroup

boolean deleteSharedIpGroup(int id)
This operation deletes the specified shared IP group. This operation will ONLY succeed if 1) there are no active servers in the group (i.e. they have all been terminated) or 2) no servers in the group are actively sharing IPs.

Returns:
false if the shared ip group is not found
See Also:
SharedIpGroup

getBackupSchedule

BackupSchedule getBackupSchedule(int serverId)
List the backup schedule for the specified server

Throws:
ResourceNotFoundException - , if the server doesn't exist

deleteBackupSchedule

boolean deleteBackupSchedule(int serverId)
Delete backup schedule for the specified server.

Web Hosting #119571 currently disables the schedule, not deletes it.

Returns:
false if the schedule is not found

replaceBackupSchedule

void replaceBackupSchedule(int id,
                           BackupSchedule backupSchedule)
Enable/update the backup schedule for the specified server


getAddresses

Addresses getAddresses(int serverId)
List all server addresses returns empty set if the server doesn't exist


listPublicAddresses

Set<String> listPublicAddresses(int serverId)
List all public server addresses returns empty set if the server doesn't exist


listPrivateAddresses

Set<String> listPrivateAddresses(int serverId)
List all private server addresses returns empty set if the server doesn't exist



Copyright © 2009-2011 jclouds. All Rights Reserved.