public class JcloudsSshMachineLocation extends SshMachineLocation implements JcloudsMachineLocation
BrooklynObject.TagSupport
Configurable.ConfigurationSupport
BrooklynObjectInternal.ConfigurationSupportInternal
ALL_SSH_CONFIG_KEY_NAMES, ALL_SSH_CONFIG_KEYS, ALLOCATE_PTY, CLOSE_CONNECTION, DETECT_MACHINE_DETAILS, LOCAL_TEMP_DIR, LOG_PREFIX, logSsh, MACHINE_DETAILS, NO_STDERR_LOGGING, NO_STDOUT_LOGGING, PASSWORD, PRIVATE_KEY_DATA, PRIVATE_KEY_FILE, PRIVATE_KEY_PASSPHRASE, REUSABLE_SSH_PROPS, SCP_EXECUTABLE, SCRIPT_DIR, SSH_CACHE_EXPIRY_DURATION, SSH_CONFIG_GIVEN_TO_PROPS, SSH_ENV_MAP, SSH_EXECUTABLE, SSH_HOST, SSH_PORT, STDERR, STDOUT, UNIQUE_ID
PARENT_LOCATION, TEMPORARY_LOCATION
FINAL_SPEC, NAMED_SPEC_NAME, ORIGINAL_SPEC
Constructor and Description |
---|
JcloudsSshMachineLocation() |
JcloudsSshMachineLocation(java.util.Map<?,?> flags,
JcloudsLocation jcloudsParent,
org.jclouds.compute.domain.NodeMetadata node)
Deprecated.
since 0.6; use LocationSpec (which calls no-arg constructor)
|
Modifier and Type | Method and Description |
---|---|
void |
execRemoteScript(java.lang.String... commands)
uses submitRunScript to execute the commands, and throws error if it fails or returns non-zero
|
java.lang.String |
getHostname()
note
|
java.lang.String |
getJcloudsId() |
org.jclouds.compute.domain.NodeMetadata |
getNode() |
JcloudsLocation |
getParent()
Get the 'parent' of this location.
|
java.util.Set<java.lang.String> |
getPrivateAddresses()
All private IP addresses.
|
java.util.Set<java.lang.String> |
getPublicAddresses()
All public IP addresses, potentially including shared ips.
|
java.lang.String |
getSubnetHostname()
In most clouds, the public hostname is the only way to ensure VMs in different zones can access each other.
|
java.lang.String |
getSubnetIp()
returns an IP for use internally within a subnet / VPC
|
org.jclouds.compute.domain.Template |
getTemplate() |
void |
init()
Called by framework (in new-style instances where spec was used) after configuring etc,
but before a reference to this instance is shared.
|
void |
rebind()
Called by framework on rebind (in new-style instances):
after configuring, but
before the instance is managed, and
before adjuncts are attached to entities, and
before a reference to an object is shared.
|
com.google.common.util.concurrent.ListenableFuture<org.jclouds.compute.domain.ExecResponse> |
submitRunScript(org.jclouds.scriptbuilder.domain.Statement script) |
com.google.common.util.concurrent.ListenableFuture<org.jclouds.compute.domain.ExecResponse> |
submitRunScript(org.jclouds.scriptbuilder.domain.Statement script,
org.jclouds.compute.options.RunScriptOptions options) |
com.google.common.util.concurrent.ListenableFuture<org.jclouds.compute.domain.ExecResponse> |
submitRunScript(java.lang.String... statements)
executes the given statements on the server using jclouds ScriptBuilder,
wrapping in a script which is polled periodically.
|
java.util.Map<java.lang.String,java.lang.String> |
toMetadataRecord()
Get a record of the metadata of this location.
|
java.lang.String |
toVerboseString() |
java.lang.String |
waitForPassword()
Retrieves the password for this VM, if one exists.
|
acquireMutex, close, configure, copyFrom, copyFrom, copyTo, copyTo, copyTo, copyTo, copyTo, copyTo, copyTo, copyTo, copyTo, copyTo, execCommands, execCommands, execCommands, execCommands, execScript, execScript, execScript, execScript, findKeyPair, findPassword, getAddress, getMachineDetails, getOsDetails, getPort, getSshHostAndPort, getUser, hasMutex, installTo, installTo, installTo, installTo, isSshable, obtainPort, obtainSpecificPort, releaseMutex, releasePort, toString, tryAcquireMutex
addChild, addExtension, config, containsLocation, equals, getAllConfig, getAllConfigBag, getChildren, getConfig, getConfig, getDisplayName, getExtension, getHostGeoInfo, getLocalConfigBag, getRawLocalConfigBag, getRebindSupport, hasConfig, hasExtension, hashCode, isManaged, onManagementStarted, onManagementStopped, removeChild, setConfig, setDisplayName, setHostGeoInfo, setManagementContext, setName, setParent, setParent
getCatalogItemId, getId, getManagementContext, getTagSupport, setCatalogItemId, tags
getPort, getUser
getAddress, getMachineDetails, getOsDetails
containsLocation, getAllConfig, getChildren, getConfig, getConfig, getDisplayName, getExtension, getId, hasConfig, hasExtension, setParent
getCatalogItemId, getTagSupport, tags
config, setConfig
getManagementContext
setCatalogItemId
public JcloudsSshMachineLocation()
@Deprecated public JcloudsSshMachineLocation(java.util.Map<?,?> flags, JcloudsLocation jcloudsParent, org.jclouds.compute.domain.NodeMetadata node)
public void init()
AbstractBrooklynObject
To preserve backwards compatibility for if the instance is constructed directly, one can call the code below, but that means it will be called after references to this policy have been shared with other entities.
if (isLegacyConstruction()) {
init();
}
init
in class AbstractBrooklynObject
public void rebind()
AbstractBrooklynObject
AbstractBrooklynObject.init()
will not be called on rebind.
If you need to intercept behaviour after adjuncts are attached,
consider AbstractEntity.onManagementStarting()
(but probably worth raising a discussion on the mailing list!)
rebind
in class AbstractBrooklynObject
public java.lang.String toVerboseString()
toVerboseString
in interface Location
toVerboseString
in class SshMachineLocation
public org.jclouds.compute.domain.NodeMetadata getNode()
getNode
in interface JcloudsMachineLocation
public org.jclouds.compute.domain.Template getTemplate()
getTemplate
in interface JcloudsMachineLocation
public JcloudsLocation getParent()
Location
null
if this location is the tree root.getParent
in interface JcloudsMachineLocation
getParent
in interface Location
getParent
in class AbstractLocation
null
if this location is the tree root.public java.lang.String getHostname()
HasNetworkAddresses
getHostname
in interface HasNetworkAddresses
getHostname
in class SshMachineLocation
public java.util.Set<java.lang.String> getPublicAddresses()
HasNetworkAddresses
getPublicAddresses
in interface HasNetworkAddresses
getPublicAddresses
in class SshMachineLocation
public java.util.Set<java.lang.String> getPrivateAddresses()
HasNetworkAddresses
getPrivateAddresses
in interface HasNetworkAddresses
getPrivateAddresses
in class SshMachineLocation
public java.lang.String getSubnetHostname()
getSubnetHostname
in interface HasSubnetHostname
getSubnetHostname
in interface JcloudsMachineLocation
public java.lang.String getSubnetIp()
HasSubnetHostname
getSubnetIp
in interface HasSubnetHostname
public java.lang.String getJcloudsId()
getJcloudsId
in interface JcloudsMachineLocation
public com.google.common.util.concurrent.ListenableFuture<org.jclouds.compute.domain.ExecResponse> submitRunScript(java.lang.String... statements)
public com.google.common.util.concurrent.ListenableFuture<org.jclouds.compute.domain.ExecResponse> submitRunScript(org.jclouds.scriptbuilder.domain.Statement script)
public com.google.common.util.concurrent.ListenableFuture<org.jclouds.compute.domain.ExecResponse> submitRunScript(org.jclouds.scriptbuilder.domain.Statement script, org.jclouds.compute.options.RunScriptOptions options)
public void execRemoteScript(java.lang.String... commands)
public java.lang.String waitForPassword()
public java.util.Map<java.lang.String,java.lang.String> toMetadataRecord()
LocationInternal
Metadata records are used to record an audit trail of events relating to location usage (for billing purposes, for example). Implementations (and subclasses) should override this method to return information useful for this purpose.
toMetadataRecord
in interface LocationInternal
toMetadataRecord
in class AbstractLocation