public interface ComputeService
Modifier and Type | Method and Description |
---|---|
Set<? extends NodeMetadata> |
createNodesInGroup(String group,
int count)
Like
createNodesInGroup(String,int,TemplateOptions) , except that the
options are default, as specified in templateOptions() . |
Set<? extends NodeMetadata> |
createNodesInGroup(String group,
int count,
Template template)
The compute api treats nodes as a group based on the name you specify.
|
Set<? extends NodeMetadata> |
createNodesInGroup(String group,
int count,
TemplateOptions templateOptions)
Like
createNodesInGroup(String,int,Template) , except that the template
is default, equivalent to templateBuilder().any().options(templateOptions) . |
void |
destroyNode(String id)
destroy the node, given its id.
|
Set<? extends NodeMetadata> |
destroyNodesMatching(com.google.common.base.Predicate<? super NodeMetadata> filter)
nodes matching the filter are treated as a logical set.
|
ComputeServiceContext |
getContext() |
Image |
getImage(String id)
Find an image by its id.
|
com.google.common.base.Optional<ImageExtension> |
getImageExtension()
Returns the
ImageExtension for this provider if it implements it. |
NodeMetadata |
getNodeMetadata(String id)
Find a node by its id.
|
com.google.common.base.Optional<SecurityGroupExtension> |
getSecurityGroupExtension()
Returns the
SecurityGroupExtension for this provider if it implements it. |
Set<? extends Location> |
listAssignableLocations()
The list locations command returns all the valid locations for nodes.
|
Set<? extends Hardware> |
listHardwareProfiles()
The list hardware profiles command shows you the options including virtual cpu count, memory,
and disks.
|
Set<? extends Image> |
listImages()
Images define the operating system and metadata related to a node.
|
Set<? extends ComputeMetadata> |
listNodes() |
Set<? extends ComputeMetadata> |
listNodesByIds(Iterable<String> ids) |
Set<? extends NodeMetadata> |
listNodesDetailsMatching(com.google.common.base.Predicate<? super NodeMetadata> filter)
get all nodes including details such as image and ip addresses even if it incurs extra
requests to the service.
|
void |
rebootNode(String id)
reboot the node, given its id.
|
Set<? extends NodeMetadata> |
rebootNodesMatching(com.google.common.base.Predicate<? super NodeMetadata> filter)
nodes matching the filter are treated as a logical set.
|
void |
resumeNode(String id)
resume the node from
suspended state,
given its id. |
Set<? extends NodeMetadata> |
resumeNodesMatching(com.google.common.base.Predicate<? super NodeMetadata> filter)
nodes matching the filter are treated as a logical set.
|
ExecResponse |
runScriptOnNode(String id,
Statement runScript) |
ExecResponse |
runScriptOnNode(String id,
Statement runScript,
RunScriptOptions options)
Run the script on a specific node
|
ExecResponse |
runScriptOnNode(String id,
String runScript) |
ExecResponse |
runScriptOnNode(String id,
String runScript,
RunScriptOptions options) |
Map<? extends NodeMetadata,ExecResponse> |
runScriptOnNodesMatching(com.google.common.base.Predicate<? super NodeMetadata> filter,
Statement runScript) |
Map<? extends NodeMetadata,ExecResponse> |
runScriptOnNodesMatching(com.google.common.base.Predicate<? super NodeMetadata> filter,
Statement runScript,
RunScriptOptions options)
Run the script on all nodes with the specific predicate.
|
Map<? extends NodeMetadata,ExecResponse> |
runScriptOnNodesMatching(com.google.common.base.Predicate<? super NodeMetadata> filter,
String runScript) |
Map<? extends NodeMetadata,ExecResponse> |
runScriptOnNodesMatching(com.google.common.base.Predicate<? super NodeMetadata> filter,
String runScript,
RunScriptOptions options) |
com.google.common.util.concurrent.ListenableFuture<ExecResponse> |
submitScriptOnNode(String id,
Statement runScript,
RunScriptOptions options) |
com.google.common.util.concurrent.ListenableFuture<ExecResponse> |
submitScriptOnNode(String id,
String runScript,
RunScriptOptions options)
Run the script on a specific node in the background, typically as
nohup |
void |
suspendNode(String id)
suspend the node, given its id.
|
Set<? extends NodeMetadata> |
suspendNodesMatching(com.google.common.base.Predicate<? super NodeMetadata> filter)
nodes matching the filter are treated as a logical set.
|
TemplateBuilder |
templateBuilder()
Makes a new template builder for this service
|
TemplateOptions |
templateOptions()
Makes a new set of options for running nodes
|
ComputeServiceContext getContext()
TemplateBuilder templateBuilder()
TemplateOptions templateOptions()
Set<? extends Hardware> listHardwareProfiles()
Set<? extends Image> listImages()
Image getImage(String id)
Set<? extends ComputeMetadata> listNodes()
NodeMetadata
objects.Set<? extends ComputeMetadata> listNodesByIds(Iterable<String> ids)
Set<? extends Location> listAssignableLocations()
Set<? extends NodeMetadata> createNodesInGroup(String group, int count, Template template) throws RunNodesException
if (node.getCredentials().key.startsWith("-----BEGIN RSA PRIVATE KEY-----")) // it is a private key, not a password.Note. if all you want to do is execute a script at bootup, you should consider use of the runscript option. If resources such as security groups are needed, they will be reused or created for you. Inbound port 22 will always be opened up.
group
- - common identifier to group nodes bycount
- - how many to fire up.template
- - how to configure the nodesRunNodesException
- when there's a problem applying options to nodes. Note that successful and failed
nodes are a part of this exception, so be sure to inspect this carefully.Set<? extends NodeMetadata> createNodesInGroup(String group, int count, TemplateOptions templateOptions) throws RunNodesException
createNodesInGroup(String,int,Template)
, except that the template
is default, equivalent to templateBuilder().any().options(templateOptions)
.RunNodesException
Set<? extends NodeMetadata> createNodesInGroup(String group, int count) throws RunNodesException
createNodesInGroup(String,int,TemplateOptions)
, except that the
options are default, as specified in templateOptions()
.RunNodesException
void resumeNode(String id)
suspended
state,
given its id.
Set<? extends NodeMetadata> resumeNodesMatching(com.google.common.base.Predicate<? super NodeMetadata> filter)
UnsupportedOperationException
- if the underlying provider doesn't support suspend/resumeNoSuchElementException
- if no nodes matched the predicate specifiedvoid suspendNode(String id)
suspended
state.
UnsupportedOperationException
- if the underlying provider doesn't support suspend/resumeSet<? extends NodeMetadata> suspendNodesMatching(com.google.common.base.Predicate<? super NodeMetadata> filter)
UnsupportedOperationException
- if the underlying provider doesn't support suspend/resumeNoSuchElementException
- if no nodes matched the predicate specifiedvoid destroyNode(String id)
Set<? extends NodeMetadata> destroyNodesMatching(com.google.common.base.Predicate<? super NodeMetadata> filter)
void rebootNode(String id)
Set<? extends NodeMetadata> rebootNodesMatching(com.google.common.base.Predicate<? super NodeMetadata> filter)
NoSuchElementException
- if no nodes matched the predicate specifiedNodeMetadata getNodeMetadata(String id)
Set<? extends NodeMetadata> listNodesDetailsMatching(com.google.common.base.Predicate<? super NodeMetadata> filter)
filter
- how to select the nodes you are interested in details on.Map<? extends NodeMetadata,ExecResponse> runScriptOnNodesMatching(com.google.common.base.Predicate<? super NodeMetadata> filter, String runScript) throws RunScriptOnNodesException
Map<? extends NodeMetadata,ExecResponse> runScriptOnNodesMatching(com.google.common.base.Predicate<? super NodeMetadata> filter, Statement runScript) throws RunScriptOnNodesException
Map<? extends NodeMetadata,ExecResponse> runScriptOnNodesMatching(com.google.common.base.Predicate<? super NodeMetadata> filter, String runScript, RunScriptOptions options) throws RunScriptOnNodesException
Map<? extends NodeMetadata,ExecResponse> runScriptOnNodesMatching(com.google.common.base.Predicate<? super NodeMetadata> filter, Statement runScript, RunScriptOptions options) throws RunScriptOnNodesException
filter
- Predicate-based filter to define on which nodes the script is to be executedrunScript
- statement containing the script to runoptions
- nullable options to how to run the script, whether to override credentialsNoSuchElementException
- if no nodes matched the predicate specifiedRunScriptOnNodesException
- if anything goes wrong during script executionNodePredicates.runningInGroup(String)
,
Statements
ExecResponse runScriptOnNode(String id, Statement runScript, RunScriptOptions options)
id
- node the script is to be executed onrunScript
- statement containing the script to runoptions
- nullable options to how to run the script, whether to override credentialsNoSuchElementException
- if the node is not foundIllegalStateException
- if the node is not in running stateScriptStillRunningException
- if the script was still running after Timeouts#scriptComplete
NodePredicates.runningInGroup(String)
,
Statements
@Beta com.google.common.util.concurrent.ListenableFuture<ExecResponse> submitScriptOnNode(String id, String runScript, RunScriptOptions options)
nohup
id
- node the script is to be executed onrunScript
- statement containing the script to runoptions
- nullable options to how to run the script, whether to override credentialsNoSuchElementException
- if the node is not foundIllegalStateException
- if the node is not in running stateNodePredicates.runningInGroup(String)
,
Statements
@Beta com.google.common.util.concurrent.ListenableFuture<ExecResponse> submitScriptOnNode(String id, Statement runScript, RunScriptOptions options)
ExecResponse runScriptOnNode(String id, Statement runScript)
ExecResponse runScriptOnNode(String id, String runScript, RunScriptOptions options)
ExecResponse runScriptOnNode(String id, String runScript)
@Beta com.google.common.base.Optional<ImageExtension> getImageExtension()
ImageExtension
for this provider if it implements it.ImageExtension
or Optional.absent()
if not
implemented@Beta com.google.common.base.Optional<SecurityGroupExtension> getSecurityGroupExtension()
SecurityGroupExtension
for this provider if it implements it.SecurityGroupExtension
or Optional.absent()
if not
implementedCopyright © 2009-2016 The Apache Software Foundation. All Rights Reserved.