public interface MachineProvisioningLocation<T extends MachineLocation> extends ProvisioningLocation<T>
Location
to add the ability to provision MachineLocation
s in this location.BrooklynObject.RelationSupport<T extends BrooklynObject>, BrooklynObject.SubscriptionSupport, BrooklynObject.TagSupport
Configurable.ConfigurationSupport
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
getProvisioningFlags(java.util.Collection<java.lang.String> tags)
Gets flags, suitable as an argument to
obtain(Map) . |
MachineProvisioningLocation<T> |
newSubLocation(java.util.Map<?,?> newFlags)
Creates a new location of the same type, but with additional creation instructions in the form of flags,
e.g.
|
T |
obtain(java.util.Map<?,?> flags)
Obtain a machine in this location.
|
void |
release(T machine)
Release a previously-obtained machine.
|
containsLocation, getAllConfig, getChildren, getConfig, getDisplayName, getExtension, getId, getParent, hasConfig, hasExtension, relations, setParent, toVerboseString
getCatalogItemId, subscriptions, tags
config, getConfig, setConfig
T obtain(java.util.Map<?,?> flags) throws NoMachinesAvailableException
obtain
in interface ProvisioningLocation<T extends MachineLocation>
flags
- Details of the desired machine (e.g. image, size, open ports, etc; some flag support is limited to selected providers).
"callerContext" can be specified to have custom logging and error messages (useful if starting machines in parallel)NoMachinesAvailableException
- if there are no machines available in this location (or impls may return null, but that is discouraged)MachineProvisioningLocation<T> newSubLocation(java.util.Map<?,?> newFlags)
Implementers who wish to subclass this provisioning location for additional functionality in a specific cloud can use the relevant implementation of this method as a guide.
void release(T machine)
release
in interface ProvisioningLocation<T extends MachineLocation>
machine
- a MachineLocation
previously obtained from a call to #obtain()
java.lang.IllegalStateException
- if the machine did not come from a call to #obtain()
or it has already been released.java.util.Map<java.lang.String,java.lang.Object> getProvisioningFlags(java.util.Collection<java.lang.String> tags)
obtain(Map)
. The tags provided give
hints about the machine required. The provisioning-location could be configured to
understand those tags.
For example, an AWS-location could be configured to understand that a particular entity
type (e.g. "TomcatServer") requires a particular AMI in that region, so would return the
required image id.tags
-