Brooklyn

brooklyn.location.jclouds
[Java] Class JcloudsLocation

java.lang.Object
  brooklyn.location.basic.AbstractLocation
      brooklyn.location.cloud.AbstractCloudMachineProvisioningLocation
          brooklyn.location.jclouds.JcloudsLocation
All Implemented Interfaces:
JcloudsLocationConfig

public class JcloudsLocation
extends AbstractCloudMachineProvisioningLocation

For provisioning and managing VMs in a particular provider/region, using jclouds. Configuration flags are defined in JcloudsLocationConfig.


Field Summary
static Logger LOG

static java.util.List NON_ADDABLE_USERS

static java.util.List ROOT_ALIASES

these userNames are known to be the preferred/required logins in some common/default images where root@ is not allowed to log in

static java.lang.String ROOT_USERNAME

static java.util.Map SUPPORTED_TEMPLATE_BUILDER_PROPERTIES

properties which cause customization of the TemplateBuilder

static java.util.Map SUPPORTED_TEMPLATE_OPTIONS_PROPERTIES

properties which cause customization of the TemplateOptions

 
Fields inherited from class AbstractLocation
LOG, PARENT_LOCATION, hostGeoInfo, name
 
Constructor Summary
JcloudsLocation(java.util.Map conf)

typically wants at least ACCESS_IDENTITY and ACCESS_CREDENTIAL

JcloudsLocation(java.lang.String identity, java.lang.String credential, java.lang.String providerLocationId)

@deprecated since 0.5.0 use map-based constructor

 
Method Summary
static java.io.File asFile(java.lang.Object o)

protected Template buildTemplate(ComputeService computeService, ConfigBag config)

returns the jclouds Template which describes the image to be built

protected void configure(java.util.Map properties)

protected JcloudsSshMachineLocation createJcloudsSshMachineLocation(NodeMetadata node, java.lang.String vmHostname, ConfigBag setup)

protected java.util.Map extractSshConfig(ConfigBag setup, NodeMetadata node)

protected LoginCredentials extractVmCredentials(ConfigBag setup, NodeMetadata node)

static java.lang.String fileAsString(java.lang.Object o)

static java.util.Set getAllSupportedProperties()

ComputeService getComputeService()

ComputeService getComputeService(java.util.Map flags)

java.lang.String getCredential()

protected java.util.Collection getCustomizers(ConfigBag setup)

java.lang.String getEndpoint()

java.lang.String getIdentity()

java.lang.String getJcloudsProviderLocationId()

@deprecated since 0.5.0 use getRegion

java.lang.String getProvider()

java.util.Map getProvisioningFlags(java.util.Collection tags)

java.lang.String getRegion()

returns the location ID used by the provider, if set, e.g. us-west-1

java.lang.String getUser(ConfigBag config)

java.util.Set listNodes()

java.util.Set listNodes(java.util.Map flags)

JcloudsLocation newSubLocation(java.util.Map newFlags)

JcloudsSshMachineLocation obtain()

JcloudsSshMachineLocation obtain(TemplateBuilder tb)

JcloudsSshMachineLocation obtain(java.util.Map flags, TemplateBuilder tb)

JcloudsSshMachineLocation obtain(java.util.Map flags)

core method for obtaining a VM using jclouds; Map should contain CLOUD_PROVIDER and CLOUD_ENDPOINT or CLOUD_REGION, depending on the cloud, as well as ACCESS_IDENTITY and ACCESS_CREDENTIAL, plus any further properties to specify e.g. images, hardware profiles, accessing user (for initial login, and a user potentially to create for subsequent ie normal access)

JcloudsSshMachineLocation rebindMachine(NodeMetadata metadata)

JcloudsSshMachineLocation rebindMachine(java.util.Map flags, NodeMetadata metadata)

JcloudsSshMachineLocation rebindMachine(ConfigBag setup)

Brings an existing machine with the given details under management.

JcloudsSshMachineLocation rebindMachine(java.util.Map flags)

protected JcloudsSshMachineLocation registerJcloudsSshMachineLocation(NodeMetadata node, java.lang.String vmHostname, ConfigBag setup)

void release(SshMachineLocation machine)

protected void setCreationString(ConfigBag config)

attaches a string describing where something is being created (provider, region/location and/or endpoint, callerContext)

void setDefaultImageId(java.lang.String val)

protected boolean setHostname(ConfigBag setup, NodeMetadata metadata, boolean rethrow)

protected void setHostnameUpdatingCredentials(ConfigBag setup, NodeMetadata metadata)

void setTagMapping(java.util.Map val)

protected static byte[] toByteArray(java.lang.Object v)

protected static double toDouble(java.lang.Object v)

protected static int[] toIntArray(java.lang.Object v)

protected static java.util.Map toMapStringString(java.lang.Object v)

java.lang.String toString()

protected static java.lang.String[] toStringArray(java.lang.Object v)

protected void waitForReachable(ComputeService computeService, NodeMetadata node, LoginCredentials expectedCredentials, ConfigBag setup)

 
Methods inherited from class AbstractCloudMachineProvisioningLocation
extractSshConfig, getProvisioningFlags, newSubLocation
 
Methods inherited from class AbstractLocation
addChildLocation, configure, configure, containsLocation, equals, findLocationProperty, getAllConfig, getChildLocations, getConfig, getConfigBag, getHostGeoInfo, getId, getLocationProperty, getName, getParentLocation, getRebindSupport, hasConfig, hasLocationProperty, hashCode, removeChildLocation, setConfig, setHostGeoInfo, setName, setParentLocation, string, toString
 

