Class CreateServerOptions
- java.lang.Object
-
- org.jclouds.openstack.nova.v2_0.options.CreateServerOptions
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CreateServerOptions.Builder
-
Constructor Summary
Constructors Constructor Description CreateServerOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CreateServerOptions
adminPass(String adminPass)
CreateServerOptions
availabilityZone(String availabilityZone)
<R extends HttpRequest>
RbindToRequest(R request, Object input)
<R extends HttpRequest>
RbindToRequest(R request, Map<String,Object> postParams)
creates and binds the POST payload to the request using parameters specified.CreateServerOptions
blockDeviceMappings(Set<BlockDeviceMapping> blockDeviceMappings)
CreateServerOptions
configDrive(boolean configDrive)
Set to true to use a config drive for metadata.CreateServerOptions
diskConfig(String diskConfig)
boolean
equals(Object object)
protected String
formatPossiblyGzipped(byte[] data)
String
getAvailabilityZone()
Set<BlockDeviceMapping>
getBlockDeviceMappings()
Block devices that should be attached to the instance at boot time.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 toServer#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.List<String>
getNetworks()
Get custom networks specified for the server.List<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)
A keypair name can be defined when creating a server.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.MoreObjects.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.
-
-
-
Method Detail
-
formatPossiblyGzipped
protected String formatPossiblyGzipped(byte[] data)
-
string
protected com.google.common.base.MoreObjects.ToStringHelper string()
-
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 interfaceMapBinder
- 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 determined by provider quotas(default size is 10KB). Note that the file contents should be encoded as a Base64 string and the size 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 determined by provider quotas(default 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 unencoded, 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.
-
keyPairName
public CreateServerOptions keyPairName(String keyName)
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- See Also:
getKeyPairName()
-
availabilityZone
public CreateServerOptions availabilityZone(String availabilityZone)
- See Also:
getAvailabilityZone()
-
securityGroupNames
public CreateServerOptions securityGroupNames(String... securityGroupNames)
- See Also:
getSecurityGroupNames()
-
securityGroupNames
public CreateServerOptions securityGroupNames(Iterable<String> securityGroupNames)
-
diskConfig
public CreateServerOptions diskConfig(String diskConfig)
- See Also:
getDiskConfig()
-
networks
public CreateServerOptions networks(Iterable<String> networks)
- See Also:
getNetworks()
-
novaNetworks
public CreateServerOptions novaNetworks(Iterable<Network> networks)
- See Also:
Overwrites networks supplied by
-
networks
public CreateServerOptions networks(String... networks)
- See Also:
getNetworks()
-
blockDeviceMappings
public CreateServerOptions blockDeviceMappings(Set<BlockDeviceMapping> blockDeviceMappings)
- See Also:
getBlockDeviceMappings()
-
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()
-
getSecurityGroupNames
public Set<String> getSecurityGroupNames()
Security groups the user specified to run servers with.Note
This requires thatNovaApi#getSecurityGroupExtensionApi(String)
to returnpresent
-
getNetworks
public List<String> getNetworks()
Get custom networks specified for the server.- Returns:
- A list of uuids defined by Neutron (previously Quantum)
- See Also:
- Neutron Networks
-
getNovaNetworks
public List<Network> getNovaNetworks()
Get custom networks specified for the server.- Returns:
- A list of uuids defined by Neutron (previously Quantum)
- See Also:
- Neutron Networks
-
getDiskConfig
public String getDiskConfig()
When you create a server from an image with the diskConfig value set toServer#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 toServer#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.
-
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.
-
getBlockDeviceMappings
public Set<BlockDeviceMapping> getBlockDeviceMappings()
Block devices that should be attached to the instance at boot time.
-
bindToRequest
public <R extends HttpRequest> R bindToRequest(R request, Object input)
- Specified by:
bindToRequest
in interfaceBinder
-
-