Package org.jclouds.compute.domain
Interface TemplateBuilder
-
- All Known Implementing Classes:
ArbitraryCpuRamTemplateBuilderImpl
,AWSEC2TemplateBuilderImpl
,EC2TemplateBuilderImpl
,GoogleComputeEngineArbitraryCpuRamTemplateBuilderImpl
,TemplateBuilderImpl
public interface TemplateBuilder
Creates a customized template based on requirements.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TemplateBuilder
any()
prime this builder with parameters known to work on the current compute provider.TemplateBuilder
biggest()
configure this template to the largest hardware, based on cores, ram, then diskTemplate
build()
Generate an immutable template from the current builder.TemplateBuilder
fastest()
configure this template to the fastest hardware, based on cpuTemplateBuilder
forceCacheReload()
Forces an image lookup against the provider to reload the image cache.TemplateBuilder
from(String spec)
Configure and return this template, updating it with the populated values of the givenspec
.TemplateBuilder
from(TemplateBuilderSpec spec)
Configure and return this template, updating it with the populated values of the givenspec
.TemplateBuilder
fromHardware(Hardware hardware)
Configure this template to require the minimum hardware of the parameter.TemplateBuilder
fromImage(Image image)
Configure this template to fuzzy-match on the image parameterTemplateBuilder
fromTemplate(Template image)
Configure this template to match the resources of the template parameter.TemplateBuilder
hardwareId(String hardwareId)
Configure this template to require a specific hardwareId.TemplateBuilder
hypervisorMatches(String hypervisorRegex)
Configure this template to have an hypervisor that matches the regular expressionTemplateBuilder
imageChooser(com.google.common.base.Function<Iterable<? extends Image>,Image> imageChooser)
Configure this template with a specific preference function which operates on images which match the other criteria.TemplateBuilder
imageDescriptionMatches(String imageDescriptionRegex)
Configure this template to have an image description that matches the regular expressionTemplateBuilder
imageId(String imageId)
Configure this template to require a specific imageId.TemplateBuilder
imageMatches(com.google.common.base.Predicate<Image> condition)
Configure this template to have an image that matches the supplied condition ex.TemplateBuilder
imageNameMatches(String imageNameRegex)
Configure this template to have an image name that matches the regular expressionTemplateBuilder
imageVersionMatches(String imageVersionRegex)
Configure this template to have an image version that matches the regular expressionTemplateBuilder
locationId(String locationId)
Configure this template to start in a specific locationTemplateBuilder
minCores(double minCores)
Configure this template to require the minimum cores belowTemplateBuilder
minDisk(double gigabytes)
Configure this template with required minimum disk space in gigabytesTemplateBuilder
minRam(int megabytes)
Configure this template to require the minimum ram in megabytes belowTemplateBuilder
options(TemplateOptions options)
Sets options on the template (i.e.TemplateBuilder
os64Bit(boolean is64bit)
Configure this template to require a 64 bit operating system.TemplateBuilder
osArchMatches(String architecture)
Configure this template to require a specific architecture.TemplateBuilder
osDescriptionMatches(String osDescriptionRegex)
Configure this template to have an operating system description that matches the regular expressionTemplateBuilder
osFamily(OsFamily os)
Configure this template to use a specific operating system image.TemplateBuilder
osNameMatches(String osNameRegex)
Configure this template to have an operating system name that matches the regular expressionTemplateBuilder
osVersionMatches(String osVersionRegex)
Configure this template to have an os version that matches the regular expressionTemplateBuilder
smallest()
configure this template to the smallest hardware, based on cores, ram, then disk
-
-
-
Method Detail
-
any
TemplateBuilder any()
prime this builder with parameters known to work on the current compute provider.
-
fromHardware
TemplateBuilder fromHardware(Hardware hardware)
Configure this template to require the minimum hardware of the parameter.
-
fromImage
TemplateBuilder fromImage(Image image)
Configure this template to fuzzy-match on the image parameter
-
fromTemplate
TemplateBuilder fromTemplate(Template image)
Configure this template to match the resources of the template parameter.
-
from
TemplateBuilder from(TemplateBuilderSpec spec)
Configure and return this template, updating it with the populated values of the givenspec
.- Since:
- 1.5
-
from
TemplateBuilder from(String spec)
Configure and return this template, updating it with the populated values of the givenspec
. This is especially useful for command-line configuration of aTemplateBuilder
.- Parameters:
spec
- a String in the format specified byTemplateBuilderSpec
- Since:
- 1.5
-
smallest
TemplateBuilder smallest()
configure this template to the smallest hardware, based on cores, ram, then disk
-
fastest
TemplateBuilder fastest()
configure this template to the fastest hardware, based on cpu
-
biggest
TemplateBuilder biggest()
configure this template to the largest hardware, based on cores, ram, then disk
-
hypervisorMatches
TemplateBuilder hypervisorMatches(String hypervisorRegex)
Configure this template to have an hypervisor that matches the regular expression
-
osFamily
TemplateBuilder osFamily(OsFamily os)
Configure this template to use a specific operating system image.
-
locationId
TemplateBuilder locationId(String locationId)
Configure this template to start in a specific location- Throws:
NoSuchElementException
- if no location matches the id specified
-
imageId
TemplateBuilder imageId(String imageId)
Configure this template to require a specific imageId. Note that image Ids are often scoped tolocation
-
hardwareId
TemplateBuilder hardwareId(String hardwareId)
Configure this template to require a specific hardwareId.
-
osNameMatches
TemplateBuilder osNameMatches(String osNameRegex)
Configure this template to have an operating system name that matches the regular expression
-
osDescriptionMatches
TemplateBuilder osDescriptionMatches(String osDescriptionRegex)
Configure this template to have an operating system description that matches the regular expression
-
osVersionMatches
TemplateBuilder osVersionMatches(String osVersionRegex)
Configure this template to have an os version that matches the regular expression
-
osArchMatches
TemplateBuilder osArchMatches(String architecture)
Configure this template to require a specific architecture. ex. virtualizationType or
-
os64Bit
TemplateBuilder os64Bit(boolean is64bit)
Configure this template to require a 64 bit operating system.
-
imageNameMatches
TemplateBuilder imageNameMatches(String imageNameRegex)
Configure this template to have an image name that matches the regular expression
-
imageVersionMatches
TemplateBuilder imageVersionMatches(String imageVersionRegex)
Configure this template to have an image version that matches the regular expression
-
imageDescriptionMatches
TemplateBuilder imageDescriptionMatches(String imageDescriptionRegex)
Configure this template to have an image description that matches the regular expression
-
imageMatches
TemplateBuilder imageMatches(com.google.common.base.Predicate<Image> condition)
Configure this template to have an image that matches the supplied condition ex.builder.imageMatches(ImagePredicates.userMetadataContains("author", "sue"));
-
imageChooser
TemplateBuilder imageChooser(com.google.common.base.Function<Iterable<? extends Image>,Image> imageChooser)
Configure this template with a specific preference function which operates on images which match the other criteria.If no function is supplied, jclouds will select one according to an internal strategy. This strategy may change from version to version.
-
minCores
TemplateBuilder minCores(double minCores)
Configure this template to require the minimum cores below
-
minRam
TemplateBuilder minRam(int megabytes)
Configure this template to require the minimum ram in megabytes below
-
minDisk
TemplateBuilder minDisk(double gigabytes)
Configure this template with required minimum disk space in gigabytes
-
build
Template build()
Generate an immutable template from the current builder.
-
options
TemplateBuilder options(TemplateOptions options)
Sets options on the template (i.e. items which adorn a created node rather than restricting selection of the node). Note that this method typically replaces any options previously specified in the builder. Normal usage is to build up all options and pass them to the builder with a single call to this method.
-
forceCacheReload
@Beta TemplateBuilder forceCacheReload()
Forces an image lookup against the provider to reload the image cache.Use with caution. In some providers getting the list of images is an expensive operation, and the use of the image cache is recommended. If there is a need to minimize the amount of time the images are cached, consider configuring the cache expiration time by setting the
Constants.PROPERTY_SESSION_INTERVAL
property.- Since:
- 2.0
-
-