Field Detail

LOG

public static final Logger LOG


NON_ADDABLE_USERS

public static final java.util.List NON_ADDABLE_USERS


ROOT_ALIASES

public static final java.util.List ROOT_ALIASES
these userNames are known to be the preferred/required logins in some common/default images where root@ is not allowed to log in


ROOT_USERNAME

public static final java.lang.String ROOT_USERNAME


SUPPORTED_TEMPLATE_BUILDER_PROPERTIES

public static final java.util.Map SUPPORTED_TEMPLATE_BUILDER_PROPERTIES
properties which cause customization of the TemplateBuilder


SUPPORTED_TEMPLATE_OPTIONS_PROPERTIES

public static final java.util.Map SUPPORTED_TEMPLATE_OPTIONS_PROPERTIES
properties which cause customization of the TemplateOptions


 
Constructor Detail

JcloudsLocation

public JcloudsLocation(java.util.Map conf)
typically wants at least ACCESS_IDENTITY and ACCESS_CREDENTIAL


JcloudsLocation

@Deprecated
public JcloudsLocation(java.lang.String identity, java.lang.String credential, java.lang.String providerLocationId)
deprecated:
since 0.5.0 use map-based constructor


 
Method Detail

asFile

public static java.io.File asFile(java.lang.Object o)


buildTemplate

protected Template buildTemplate(ComputeService computeService, ConfigBag config)
returns the jclouds Template which describes the image to be built


configure

protected void configure(java.util.Map properties)


createJcloudsSshMachineLocation

protected JcloudsSshMachineLocation createJcloudsSshMachineLocation(NodeMetadata node, java.lang.String vmHostname, ConfigBag setup)


extractSshConfig

protected java.util.Map extractSshConfig(ConfigBag setup, NodeMetadata node)


extractVmCredentials

protected LoginCredentials extractVmCredentials(ConfigBag setup, NodeMetadata node)


fileAsString

public static java.lang.String fileAsString(java.lang.Object o)


getAllSupportedProperties

public static final java.util.Set getAllSupportedProperties()


getComputeService

public ComputeService getComputeService()


getComputeService

public ComputeService getComputeService(java.util.Map flags)


getCredential

public java.lang.String getCredential()


getCustomizers

protected java.util.Collection getCustomizers(ConfigBag setup)


getEndpoint

public java.lang.String getEndpoint()


getIdentity

public java.lang.String getIdentity()


getJcloudsProviderLocationId

public java.lang.String getJcloudsProviderLocationId()
deprecated:
since 0.5.0 use getRegion


getProvider

public java.lang.String getProvider()


getProvisioningFlags

public java.util.Map getProvisioningFlags(java.util.Collection tags)


getRegion

public java.lang.String getRegion()
returns the location ID used by the provider, if set, e.g. us-west-1


getUser

public java.lang.String getUser(ConfigBag config)


listNodes

public java.util.Set listNodes()


listNodes

public java.util.Set listNodes(java.util.Map flags)


newSubLocation

public JcloudsLocation newSubLocation(java.util.Map newFlags)


obtain

public JcloudsSshMachineLocation obtain()


obtain

public JcloudsSshMachineLocation obtain(TemplateBuilder tb)


obtain

public JcloudsSshMachineLocation obtain(java.util.Map flags, TemplateBuilder tb)


obtain

public JcloudsSshMachineLocation obtain(java.util.Map flags)
core method for obtaining a VM using jclouds; Map should contain CLOUD_PROVIDER and CLOUD_ENDPOINT or CLOUD_REGION, depending on the cloud, as well as ACCESS_IDENTITY and ACCESS_CREDENTIAL, plus any further properties to specify e.g. images, hardware profiles, accessing user (for initial login, and a user potentially to create for subsequent ie normal access)


rebindMachine

public JcloudsSshMachineLocation rebindMachine(NodeMetadata metadata)


rebindMachine

public JcloudsSshMachineLocation rebindMachine(java.util.Map flags, NodeMetadata metadata)


rebindMachine

public JcloudsSshMachineLocation rebindMachine(ConfigBag setup)
Brings an existing machine with the given details under management.

Required fields are:


rebindMachine

public JcloudsSshMachineLocation rebindMachine(java.util.Map flags)


registerJcloudsSshMachineLocation

protected JcloudsSshMachineLocation registerJcloudsSshMachineLocation(NodeMetadata node, java.lang.String vmHostname, ConfigBag setup)


release

public void release(SshMachineLocation machine)


setCreationString

protected void setCreationString(ConfigBag config)
attaches a string describing where something is being created (provider, region/location and/or endpoint, callerContext)


setDefaultImageId

public void setDefaultImageId(java.lang.String val)


setHostname

protected boolean setHostname(ConfigBag setup, NodeMetadata metadata, boolean rethrow)


setHostnameUpdatingCredentials

protected void setHostnameUpdatingCredentials(ConfigBag setup, NodeMetadata metadata)


setTagMapping

public void setTagMapping(java.util.Map val)


toByteArray

protected static byte[] toByteArray(java.lang.Object v)


toDouble

protected static double toDouble(java.lang.Object v)


toIntArray

protected static int[] toIntArray(java.lang.Object v)


toMapStringString

protected static java.util.Map toMapStringString(java.lang.Object v)


toString

@Override
public java.lang.String toString()


toStringArray

protected static java.lang.String[] toStringArray(java.lang.Object v)


waitForReachable

protected void waitForReachable(ComputeService computeService, NodeMetadata node, LoginCredentials expectedCredentials, ConfigBag setup)


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.