|
| agent () |
|
virtual | ~agent () |
|
template<typename sub_agent_type > |
void | execute (const scarab::param_node &a_config) |
|
template<typename sub_agent_type > |
void | execute (const scarab::param_node &a_config, const scarab::param_array &a_ord_args) |
|
| snake_case_mv_accessible (bool, is_dry_run) |
|
| snake_case_mv_referrable (std::string, routing_key) |
|
| snake_case_mv_referrable (std::string, specifier) |
|
| snake_case_mv_referrable (uuid_t, lockout_key) |
|
| snake_case_mv_accessible (unsigned, return_code) |
|
| snake_case_mv_referrable (std::string, return_message) |
|
| snake_case_mv_accessible (unsigned, timeout) |
|
| snake_case_mv_accessible (bool, suppress_output) |
|
| snake_case_mv_accessible (bool, json_print) |
|
| snake_case_mv_accessible (bool, pretty_print) |
|
| snake_case_mv_referrable (std::string, save_filename) |
|
| snake_case_mv_accessible (reply_ptr_t, reply) |
|
| snake_case_mv_accessible (int, return) |
|
Takes command-line arguments and sends messages.
- Author
- N.S. Oblath
The primary purpose of this class is to send messages. It can send requests, alerts, or replies. It is optimized for taking command-line arguments and translating them into a message to send.
It uses the subcommand approach to the command-line interface. Each type of message to send is encapsulated in a particular subclass of the internal class sub_agent
. Each type of sub_agent
has an execute()
function that performs the subcommand.
CL arguments are translated to messages to send via the configuration param_node that is passed to the subcommand. The expected configuration is:
{
"[operation: run, get, set, cmd, alert, reply] : "",
"rk" : "[routing key]",
"amqp" : {
"broker" : "[address]",
"broker-port" : [port],
"exchange" : "[exchange]",
"auth-file" : "[authentication file]", // optional; must live in the user's home directory
"reply-timeout-ms
": [ms] // optional; default is 10000 },
"lockout-key" : "[uuid]", // optional
"save" : "[filename]" // optional
"load" : "[filename]" // optional; only used for cmd
"return" : { // used only for replies
"code" : [return code],
"message" : "[return message]"
}
"pretty-print" : null // optional; if present sets output to nicely formatted JSON
"suppress-output" : null // optional; if present suppresses the normal agent output
"dry-run-
agent" : null // optional; if present prints the message to be sent and exits }
Definition at line 63 of file agent.hh.