Runs a prespecified action on a resource. Use the entry point to run non-periodic actions like suspending a database or resuming the suspended database.
Each action is identified by an action_token. The action_token is a name for an action. The list of supported actions (described by the action_tokens) for a resource type is described in the SupportedActions keylist. You must list the action in the SupportedActions attribute.
See SupportedActions.
For an agent, all action entry points must be either C++ or script-based; you cannot use both C++ and scripts.
Make sure the action scripts reside within an action
directory under the agent directory. Create a script for each action. Use the correct action_token as the script name.
For example, a script called suspend defines the actions to be performed when the action_token "suspend" is invoked via the hares -action command.
For C++ entry points, actions are implemented via a switch statement that defines a case for each possible action_token.
The following shows the syntax for the -action
option used with the hares
command:
hares -action res_name action_token [-actionargs arg1 arg2 ... ]
[-sys sys_name] [-user user@domain] [-domain domaintype]
The following example commands show the invocation of the action
entry point using the example action tokens, DBSuspend
and DBResume
:
hares -action DBResource DBSuspend -actionargs dbsuspend -sys Sys1
hares -action DBResource DBResume -actionsargs dbstart -sys Sys1
See also RegList.
The action
entry point exits with a 0 if it is successful, or 1 if not successful. The command hares
-action
exits with 0 if the action
entry point exits with a 0 and 1 if the action
entry point is not successful.
The agent framework limits the output of the script-based action entry point to 2048 bytes. Output refers to information that the script prints to stdout or stderr. When users run the hares -action command, the command prints this output. The output is also stored in the HAD log file.