|
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
|
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()
@return information about the host |
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()
**************************************************************** Software management ***************************************************************** |
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)
**************************************************************** Software management ***************************************************************** |
boolean
|
interruptAction(java.lang.Object args)
Interrupts the action provided or the current one if neither |
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. |
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. |
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 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
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
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
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