com.elastisys.scale.cloudpool.openstack.driver.config

## Class ProvisioningTemplate

- java.lang.Object
- - com.elastisys.scale.cloudpool.openstack.driver.config.ProvisioningTemplate

    public class ProvisioningTemplate
    extends Object

OpenStack-specific server provisioning template.

See Also:
  `BaseCloudPoolConfig.getProvisioningTemplate()`

### Constructor Summary

Constructors
Constructor and Description
`ProvisioningTemplate(String size, String image, String keyPair, List<String> securityGroups, String encodedUserData)` Creates a new `ProvisioningTemplate`.
`ProvisioningTemplate(String size, String image, String keyPair, List<String> securityGroups, String encodedUserData, List<String> networks, Boolean assignFloatingIp)` Creates a new `ProvisioningTemplate`.

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `equals(Object obj)`
`String` `getEncodedUserData()` A base 64-encoded blob of data used to pass custom data to started machines.
`String` `getImage()` The name of the machine image used to boot new servers.
`String` `getKeyPair()` The name of the key pair to use for new machine instances.
`List<String>` `getNetworks()` The names of the networks to attach launched servers to (for example, `private`).
`List<String>` `getSecurityGroups()` The security group(s) to use for new machine instances.
`String` `getSize()` The name of the server type to launch.
`int` `hashCode()`
`Boolean` `isAssignFloatingIp()` Returns `true` if a floating IP address should be allocated to launched servers.
`String` `toString()`
`void` `validate()` Validates that this `ProvisioningTemplate` contains all mandatory field.

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### ProvisioningTemplate

    public ProvisioningTemplate(String size,
                                String image,
                                String keyPair,
                                List<String> securityGroups,
                                String encodedUserData)

Creates a new `ProvisioningTemplate`.

Parameters:
  `size` - The name of the server type to launch. For example, m1.medium.
  `image` - The name of the machine image used to boot new servers.
  `keyPair` - The name of the key pair to use for new machine instances. May be `null`.
  `securityGroups` - The security group(s) to use for new machine instances. May be `null`.
  `encodedUserData` - A base 64-encoded blob of data used to pass custom data to started machines. It is supported by many cloud providers and is typically used to pass a boot-up shell script or cloud-init parameters to launched machines. May be `null`.

#### ProvisioningTemplate

    public ProvisioningTemplate(String size,
                                String image,
                                String keyPair,
                                List<String> securityGroups,
                                String encodedUserData,
                                List<String> networks,
                                Boolean assignFloatingIp)

Creates a new `ProvisioningTemplate`.

Parameters:
  `size` - The name of the server type to launch. For example, m1.medium.
  `image` - The name of the machine image used to boot new servers.
  `keyPair` - The name of the key pair to use for new machine instances. May be `null`.
  `securityGroups` - The security group(s) to use for new machine instances. May be `null`.
  `encodedUserData` - A base 64-encoded blob of data used to pass custom data to started machines. It is supported by many cloud providers and is typically used to pass a boot-up shell script or cloud-init parameters to launched machines. May be `null`.
  `networks` - The names of the networks to attach launched servers to (for example, `private`). Each network creates a separate network interface controller (NIC) on a created server. Typically, this option can be left out, but in rare cases, when an account has more than one network to choose from, the OpenStack API forces us to be explicit about the network(s) we want to use.

  If set to `null` or left empty, the default behavior is to use which ever network is configured by the cloud provider for the user/project. However, if there are multiple choices, this will cause server boot requests to fail.
  `assignFloatingIp` - Set to `true` if a floating IP address should be allocated to launched servers. Default: `false`.

### Method Detail

#### getSize

    public String getSize()

The name of the server type to launch. For example, m1.medium.

Returns:

#### getImage

    public String getImage()

The name of the machine image used to boot new servers.

Returns:

#### getKeyPair

    public String getKeyPair()

The name of the key pair to use for new machine instances. May be `null`.

Returns:

#### getSecurityGroups

    public List<String> getSecurityGroups()

The security group(s) to use for new machine instances. May be `null`.

Returns:

#### getEncodedUserData

    public String getEncodedUserData()

A base 64-encoded blob of data used to pass custom data to started machines. It is supported by many cloud providers and is typically used to pass a boot-up shell script or cloud-init parameters to launched machines. May be `null`.

Returns:

#### getNetworks

    public List<String> getNetworks()

The names of the networks to attach launched servers to (for example, `private`). Each network creates a separate network interface controller (NIC) on a created server. Typically, this option can be left out, but in rare cases, when an account has more than one network to choose from, the OpenStack API forces us to be explicit about the network(s) we want to use.

If set to `null` or left empty, the default behavior is to use which ever network is configured by the cloud provider for the user/project. However, if there are multiple choices, this will cause server boot requests to fail.

Returns:

#### isAssignFloatingIp

    public Boolean isAssignFloatingIp()

Returns `true` if a floating IP address should be allocated to launched servers.

Returns:

#### validate

    public void validate()
                  throws IllegalArgumentException

Validates that this `ProvisioningTemplate` contains all mandatory field.

Throws:
  `IllegalArgumentException`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### equals

    public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`