|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | PROPERTY | METHOD | DETAIL: FIELD | PROPERTY | METHOD |
interface Agent
Property Summary | |
---|---|
static java.lang.Object |
DEFAULT_TRANSITIONS
Default transitions for the state machine in the script (if the script does not provide its own) |
static java.lang.Object |
SELF_UPGRADE_TRANSITIONS
|
Method Summary | |
---|---|
boolean
|
addTag(java.lang.String tag)
Adds a tag. |
java.util.Set
|
addTags(java.util.Collection tags)
Adds all the tags. |
void
|
clearError(java.lang.Object args)
Clears the error attached to the mountpoint. |
java.lang.String
|
executeAction(java.lang.Object args)
Executes the action on the software that was installed on the given mount point. |
java.lang.Object
|
executeActionAndWait(java.lang.Object args)
Shortcut for both actions. |
boolean
|
executeActionAndWaitForState(java.lang.Object args)
Shortcut for both actions. |
java.lang.Object
|
executeCall(java.lang.Object args)
Executes the call on the software that was installed on the given mount point. |
java.lang.Object
|
executeShellCommand(java.lang.Object args)
**************************************************************** Commands ***************************************************************** |
java.lang.Object
|
getFileContent(java.lang.Object args)
Returns the content of the file at the given location. |
java.lang.Object
|
getFullState(java.lang.Object args)
@param args.mountPoint the mount point of the script you want to get the (full) state |
java.lang.Object
|
getHostInfo()
**************************************************************** Agent calls ***************************************************************** |
java.lang.Object
|
getMountPoints()
@return a list of all mount points currently mounted in the agent |
java.lang.Object
|
getState(java.lang.Object args)
@param args.mountPoint the mount point of the script you want to get the state |
java.util.Set
|
getTags()
@return the set of all tags |
int
|
getTagsCount()
**************************************************************** Tags ***************************************************************** |
boolean
|
hasAllTags(java.util.Collection tags)
@return |
boolean
|
hasAnyTag(java.util.Collection tags)
@return |
boolean
|
hasTag(java.lang.String tag)
@return |
boolean
|
hasTags()
@return |
void
|
installScript(java.lang.Object args)
**************************************************************** Script management ***************************************************************** |
boolean
|
interruptAction(java.lang.Object args)
Interrupts the action provided or the current one if neither |
boolean
|
interruptCommand(java.lang.Object args)
Interrupts the command. |
void
|
kill(long pid, int signal)
Sends the signal to the process with the given pid |
java.lang.Object
|
ps()
Equivalent to the ps command on unix: returns information about all the processes running |
boolean
|
removeTag(java.lang.String tag)
Removes the provided tag. |
java.util.Set
|
removeTags(java.util.Collection tags)
Removes all the tags. |
void
|
setTags(java.util.Collection tags)
Allow you to set the exact set of tags you want. |
java.lang.Object
|
streamCommandResults(java.lang.Object args)
This method allows you to start streaming the results (stdout, stderr,...) while the command is still running. |
void
|
sync()
Resynchronizes the agent (to call in case the agent loose synchronization with zookeeper for example) |
java.io.InputStream
|
tailAgentLog(java.lang.Object args)
tails the agent log file |
void
|
uninstallScript(java.lang.Object args)
Removed a previously installed script. |
java.lang.Object
|
waitForAction(java.lang.Object args)
Waits for the action (previously scheduled in executeAction(Object)) to complete no longer than the timeout provided. |
java.lang.Object
|
waitForCommand(java.lang.Object args)
Wait (no longer than the timeout provided) for the command to complete and return the exit value |
boolean
|
waitForState(java.lang.Object args)
Waits for the script to be in the state |
Property Detail |
---|
static java.lang.Object DEFAULT_TRANSITIONS
static java.lang.Object SELF_UPGRADE_TRANSITIONS
Method Detail |
---|
boolean addTag(java.lang.String tag)
true
if the tag which was added was a new tag, otherwise
false
java.util.Set addTags(java.util.Collection tags)
void clearError(java.lang.Object args)
args.mountPoint
- same mount point provided during installScript(Object)
java.lang.String executeAction(java.lang.Object args)
args.mountPoint
- same mount point provided during installScript(Object)args.action
- the lifecycle method you want to executeargs.actionArgs
- the arguments to provide the action
java.lang.Object executeActionAndWait(java.lang.Object args)
NoSuchActionException
boolean executeActionAndWaitForState(java.lang.Object args)
java.lang.Object executeCall(java.lang.Object args)
args.mountPoint
- same mount point provided during installScript(Object)args.call
- the call you want to executeargs.callArgs
- the arguments to provide the call
java.lang.Object executeShellCommand(java.lang.Object args)
java.lang.Object getFileContent(java.lang.Object args)
Map
) otherwise returns tail() (InputStream
)
java.lang.Object getFullState(java.lang.Object args)
args.mountPoint
- the mount point of the script you want to get the (full) state[scriptDefinition: [...], scriptState: [...]]
.
Ex:
[scriptDefinition:[initParameters:[:], parent:/, mountPoint:/container/i001,
scriptFactory:[location:file:/tmp/TomcatServerWithWarsScript.groovy,
class:org.linkedin.glu.agent.impl.script.FromLocationScriptFactory]],
scriptState:[stateMachine:[currentState:installed], script:[:]]]
java.lang.Object getHostInfo()
java.lang.Object getMountPoints()
java.lang.Object getState(java.lang.Object args)
args.mountPoint
- the mount point of the script you want to get the state
java.util.Set getTags()
int getTagsCount()
boolean hasAllTags(java.util.Collection tags)
true
if the given tags are present (all of them)
boolean hasAnyTag(java.util.Collection tags)
true
if at least one of them is present
boolean hasTag(java.lang.String tag)
true
if the given tag is present
boolean hasTags()
true
if there are no tags
void installScript(java.lang.Object args)
boolean interruptAction(java.lang.Object args)
action
nor
actionId
is provided. If you provide one, you should provide only one of
action
or actionId
.
args.mountPoint
- same mount point provided during installScript(Object)args.action
- the lifecycle method you want to interruptargs.actionId
- the id of the action to interrupttrue
if the action was interrupted properly or false
if
there was no such action or already completed
boolean interruptCommand(java.lang.Object args)
args.id
- the id of the command to interrupttrue
if the command was interrupted properly or false
if
there was no such command or already completed
void kill(long pid, int signal)
java.lang.Object ps()
boolean removeTag(java.lang.String tag)
true
if the tag was removed or false
if the tag was not
present in the first place
java.util.Set removeTags(java.util.Collection tags)
void setTags(java.util.Collection tags)
removeTags(getTags()) addTags(tags)
tags
- tags to set
java.lang.Object streamCommandResults(java.lang.Object args)
args.id
- the id of the command (as returned by {@lin #executeShellCommand})args.exitValueStream
- if you want the exit value to be part of the stream
(boolean
, optional, false
by default)args.exitValueStreamTimeout
- how long to wait to get the exit value if the command is
not completed yet (optional, in the event that
exitValueStream
is set to
true
and exitValueStreamTimeout
is not provided, it will not block and return no exit value
stream)args.stdinStream
- if you want stdin to be part of the stream
(boolean
, optional, false
by default)args.stdinOffset
- where to start in the stdin stream (optional, int
,
0
by default)args.stdinLen
- how many bytes to read maximum (optional, int
,
-1
by default which means read all)args.stdoutStream
- if you want stdout to be part of the stream
(boolean
, optional, false
by default)args.stdoutOffset
- where to start in the stdout stream (optional, int
,
0
by default)args.stdoutLen
- how many bytes to read maximum (optional, int
,
-1
by default which means read all)args.stderrStream
- if you want stdout to be part of the stream
(boolean
, optional, false
by default)args.stderrOffset
- where to start in the stdout stream (optional, int
,
0
by default)args.stderrLen
- how many bytes to read maximum (optional, int
,
-1
by default which means read all)startTime
, completionTime
(if any) and
stream
(if any)
void sync()
java.io.InputStream tailAgentLog(java.lang.Object args)
void uninstallScript(java.lang.Object args)
args.mountPoint
- same mount point provided during installScript(Object)args.force
- set to true
if you want to force uninstalling the script
regardless of its state
java.lang.Object waitForAction(java.lang.Object args)
NoSuchActionException
in some cases:
args.mountPoint
- the mount point of the script you want to wait forargs.actionId
- the id of the action to wait forargs.timeout
- if not null
, the amount of time to wait maximum
java.lang.Object waitForCommand(java.lang.Object args)
args.id
- the id of the command (as returned by {@lin #executeShellCommand})args.timeout
- if not null
, the amount of time to wait maximum. If
null
, wait until the command completes.
boolean waitForState(java.lang.Object args)
args.mountPoint
- the mount point of the script you want to wait forargs.state
- the desired state to wait forargs.timeout
- if not null
, the amount of time to wait maximumtrue
if the state was reached within the timeout, false
otherwise
Groovy Documentation