|
||||||||||
| 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()
|
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 org.jclouds.domain.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 NodeMetadata> |
listNodesByIds(Iterable<String> ids)
|
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. |
Set<? extends NodeMetadata> |
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. |
Set<? extends NodeMetadata> |
resumeNodesMatching(com.google.common.base.Predicate<NodeMetadata> filter)
nodes matching the filter are treated as a logical set. |
ExecResponse |
runScriptOnNode(String id,
org.jclouds.scriptbuilder.domain.Statement runScript)
|
ExecResponse |
runScriptOnNode(String id,
org.jclouds.scriptbuilder.domain.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,
org.jclouds.scriptbuilder.domain.Statement runScript)
|
Map<? extends NodeMetadata,ExecResponse> |
runScriptOnNodesMatching(com.google.common.base.Predicate<NodeMetadata> filter,
org.jclouds.scriptbuilder.domain.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,
org.jclouds.scriptbuilder.domain.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<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()
Image getImage(String id)
Set<? extends ComputeMetadata> listNodes()
NodeMetadata objects.Set<? extends NodeMetadata> listNodesByIds(Iterable<String> ids)
Set<? extends org.jclouds.domain.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 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().
RunNodesExceptionvoid resumeNode(String id)
suspended state,
given its id.
Set<? extends NodeMetadata> 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/resumeSet<? extends NodeMetadata> 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)
Set<? extends NodeMetadata> 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.
Map<? extends NodeMetadata,ExecResponse> runScriptOnNodesMatching(com.google.common.base.Predicate<NodeMetadata> filter,
String runScript)
throws RunScriptOnNodesException
RunScriptOnNodesExceptionrunScriptOnNodesMatching(Predicate, Statement, RunScriptOptions)
Map<? extends NodeMetadata,ExecResponse> runScriptOnNodesMatching(com.google.common.base.Predicate<NodeMetadata> filter,
org.jclouds.scriptbuilder.domain.Statement runScript)
throws RunScriptOnNodesException
RunScriptOnNodesExceptionrunScriptOnNodesMatching(Predicate, Statement, RunScriptOptions)
Map<? extends NodeMetadata,ExecResponse> runScriptOnNodesMatching(com.google.common.base.Predicate<NodeMetadata> filter,
String runScript,
RunScriptOptions options)
throws RunScriptOnNodesException
RunScriptOnNodesExceptionrunScriptOnNodesMatching(Predicate, Statement, RunScriptOptions)
Map<? extends NodeMetadata,ExecResponse> runScriptOnNodesMatching(com.google.common.base.Predicate<NodeMetadata> filter,
org.jclouds.scriptbuilder.domain.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.runningInGroup(String),
Statements
ExecResponse runScriptOnNode(String id,
org.jclouds.scriptbuilder.domain.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 Timeouts#scriptCompleteNodePredicates.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 credentials
NoSuchElementException - if the node is not found
IllegalStateException - if the node is not in running stateNodePredicates.runningInGroup(String),
Statements
@Beta
com.google.common.util.concurrent.ListenableFuture<ExecResponse> submitScriptOnNode(String id,
org.jclouds.scriptbuilder.domain.Statement runScript,
RunScriptOptions options)
ExecResponse runScriptOnNode(String id,
org.jclouds.scriptbuilder.domain.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)@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
implemented
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||