@Singleton public class TerremarkVCloudComputeClient extends Object
Modifier and Type | Field and Description |
---|---|
protected TerremarkVCloudClient |
client |
protected InternetServiceAndPublicIpAddressSupplier |
internetServiceAndPublicIpAddressSupplier |
protected Logger |
logger |
protected Provider<String> |
passwordGenerator |
protected com.google.common.base.Predicate<URI> |
taskTester |
protected Map<Status,NodeState> |
vAppStatusToNodeState |
Modifier | Constructor and Description |
---|---|
protected |
TerremarkVCloudComputeClient(TerremarkVCloudClient client,
Provider<String> passwordGenerator,
com.google.common.base.Predicate<URI> successTester,
Map<Status,NodeState> vAppStatusToNodeState,
Map<String,Credentials> credentialStore,
InternetServiceAndPublicIpAddressSupplier internetServiceAndPublicIpAddressSupplier) |
Modifier and Type | Method and Description |
---|---|
String |
createPublicAddressMappedToPorts(URI vAppId,
int... ports) |
protected void |
deleteVApp(VApp vApp) |
Set<String> |
getPrivateAddresses(URI id)
returns a set of addresses that are only visible to the private network.
|
Set<String> |
getPublicAddresses(URI id)
returns a set of addresses that are publically visible
|
protected Status |
getStatus(VApp vApp) |
protected Task |
powerOff(VApp vApp) |
protected VApp |
refreshVApp(URI id) |
void |
reset(URI id)
reboots the vApp, blocking until the following state transition is
complete:
current ->
VAppStatus#OFF -> VAppStatus#ON |
protected Task |
reset(VApp vApp) |
VApp |
start(URI VDC,
URI templateId,
String name,
InstantiateVAppTemplateOptions options,
int... portsToOpen)
Runs through all commands necessary to startup a vApp, opening at least
one ip address to the public network.
|
ComputeServiceAdapter.NodeAndInitialCredentials<VApp> |
startAndReturnCredentials(URI VDC,
URI templateId,
String name,
InstantiateVAppTemplateOptions options,
int... portsToOpen) |
void |
stop(URI id)
Destroys dependent resources, powers off and deletes the vApp, blocking
until the following state transition is complete:
current ->
VAppStatus#OFF -> deleted
* deletes the internet service and nodes associated with the vapp. |
protected Task |
undeploy(VApp vApp) |
protected final TerremarkVCloudClient client
protected final InternetServiceAndPublicIpAddressSupplier internetServiceAndPublicIpAddressSupplier
protected final com.google.common.base.Predicate<URI> taskTester
@Inject protected TerremarkVCloudComputeClient(TerremarkVCloudClient client, @Named(value="PASSWORD") Provider<String> passwordGenerator, com.google.common.base.Predicate<URI> successTester, Map<Status,NodeState> vAppStatusToNodeState, Map<String,Credentials> credentialStore, InternetServiceAndPublicIpAddressSupplier internetServiceAndPublicIpAddressSupplier)
public ComputeServiceAdapter.NodeAndInitialCredentials<VApp> startAndReturnCredentials(@Nullable URI VDC, URI templateId, String name, InstantiateVAppTemplateOptions options, int... portsToOpen)
public VApp start(@Nullable URI VDC, URI templateId, String name, InstantiateVAppTemplateOptions options, int... portsToOpen)
VAppStatus#ON
VDC
- id of the virtual datacenter VCloudClient#getDefaultVDC
templateId
- id of the vAppTemplate you wish to instantiatename
- name of the vAppcores
- amount of virtual cpu coresmegs
- amount of ram in megabytesoptions
- options for instantiating the vApp; null is okportsToOpen
- opens the following ports on the public ip addresspublic String createPublicAddressMappedToPorts(URI vAppId, int... ports)
public void stop(URI id)
VAppStatus#OFF
-> deleted
* deletes the internet service and nodes associated with the vapp. Deletes
the IP address, if there are no others using it. Finally, it powers off
and deletes the vapp. Note that we do not call undeploy, as terremark does
not support the command.vAppId
- vApp to stoppublic Set<String> getPrivateAddresses(URI id)
public Set<String> getPublicAddresses(URI id)
public void reset(URI id)
VAppStatus#OFF
-> VAppStatus#ON
vAppId
- vApp to rebootprotected void deleteVApp(VApp vApp)
Copyright © 2009-2012 jclouds. All Rights Reserved.