Class CreateServerOptions

java.lang.Object
org.jclouds.openstack.nova.v2_0.options.CreateServerOptions
All Implemented Interfaces:
Binder, MapBinder

public class CreateServerOptions extends Object implements MapBinder
  • Constructor Details

    • CreateServerOptions

      public CreateServerOptions()
  • Method Details

    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • formatPossiblyGzipped

      protected String formatPossiblyGzipped(byte[] data)
    • string

      protected com.google.common.base.MoreObjects.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:
    • 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:
    • availabilityZone

      public CreateServerOptions availabilityZone(String availabilityZone)
      See Also:
    • securityGroupNames

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

      public CreateServerOptions securityGroupNames(Iterable<String> securityGroupNames)
    • diskConfig

      public CreateServerOptions diskConfig(String diskConfig)
      See Also:
    • networks

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

      public CreateServerOptions novaNetworks(Iterable<Network> networks)
      See Also:
    • networks

      public CreateServerOptions networks(String... networks)
      See Also:
    • blockDeviceMappings

      public CreateServerOptions blockDeviceMappings(Set<BlockDeviceMapping> blockDeviceMappings)
      See Also:
    • 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 that

      invalid reference
      NovaApi#getSecurityGroupExtensionApi(String)
      to return
      invalid reference
      present
    • getNetworks

      public List<String> getNetworks()
      Get custom networks specified for the server.
      Returns:
      A list of uuids defined by Neutron (previously Quantum)
      See Also:
    • getNovaNetworks

      public List<NetworkgetNovaNetworks()
      Get custom networks specified for the server.
      Returns:
      A list of uuids defined by Neutron (previously Quantum)
      See Also:
    • getDiskConfig

      public String getDiskConfig()
      When you create a server from an image with the diskConfig value set to
      invalid reference
      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
      invalid reference
      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.

    • 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 interface Binder