org.jclouds.cloudservers.options
Class CreateServerOptions

java.lang.Object
  extended by org.jclouds.cloudservers.options.CreateServerOptions
All Implemented Interfaces:
Binder, MapBinder

public class CreateServerOptions
extends Object
implements MapBinder

Author:
Adrian Cole

Nested Class Summary
static class CreateServerOptions.Builder
           
 
Constructor Summary
CreateServerOptions()
           
 
Method Summary
<R extends HttpRequest>
R
bindToRequest(R request, Map<String,String> postParams)
          creates and binds the POST payload to the request using parameters specified.
<R extends HttpRequest>
R
bindToRequest(R request, Object input)
           
 CreateServerOptions withFile(String path, byte[] contents)
          You may further customize a cloud server by injecting data into the file system of the cloud server itself.
 CreateServerOptions withMetadata(Map<String,String> metadata)
          Custom cloud server metadata can also be supplied at launch time.
 CreateServerOptions withSharedIp(String publicIp)
          Public IP addresses can be shared across multiple servers for use in various high availability scenarios.
 CreateServerOptions withSharedIpGroup(int id)
          A shared IP group is a collection of servers that can share IPs with other members of the group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CreateServerOptions

public CreateServerOptions()
Method Detail

bindToRequest

public <R extends HttpRequest> R bindToRequest(R request,
                                               Map<String,String> postParams)
Description copied from interface: MapBinder
creates and binds the POST payload to the request using parameters specified.

Specified by:
bindToRequest in interface MapBinder
See Also:
PayloadParam

withFile

public CreateServerOptions withFile(String path,
                                    byte[] contents)
You may further customize a cloud server by injecting data into the file system of the cloud server itself. This is useful, for example, for inserting ssh keys, setting configuration files, or storing data that you want to retrieve from within the instance itself. It is intended to provide a minimal amount of launch-time personalization. If significant customization is required, a custom image should be created. The max size of the file path data is 255 bytes while the max size of the file contents is 10KB. Note that the file contents should be encoded as a Base64 string and the 10KB limit refers to the number of bytes in the decoded data not the number of characters in the encoded data. The maximum number of file path/content pairs that can be supplied is 5. Any existing files that match the specified file will be renamed to include the extension bak followed by a time stamp. For example, the file /etc/passwd will be backed up as /etc/passwd.bak.1246036261.5785. All files will have root and the root group as owner and group owner, respectively and will allow user and group read access only (-r--r-----).


withSharedIpGroup

public CreateServerOptions withSharedIpGroup(int id)
A shared IP group is a collection of servers that can share IPs with other members of the group. Any server in a group can share one or more public IPs with any other server in the group. With the exception of the first server in a shared IP group, servers must be launched into shared IP groups. A server may only be a member of one shared IP group.

Servers in the same shared IP group can share public IPs for various high availability and load balancing configurations. To launch an HA server, include the optional sharedIpGroupId element and the server will be launched into that shared IP group.

Note: sharedIpGroupId is an optional parameter and for optimal performance, should ONLY be specified when intending to share IPs between servers.

See Also:
withSharedIp(String)

withMetadata

public CreateServerOptions withMetadata(Map<String,String> metadata)
Custom cloud server metadata can also be supplied at launch time. This metadata is stored in the API system where it is retrievable by querying the API for server status. The maximum size of the metadata key and value is each 255 bytes and the maximum number of key-value pairs that can be supplied per server is 5.


withSharedIp

public CreateServerOptions withSharedIp(String publicIp)
Public IP addresses can be shared across multiple servers for use in various high availability scenarios. When an IP address is shared to another server, the cloud network restrictions are modified to allow each server to listen to and respond on that IP address (you may optionally specify that the target server network configuration be modified). Shared IP addresses can be used with many standard heartbeat facilities (e.g. keepalived) that monitor for failure and manage IP failover.

If you intend to use a shared IP on the server being created and have no need for a separate public IP address, you may launch the server into a shared IP group and specify an IP address from that shared IP group to be used as its public IP. You can accomplish this by specifying the public shared IP address in your request. This is optional and is only valid if sharedIpGroupId is also supplied.


bindToRequest

public <R extends HttpRequest> R bindToRequest(R request,
                                               Object input)
Specified by:
bindToRequest in interface Binder


Copyright © 2009-2012 jclouds. All Rights Reserved.