|
| | agent () |
| |
| | agent (const agent &)=default |
| |
| | agent (agent &&)=default |
| |
| virtual | ~agent ()=default |
| |
| agent & | operator= (const agent &)=default |
| |
| agent & | operator= (agent &&)=default |
| |
| template<typename sub_agent_type > |
| void | execute (const scarab::param_node &a_config, const scarab::authentication &a_auth) |
| |
| template<typename sub_agent_type > |
| void | execute (const scarab::param_node &a_config, const scarab::param_array &a_ord_args, const scarab::authentication &a_auth) |
| |
| | 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]",
"dripline_mesh" : {
"broker" : "[address]",
"broker_port" : [port],
"exchange" : "[exchange]",
"reply_timeout_ms": [ms] // optional; default is 10000
},
"auth_file" : "[filename]" // optional, if using an auth file
"auth_groups" : {
"username": {[username specification]}
"password": {[password specification]}
}
}
"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 73 of file agent.hh.