Class ProvisioningTemplate
- java.lang.Object
-
- com.elastisys.scale.cloudpool.openstack.driver.config.ProvisioningTemplate
-
public class ProvisioningTemplate extends java.lang.ObjectOpenStack-specific server provisioning template.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classProvisioningTemplate.BuilderA builder for constructingProvisioningTemplates.
-
Constructor Summary
Constructors Constructor Description ProvisioningTemplate(java.lang.String size, java.lang.String image, java.lang.String keyPair, java.util.List<java.lang.String> securityGroups, java.lang.String encodedUserData)Creates a newProvisioningTemplate.ProvisioningTemplate(java.lang.String size, java.lang.String image, java.lang.String keyPair, java.util.List<java.lang.String> securityGroups, java.lang.String encodedUserData, java.util.List<java.lang.String> networks, java.lang.Boolean assignFloatingIp)Creates a newProvisioningTemplate.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ProvisioningTemplate.Builderbuilder(java.lang.String size, java.lang.String image)booleanequals(java.lang.Object obj)java.lang.StringgetEncodedUserData()A base 64-encoded blob of data used to pass custom data to started machines.java.lang.StringgetImage()The name of the machine image used to boot new servers.java.lang.StringgetKeyPair()The name of the key pair to use for new machine instances.java.util.List<java.lang.String>getNetworks()The names of the networks to attach launched servers to (for example,private).java.util.List<java.lang.String>getSecurityGroups()The security group(s) to use for new machine instances.java.lang.StringgetSize()The name of the server type to launch.inthashCode()java.lang.BooleanisAssignFloatingIp()Returnstrueif a floating IP address should be allocated to launched servers.com.google.gson.JsonObjecttoJson()java.lang.StringtoString()voidvalidate()Validates that thisProvisioningTemplatecontains all mandatory field.
-
-
-
Constructor Detail
-
ProvisioningTemplate
public ProvisioningTemplate(java.lang.String size, java.lang.String image, java.lang.String keyPair, java.util.List<java.lang.String> securityGroups, java.lang.String encodedUserData)Creates a newProvisioningTemplate.- 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 benull.securityGroups- The security group(s) to use for new machine instances. May benull.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 benull.
-
ProvisioningTemplate
public ProvisioningTemplate(java.lang.String size, java.lang.String image, java.lang.String keyPair, java.util.List<java.lang.String> securityGroups, java.lang.String encodedUserData, java.util.List<java.lang.String> networks, java.lang.Boolean assignFloatingIp)Creates a newProvisioningTemplate.- 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 benull.securityGroups- The security group(s) to use for new machine instances. May benull.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 benull.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 tonullor 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 totrueif a floating IP address should be allocated to launched servers. Default:false.
-
-
Method Detail
-
getSize
public java.lang.String getSize()
The name of the server type to launch. For example, m1.medium.- Returns:
-
getImage
public java.lang.String getImage()
The name of the machine image used to boot new servers.- Returns:
-
getKeyPair
public java.lang.String getKeyPair()
The name of the key pair to use for new machine instances. May benull.- Returns:
-
getSecurityGroups
public java.util.List<java.lang.String> getSecurityGroups()
The security group(s) to use for new machine instances. May benull.- Returns:
-
getEncodedUserData
public java.lang.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 benull.- Returns:
-
getNetworks
public java.util.List<java.lang.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 tonullor 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 java.lang.Boolean isAssignFloatingIp()
Returnstrueif a floating IP address should be allocated to launched servers.- Returns:
-
validate
public void validate() throws java.lang.IllegalArgumentExceptionValidates that thisProvisioningTemplatecontains all mandatory field.- Throws:
java.lang.IllegalArgumentException
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toJson
public com.google.gson.JsonObject toJson()
-
builder
public static ProvisioningTemplate.Builder builder(java.lang.String size, java.lang.String image)
-
-