@Override public ListenableFuture<ExecResponse> submitScriptOnNode(String s, String s2, RunScriptOptions runScriptOptions) { return computeService.submitScriptOnNode(s, s2, runScriptOptions); }
@Override public ListenableFuture<ExecResponse> submitScriptOnNode(String s, String s2, RunScriptOptions runScriptOptions) { return computeService.submitScriptOnNode(s, s2, runScriptOptions); }
/** * Run the script on a specific node in the background, typically as {@code nohup} * * @param id node the script is to be executed on * @param runScript statement containing the script to run * @param options nullable options to how to run the script, whether to override credentials * @return map with node identifiers and corresponding responses * @throws java.util.NoSuchElementException * if the node is not found * @throws IllegalStateException if the node is not in running state * @see org.jclouds.compute.predicates.NodePredicates#runningInGroup(String) * @see org.jclouds.scriptbuilder.domain.Statements */ @Override @Beta public ListenableFuture<ExecResponse> submitScriptOnNode(String id, Statement runScript, RunScriptOptions options) { return computeService.submitScriptOnNode(id, runScript, options); }
/** * Run the script on a specific node in the background, typically as {@code nohup} * * @param id node the script is to be executed on * @param runScript statement containing the script to run * @param options nullable options to how to run the script, whether to override credentials * @return map with node identifiers and corresponding responses * @throws java.util.NoSuchElementException * if the node is not found * @throws IllegalStateException if the node is not in running state * @see org.jclouds.compute.predicates.NodePredicates#runningInGroup(String) * @see org.jclouds.scriptbuilder.domain.Statements */ @Override @Beta public ListenableFuture<ExecResponse> submitScriptOnNode(String id, Statement runScript, RunScriptOptions options) { return computeService.submitScriptOnNode(id, runScript, options); }
@Override public ListenableFuture<ExecResponse> submitScriptOnNode(String id, String runScript, RunScriptOptions options) { return delegate.submitScriptOnNode(id, runScript, options); }
@Override public ListenableFuture<ExecResponse> submitScriptOnNode(String id, Statement runScript, RunScriptOptions options) { return delegate.submitScriptOnNode(id, runScript, options); }
public ListenableFuture<ExecResponse> runStatementOnInstanceInCluster(StatementBuilder statementBuilder, Instance instance, ClusterSpec clusterSpec, RunScriptOptions options) { Statement statement = statementBuilder.name(getAction() + "-" + Joiner.on('_').join(instance.getRoles())).build(clusterSpec, instance); ComputeService compute = getCompute().apply(clusterSpec).getComputeService(); return compute.submitScriptOnNode( instance.getId(), statement, options); }
public ListenableFuture<ExecResponse> runStatementOnInstanceInCluster(StatementBuilder statementBuilder, Instance instance, ClusterSpec clusterSpec, RunScriptOptions options) { Statement statement = statementBuilder.name(getAction() + "-" + Joiner.on('_').join(instance.getRoles())).build(clusterSpec, instance); ComputeService compute = getCompute().apply(clusterSpec).getComputeService(); return compute.submitScriptOnNode( instance.getId(), statement, options); }
@Test(enabled = false) protected void weCanCancelTasks(NodeMetadata node) throws InterruptedException, ExecutionException { ListenableFuture<ExecResponse> future = client.submitScriptOnNode(node.getId(), "sleep 300", nameTask("sleeper").runAsRoot(false)); ExecResponse response = null; try { response = future.get(1, TimeUnit.MILLISECONDS); fail(node.getId() + ": " + response); } catch (TimeoutException e) { assert !future.isDone(); response = client.runScriptOnNode(node.getId(), "/tmp/init-sleeper status", wrapInInitScript(false).runAsRoot(false)); assert !response.getOutput().trim().equals("") : node.getId() + ": " + response; future.cancel(true); response = client.runScriptOnNode(node.getId(), "/tmp/init-sleeper status", wrapInInitScript(false).runAsRoot(false)); assert response.getOutput().trim().equals("") : node.getId() + ": " + response; try { future.get(); fail(future.toString()); } catch (CancellationException e1) { } } }
@Test(enabled = false) public void weCanCancelTasks(NodeMetadata node) throws InterruptedException, ExecutionException { ListenableFuture<ExecResponse> future = client.submitScriptOnNode(node.getId(), "sleep 300", nameTask("sleeper").runAsRoot(false)); ExecResponse response = null; try { response = future.get(1, TimeUnit.MILLISECONDS); fail(node.getId() + ": " + response); } catch (TimeoutException e) { assert !future.isDone(); response = client.runScriptOnNode(node.getId(), "/tmp/init-sleeper status", wrapInInitScript(false).runAsRoot(false)); assert !response.getOutput().trim().equals("") : node.getId() + ": " + response; future.cancel(true); response = client.runScriptOnNode(node.getId(), "/tmp/init-sleeper status", wrapInInitScript(false).runAsRoot(false)); assert response.getOutput().trim().equals("") : node.getId() + ": " + response; try { future.get(); fail(future.toString()); } catch (CancellationException e1) { } } }
ListenableFuture<ExecResponse> future = client.submitScriptOnNode(node.getId(), AdminAccess.builder() .adminUsername("foo").adminHome("/over/ridden/foo").build(), nameTask("adminUpdate"));
ListenableFuture<ExecResponse> future = client.submitScriptOnNode(node.getId(), AdminAccess.builder() .adminUsername("foo").adminHome("/over/ridden/foo").build(), nameTask("adminUpdate"));
ListenableFuture<ExecResponse> future = client.submitScriptOnNode(first.getId(), Statements .exec("while true; do true; done"), runAsRoot(false).nameTask("cpuSpinner"));