Groovy Documentation

org.linkedin.glu.orchestration.engine.commands
[Groovy] Interface CommandsService


interface CommandsService

Authors:
yan@pongasoft.com


Method Summary
java.lang.String executeShellCommand(Fabric fabric, java.lang.String agentName, java.lang.Object args)

Executes the shell command.

DbCommandExecution findCommandExecution(Fabric fabric, java.lang.String commandId)

java.util.Map findCommandExecutions(Fabric fabric, java.lang.String agentName, java.lang.Object params)

java.util.Map findCurrentCommandExecutions()

@return a map with all currently running commands

java.util.Map findCurrentCommandExecutions(java.util.Collection commandIds)

@return a map with all currently running commands (filtered by the commandIds)

boolean interruptCommand(Fabric fabric, java.lang.String agentName, java.lang.String commandId)

Interrupts the command.

java.lang.Object withCommandExecutionAndWithOrWithoutStreams(Fabric fabric, java.lang.String commandId, java.lang.Object args, groovy.lang.Closure closure)

@param closure will be called back with a map with commandExecution and stream (if any)

 

Method Detail

executeShellCommand

java.lang.String executeShellCommand(Fabric fabric, java.lang.String agentName, java.lang.Object args)
Executes the shell command. Note that this is a non blocking call which returns right away with the id of the command being executed
Parameters:
args - see org.linkedin.glu.agent.api.Agent#executeShellCommand for details on args
Returns:
the id of the executed command


findCommandExecution

DbCommandExecution findCommandExecution(Fabric fabric, java.lang.String commandId)


findCommandExecutions

java.util.Map findCommandExecutions(Fabric fabric, java.lang.String agentName, java.lang.Object params)


findCurrentCommandExecutions

java.util.Map findCurrentCommandExecutions()
Returns:
a map with all currently running commands


findCurrentCommandExecutions

java.util.Map findCurrentCommandExecutions(java.util.Collection commandIds)
Returns:
a map with all currently running commands (filtered by the commandIds)


interruptCommand

boolean interruptCommand(Fabric fabric, java.lang.String agentName, java.lang.String commandId)
Interrupts the command.
Parameters:
args.id - the id of the command to interrupt
Returns:
true if the command was interrupted properly or false if there was no such command or already completed


withCommandExecutionAndWithOrWithoutStreams

java.lang.Object withCommandExecutionAndWithOrWithoutStreams(Fabric fabric, java.lang.String commandId, java.lang.Object args, groovy.lang.Closure closure)
throws:
NoSuchCommandExecutionException if there is no such command
Parameters:
closure - will be called back with a map with commandExecution and stream (if any)


 

Groovy Documentation