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:
org.jclouds.rest.Binder, org.jclouds.rest.MapBinder

public class CreateServerOptions
extends Object
implements org.jclouds.rest.MapBinder


Nested Class Summary
static class CreateServerOptions.Builder
           
 
Constructor Summary
CreateServerOptions()
           
 
Method Summary
 CreateServerOptions adminPass(String adminPass)
           
 CreateServerOptions availabilityZone(String availabilityZone)
           
<R extends org.jclouds.http.HttpRequest>
R
bindToRequest(R request, Map<String,Object> postParams)
           
<R extends org.jclouds.http.HttpRequest>
R
bindToRequest(R request, Object input)
           
 CreateServerOptions configDrive(boolean configDrive)
          Set to true to use a config drive for metadata.
 CreateServerOptions diskConfig(String diskConfig)
           
 boolean equals(Object object)
           
 String getAvailabilityZone()
           
 boolean getConfigDrive()
          Determines if a configuration drive will be attached to the server or not.
 String getDiskConfig()
          When you create a server from an image with the diskConfig value set to Server#DISK_CONFIG_AUTO, the server is built with a single partition that is expanded to the disk size of the flavor selected.
 String getKeyPairName()
          A keypair name can be defined when creating a server.
 Set<String> getNetworks()
          Get custom networks specified for the server.
 Set<Network> getNovaNetworks()
          Get custom networks specified for the server.
 Set<String> getSecurityGroupNames()
          Security groups the user specified to run servers with.
 int hashCode()
           
 CreateServerOptions keyPairName(String keyName)
           
 CreateServerOptions metadata(Map<String,String> metadata)
          Custom cloud server metadata can also be supplied at launch time.
 CreateServerOptions networks(Iterable<String> networks)
           
 CreateServerOptions networks(String... networks)
           
 CreateServerOptions novaNetworks(Iterable<Network> networks)
           
 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 org.jclouds.http.HttpRequest> R bindToRequest(R request,
                                                                Map<String,Object> postParams)
Specified by:
bindToRequest in interface org.jclouds.rest.MapBinder

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.


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. Pass userData unencdoed, as the value will be base64 encoded automatically.


configDrive

public CreateServerOptions configDrive(boolean configDrive)
Set to true to use a config drive for metadata. This is a separate configuration drive that can be used separately from the metadata service. This needs to be set to "true" when trying to use user data for cloud-init.

See Also:
http://docs.openstack.org/grizzly/openstack-compute/admin/content/config-drive.html

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


getAvailabilityZone

public String getAvailabilityZone()

keyPairName

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

availabilityZone

public CreateServerOptions availabilityZone(String availabilityZone)
See Also:
getAvailabilityZone()

getSecurityGroupNames

public Set<String> getSecurityGroupNames()
Security groups the user specified to run servers with.

Note

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


getNetworks

public Set<String> getNetworks()
Get custom networks specified for the server.

Returns:
A set of uuids defined by Neutron (previously Quantum)
See Also:
Neutron Networks

getNovaNetworks

public Set<Network> getNovaNetworks()
Get custom networks specified for the server.

Returns:
A set of uuids defined by Neutron (previously Quantum)
See Also:
Neutron Networks

securityGroupNames

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

securityGroupNames

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

getDiskConfig

public String getDiskConfig()
When you create a server from an image with the diskConfig value set to Server#DISK_CONFIG_AUTO, the server is built with a single partition that is expanded to the disk size of the flavor selected. When you set the diskConfig attribute to Server#DISK_CONFIG_MANUAL, the server is built by using the partition scheme and file system that is in the source image.

If the target flavor disk is larger, remaining disk space is left unpartitioned. A server inherits the diskConfig attribute from the image from which it is created. However, you can override the diskConfig value when you create a server. This field is only present if the Disk Config extension is installed in your OpenStack deployment.


diskConfig

public CreateServerOptions diskConfig(String diskConfig)
See Also:
getDiskConfig()

getConfigDrive

public boolean getConfigDrive()
Determines if a configuration drive will be attached to the server or not. This can be used for cloud-init or other configuration purposes.


networks

public CreateServerOptions networks(Iterable<String> networks)
See Also:
getNetworks()

novaNetworks

public CreateServerOptions novaNetworks(Iterable<Network> networks)
See Also:
Overwrites networks supplied by {@link #networks(Iterable)}

networks

public CreateServerOptions networks(String... networks)
See Also:
getNetworks()

bindToRequest

public <R extends org.jclouds.http.HttpRequest> R bindToRequest(R request,
                                                                Object input)
Specified by:
bindToRequest in interface org.jclouds.rest.Binder


Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.