|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ComputeService
Provides portable access to launching compute instances.
Method Summary | |
---|---|
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<NodeMetadata> filter)
nodes matching the filter are treated as a logical set. |
ComputeServiceContext |
getContext()
|
NodeMetadata |
getNodeMetadata(String id)
Find a node by its id. |
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()
all nodes available to the current user by id. |
Set<? extends NodeMetadata> |
listNodesDetailsMatching(com.google.common.base.Predicate<ComputeMetadata> 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. |
void |
rebootNodesMatching(com.google.common.base.Predicate<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. |
void |
resumeNodesMatching(com.google.common.base.Predicate<NodeMetadata> filter)
nodes matching the filter are treated as a logical set. |
Set<? extends NodeMetadata> |
runNodesWithTag(String tag,
int count)
Deprecated. |
Set<? extends NodeMetadata> |
runNodesWithTag(String tag,
int count,
Template template)
Deprecated. |
Set<? extends NodeMetadata> |
runNodesWithTag(String tag,
int count,
TemplateOptions templateOptions)
Deprecated. |
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<NodeMetadata> filter,
Payload runScript)
Deprecated. |
Map<? extends NodeMetadata,ExecResponse> |
runScriptOnNodesMatching(com.google.common.base.Predicate<NodeMetadata> filter,
Payload runScript,
RunScriptOptions options)
Deprecated. |
Map<? extends NodeMetadata,ExecResponse> |
runScriptOnNodesMatching(com.google.common.base.Predicate<NodeMetadata> filter,
Statement runScript)
|
Map<? extends NodeMetadata,ExecResponse> |
runScriptOnNodesMatching(com.google.common.base.Predicate<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<NodeMetadata> filter,
String runScript)
|
Map<? extends NodeMetadata,ExecResponse> |
runScriptOnNodesMatching(com.google.common.base.Predicate<NodeMetadata> filter,
String runScript,
RunScriptOptions options)
|
com.google.common.util.concurrent.ListenableFuture<ExecResponse> |
submitScriptOnNode(String id,
Statement 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. |
void |
suspendNodesMatching(com.google.common.base.Predicate<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 |
Method Detail |
---|
ComputeServiceContext getContext()
TemplateBuilder templateBuilder()
TemplateOptions templateOptions()
Set<? extends Hardware> listHardwareProfiles()
Set<? extends Image> listImages()
Set<? extends ComputeMetadata> listNodes()
NodeMetadata
objects.
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 by, cannot contain hyphenscount
- - how many to fire up.template
- - how to configure the nodes
RunNodesException
- 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
@Deprecated Set<? extends NodeMetadata> runNodesWithTag(String tag, int count, Template template) throws RunNodesException
RunNodesException
createNodesInGroup(String , int , Template )
@Deprecated Set<? extends NodeMetadata> runNodesWithTag(String tag, int count, TemplateOptions templateOptions) throws RunNodesException
RunNodesException
createNodesInGroup(String , int , TemplateOptions )
@Deprecated Set<? extends NodeMetadata> runNodesWithTag(String tag, int count) throws RunNodesException
RunNodesException
createNodesInGroup(String , int )
void resumeNode(String id)
suspended
state,
given its id.
void resumeNodesMatching(com.google.common.base.Predicate<NodeMetadata> filter)
UnsupportedOperationException
- if the underlying provider doesn't support suspend/resume
NoSuchElementException
- if no nodes matched the predicate specifiedvoid suspendNode(String id)
suspended
state.
UnsupportedOperationException
- if the underlying provider doesn't support suspend/resumevoid suspendNodesMatching(com.google.common.base.Predicate<NodeMetadata> filter)
UnsupportedOperationException
- if the underlying provider doesn't support suspend/resume
NoSuchElementException
- if no nodes matched the predicate specifiedvoid destroyNode(String id)
Set<? extends NodeMetadata> destroyNodesMatching(com.google.common.base.Predicate<NodeMetadata> filter)
void rebootNode(String id)
void rebootNodesMatching(com.google.common.base.Predicate<NodeMetadata> filter)
NoSuchElementException
- if no nodes matched the predicate specifiedNodeMetadata getNodeMetadata(String id)
Set<? extends NodeMetadata> listNodesDetailsMatching(com.google.common.base.Predicate<ComputeMetadata> filter)
filter
- how to select the nodes you are interested in details on.@Deprecated Map<? extends NodeMetadata,ExecResponse> runScriptOnNodesMatching(com.google.common.base.Predicate<NodeMetadata> filter, Payload runScript) throws RunScriptOnNodesException
RunScriptOnNodesException
Payloads
,
runScriptOnNodesMatching(Predicate, Statement, RunScriptOptions)
@Deprecated Map<? extends NodeMetadata,ExecResponse> runScriptOnNodesMatching(com.google.common.base.Predicate<NodeMetadata> filter, Payload runScript, RunScriptOptions options) throws RunScriptOnNodesException
RunScriptOnNodesException
Payloads
,
runScriptOnNodesMatching(Predicate, Statement, RunScriptOptions)
Map<? extends NodeMetadata,ExecResponse> runScriptOnNodesMatching(com.google.common.base.Predicate<NodeMetadata> filter, String runScript) throws RunScriptOnNodesException
RunScriptOnNodesException
runScriptOnNodesMatching(Predicate, Statement, RunScriptOptions)
Map<? extends NodeMetadata,ExecResponse> runScriptOnNodesMatching(com.google.common.base.Predicate<NodeMetadata> filter, Statement runScript) throws RunScriptOnNodesException
RunScriptOnNodesException
runScriptOnNodesMatching(Predicate, Statement, RunScriptOptions)
Map<? extends NodeMetadata,ExecResponse> runScriptOnNodesMatching(com.google.common.base.Predicate<NodeMetadata> filter, String runScript, RunScriptOptions options) throws RunScriptOnNodesException
RunScriptOnNodesException
runScriptOnNodesMatching(Predicate, Statement, RunScriptOptions)
Map<? extends NodeMetadata,ExecResponse> runScriptOnNodesMatching(com.google.common.base.Predicate<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 credentials
NoSuchElementException
- if no nodes matched the predicate specified
RunScriptOnNodesException
- if anything goes wrong during script executionNodePredicates.runningWithTag(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 credentials
NoSuchElementException
- if the node is not found
IllegalStateException
- if the node is not in running state
ScriptStillRunningException
- if the script was still running after ComputeServiceConstants.Timeouts.scriptComplete
NodePredicates.runningWithTag(String)
,
Statements
@Beta com.google.common.util.concurrent.ListenableFuture<ExecResponse> submitScriptOnNode(String id, Statement 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 credentials
NoSuchElementException
- if the node is not found
IllegalStateException
- if the node is not in running stateNodePredicates.runningWithTag(String)
,
Statements
ExecResponse runScriptOnNode(String id, Statement runScript)
runScriptOnNode(String, Statement, RunScriptOptions)
ExecResponse runScriptOnNode(String id, String runScript, RunScriptOptions options)
runScriptOnNode(String, Statement, RunScriptOptions)
,
Statements.exec(java.lang.String)
ExecResponse runScriptOnNode(String id, String runScript)
runScriptOnNode(String, String, RunScriptOptions)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |