Browse Source

TT#97301 update CLI online help

Change-Id: Ib5615f15cefa23ac093115318f84cf712f735322
pull/1164/head
Richard Fuchs 5 years ago
parent
commit
89d017ed73
2 changed files with 27 additions and 8 deletions
  1. +8
    -2
      daemon/cli.c
  2. +19
    -6
      utils/rtpengine-ctl

+ 8
- 2
daemon/cli.c View File

@ -83,7 +83,6 @@ static void cli_incoming_list_silenttimeout(str *instr, struct cli_writer *cw);
static void cli_incoming_list_offertimeout(str *instr, struct cli_writer *cw); static void cli_incoming_list_offertimeout(str *instr, struct cli_writer *cw);
static void cli_incoming_list_finaltimeout(str *instr, struct cli_writer *cw); static void cli_incoming_list_finaltimeout(str *instr, struct cli_writer *cw);
static void cli_incoming_list_loglevel(str *instr, struct cli_writer *cw); static void cli_incoming_list_loglevel(str *instr, struct cli_writer *cw);
static void cli_incoming_list_loglevel(str *instr, struct cli_writer *cw);
static void cli_incoming_list_redisallowederrors(str *instr, struct cli_writer *cw); static void cli_incoming_list_redisallowederrors(str *instr, struct cli_writer *cw);
static void cli_incoming_list_redisdisabletime(str *instr, struct cli_writer *cw); static void cli_incoming_list_redisdisabletime(str *instr, struct cli_writer *cw);
static void cli_incoming_list_redisconnecttimeout(str *instr, struct cli_writer *cw); static void cli_incoming_list_redisconnecttimeout(str *instr, struct cli_writer *cw);
@ -163,6 +162,13 @@ static void cli_handler_do(const cli_handler_t *handlers, str *instr,
{ {
const cli_handler_t *h; const cli_handler_t *h;
if (!str_cmp(instr, "help")) {
cw->cw_printf(cw, "Available sub-commands at this level:\n");
for (h = handlers; h->cmd; h++)
cw->cw_printf(cw, "\t%s\n", h->cmd);
return;
}
for (h = handlers; h->cmd; h++) { for (h = handlers; h->cmd; h++) {
if (str_shift_cmp(instr, h->cmd)) if (str_shift_cmp(instr, h->cmd))
continue; continue;
@ -170,7 +176,7 @@ static void cli_handler_do(const cli_handler_t *handlers, str *instr,
return; return;
} }
cw->cw_printf(cw, "%s:%s\n", "Unknown or incomplete command:", instr->s);
cw->cw_printf(cw, "%s:" STR_FORMAT "\n", "Unknown or incomplete command:", STR_FMT(instr));
} }
static void destroy_own_foreign_calls(int foreign_call, unsigned int uint_keyspace_db) { static void destroy_own_foreign_calls(int foreign_call, unsigned int uint_keyspace_db) {


+ 19
- 6
utils/rtpengine-ctl View File

@ -81,16 +81,22 @@ sub showusage {
print "\n"; print "\n";
print " Supported commands are:\n"; print " Supported commands are:\n";
print "\n"; print "\n";
print " list [ numsessions | maxsessions | maxopenfiles\n";
print " | sessions [ <callid> | all | own | foreign ] | totals | loglevel ]\n";
print " help : generated complete list of commands\n";
print "\n";
print " list <option>\n";
print " help : generated complete list of sub-commands\n";
print " numsessions : print the number of sessions\n"; print " numsessions : print the number of sessions\n";
print " maxsessions : print the number of allowed sessions\n"; print " maxsessions : print the number of allowed sessions\n";
print " maxopenfiles : print the number of allowed open files\n"; print " maxopenfiles : print the number of allowed open files\n";
print " maxcpu : print maxmimum CPU usage allowed\n";
print " maxload : print maxmimum load average allowed\n";
print " maxbw : print maxmimum bandwidth usage average allowed\n";
print " sessions <callid> : print detail about one session\n"; print " sessions <callid> : print detail about one session\n";
print " sessions all : print one-liner all sessions information\n"; print " sessions all : print one-liner all sessions information\n";
print " sessions own : print one-liner own sessions information\n"; print " sessions own : print one-liner own sessions information\n";
print " sessions foreign : print one-liner foreign sessions information\n"; print " sessions foreign : print one-liner foreign sessions information\n";
print " totals : print total statistics\n"; print " totals : print total statistics\n";
print " jsonstats : print total statistics in JSON format\n";
print " timeout : print timeout parameter\n"; print " timeout : print timeout parameter\n";
print " silenttimeout : print silent-timeout parameter\n"; print " silenttimeout : print silent-timeout parameter\n";
print " finaltimeout : print final-timeout parameter\n"; print " finaltimeout : print final-timeout parameter\n";
@ -102,19 +108,23 @@ sub showusage {
print " rediscmdtimeout : print redis-cmd-timeout parameter\n"; print " rediscmdtimeout : print redis-cmd-timeout parameter\n";
print " controltos : print control-tos parameter\n"; print " controltos : print control-tos parameter\n";
print " interfaces : print local interface/port statistics\n"; print " interfaces : print local interface/port statistics\n";
print " transcoders : print transcoding statistics\n";
print "\n"; print "\n";
print " get : get is an alias for list, same parameters apply\n"; print " get : get is an alias for list, same parameters apply\n";
print "\n"; print "\n";
print " terminate [ <callid> | all | own | foreign ]\n";
print " terminate <option>\n";
print " <callid> : session is immediately terminated\n"; print " <callid> : session is immediately terminated\n";
print " all : terminates all current sessions\n"; print " all : terminates all current sessions\n";
print " own : terminates own current sessions\n"; print " own : terminates own current sessions\n";
print " foreign : terminates foreign current sessions\n"; print " foreign : terminates foreign current sessions\n";
print "\n"; print "\n";
print " set [ maxsessions <int> | maxopenfiles <uint> | timeout <uint>\n";
print " | silent_timeout <uint> | final_timeout <uint> | loglevel <uint> ]\n";
print " set <option>\n";
print " help : generated complete list of sub-commands\n";
print " maxsessions <int> : set the max nr of allowed sessions\n"; print " maxsessions <int> : set the max nr of allowed sessions\n";
print " maxopenfiles <uint> : set the max nr of allowed open files\n"; print " maxopenfiles <uint> : set the max nr of allowed open files\n";
print " maxcpu <float> : set maxmimum CPU usage allowed\n";
print " maxload <float> : set maxmimum load average allowed\n";
print " maxbw <uint> : set maxmimum bandwidth usage average allowed\n";
print " timeout <uint> : set the --timeout parameter \n"; print " timeout <uint> : set the --timeout parameter \n";
print " silenttimeout <uint> : set the --silent-timeout parameter \n"; print " silenttimeout <uint> : set the --silent-timeout parameter \n";
print " finaltimeout <uint> : set the --final-timeout parameter \n"; print " finaltimeout <uint> : set the --final-timeout parameter \n";
@ -126,7 +136,7 @@ sub showusage {
print " rediscmdtimeout : set the --redis-cmd-timeout parameter\n"; print " rediscmdtimeout : set the --redis-cmd-timeout parameter\n";
print " controltos : set the --control-tos parameter\n"; print " controltos : set the --control-tos parameter\n";
print "\n"; print "\n";
print " params [ start | current | diff ]\n";
print " params <option>\n";
print " start : lists the initial values of all the configuration file parameters\n"; print " start : lists the initial values of all the configuration file parameters\n";
print " current : lists the present values of all the configuration file parameters\n"; print " current : lists the present values of all the configuration file parameters\n";
print " diff : compares initial and present values of all the configuration file parameters and lists the updated parameters\n"; print " diff : compares initial and present values of all the configuration file parameters and lists the updated parameters\n";
@ -141,6 +151,9 @@ sub showusage {
print "\n"; print "\n";
print " kslist : print all currently subscribed keyspaces\n"; print " kslist : print all currently subscribed keyspaces\n";
print "\n"; print "\n";
print " active : set all running sessions to 'owned'\n";
print " standby : set all running sessions to 'foreign'\n";
print "\n";
print "\n"; print "\n";
print " Return Value:\n"; print " Return Value:\n";
print " 0 on success with output from server side, other values for failure.\n"; print " 0 on success with output from server side, other values for failure.\n";


Loading…
Cancel
Save