org.jclouds.openstack.nova.v2_0.options
Class CreateServerOptions

java.lang.Object
  extended by org.jclouds.openstack.nova.v2_0.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
 CreateServerOptions adminPass(String adminPass)
           
<R extends HttpRequest>
R
bindToRequest(R request, Map<String,Object> postParams)
          creates and binds the POST payload to the request using parameters specified.
<R extends HttpRequest>
R
bindToRequest(R request, Object input)
           
 boolean equals(Object object)
           
 String getKeyPairName()
          A keypair name can be defined when creating a server.
 Set<String> getSecurityGroupNames()
          Note
 int hashCode()
           
 CreateServerOptions keyPairName(String keyName)
           
 CreateServerOptions metadata(Map<String,String> metadata)
          Custom cloud server metadata can also be supplied at launch time.
 CreateServerOptions securityGroupNames(Iterable<String> securityGroupNames)
           
 CreateServerOptions securityGroupNames(String... securityGroupNames)
           
protected  com.google.common.base.Objects.ToStringHelper string()
           
 String toString()
           
 CreateServerOptions userData(byte[] userData)
          Custom user-data can be also be supplied at launch time.
 CreateServerOptions writeFileToPath(byte[] contents, String path)
          You may further customize a cloud server by injecting data into the file system of the cloud server itself.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CreateServerOptions

public CreateServerOptions()
Method Detail

equals

public boolean equals(Object object)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

string

protected com.google.common.base.Objects.ToStringHelper string()

toString

public String toString()
Overrides:
toString in class Object

bindToRequest

public <R extends HttpRequest> R bindToRequest(R request,
                                               Map<String,Object> 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

writeFileToPath

public CreateServerOptions writeFileToPath(byte[] contents,
                                           String path)
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-----).


adminPass

public CreateServerOptions adminPass(String adminPass)

metadata

public CreateServerOptions metadata(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.


userData

public CreateServerOptions userData(byte[] userData)
Custom user-data can be also be supplied at launch time. It is retrievable by the instance and is often used for launch-time configuration by instance scripts.


getKeyPairName

public String getKeyPairName()
A keypair name can be defined when creating a server. This key will be linked to the server and used to SSH connect to the machine


keyPairName

public CreateServerOptions keyPairName(String keyName)
See Also:
getKeyPairName()

getSecurityGroupNames

public Set<String> getSecurityGroupNames()

Note

This requires that NovaApi.getSecurityGroupExtensionForZone(String) to return present

Returns:
security groups the user specified to run servers with; zero length will create an implicit group starting with jclouds#

securityGroupNames

public CreateServerOptions securityGroupNames(String... securityGroupNames)
See Also:
getSecurityGroupNames()

securityGroupNames

public CreateServerOptions securityGroupNames(Iterable<String> securityGroupNames)
See Also:
getSecurityGroupNames()

bindToRequest

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


Copyright © 2009-2012 jclouds. All Rights Reserved.