浏览代码

counters: rpc commands aliases for more explicit naming

Daniel-Constantin Mierla 8 年之前
父节点
当前提交
8fd9491212
共有 2 个文件被更改,包括 62 次插入20 次删除
  1. 3 0
      src/modules/counters/counters.c
  2. 59 20
      src/modules/counters/doc/counters_rpc.xml

+ 3 - 0
src/modules/counters/counters.c

@@ -104,8 +104,11 @@ static rpc_export_t counters_rpc[] = {
 	{"cnt.get", cnt_get_rpc, cnt_get_doc, 0 },
 	{"cnt.reset", cnt_reset_rpc, cnt_reset_doc, 0 },
 	{"cnt.get_raw", cnt_get_raw_rpc, cnt_get_raw_doc, 0 },
+	{"cnt.list_groups", cnt_grps_list_rpc, cnt_grps_list_doc, RET_ARRAY },
 	{"cnt.grps_list", cnt_grps_list_rpc, cnt_grps_list_doc, RET_ARRAY },
+	{"cnt.list_vars", cnt_var_list_rpc, cnt_var_list_doc, RET_ARRAY },
 	{"cnt.var_list", cnt_var_list_rpc, cnt_var_list_doc, RET_ARRAY },
+	{"cnt.get_vars", cnt_grp_get_all_rpc, cnt_grp_get_all_doc, 0 },
 	{"cnt.grp_get_all", cnt_grp_get_all_rpc, cnt_grp_get_all_doc, 0 },
 	{"cnt.help", cnt_help_rpc, cnt_help_doc, 0},
 	{ 0, 0, 0, 0}

+ 59 - 20
src/modules/counters/doc/counters_rpc.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" 
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
 	"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
 	[ <!-- Include general documentation entities -->
 		<!ENTITY % docentities SYSTEM "../../../../doc/docbook/entities.xml">
@@ -10,13 +10,16 @@
 <section id="cnts.rpcs" xmlns:xi="http://www.w3.org/2001/XInclude">
 	<sectioninfo>
 	</sectioninfo>
-	<title>counters RPC Functions</title>
+	<title>RPC Commands</title>
 
-	<section id="cnt.get">
-		<title> <function>cnt.get group counter_name</function></title>
+	<section id="cnt.r.get">
+		<title> <function>cnt.get</function></title>
 		<para>
 			Get the value of the counter identified by group.counter_name.
 		</para>
+		<para>
+			Prototype: cnt.get group counter_name
+		</para>
 		<example>
 			<title><function>cnt.get grp counter_name</function> usage</title>
 			<programlisting>
@@ -25,11 +28,14 @@
 		</example>
 	</section>
 
-	<section id="cnt.reset">
-		<title> <function>cnt.reset group counter_name</function></title>
+	<section id="cnt.r.reset">
+		<title> <function>cnt.reset</function></title>
 		<para>
 			Resets the counter identified by group.counter_name.
 		</para>
+		<para>
+			Prototype: cnt.reset group counter_name
+		</para>
 		<example>
 			<title><function>cnt.reset grp name</function> usage</title>
 			<programlisting>
@@ -38,52 +44,85 @@
 		</example>
 	</section>
 
-	<section id="cnt.grps_list">
-		<title> <function>cnt.grps_list</function></title>
+	<section id="cnt.r.list_groups">
+		<title> <function>cnt.list_groups</function></title>
 		<para>
 			Lists all the declared counter groups.
 		</para>
+		<para>
+			Prototype: cnt.list_groups
+		</para>
 		<example>
-			<title><function>cnt.grps_list</function> usage</title>
+			<title><function>cnt.list_groups</function> usage</title>
 			<programlisting>
- $ &sercmd; cnt.grps_list
+ $ &sercmd; cnt.list_groups
 			</programlisting>
 		</example>
 	</section>
 
-	<section id="cnt.var_list">
-		<title> <function>cnt.var_list group</function></title>
+	<section id="cnt.r.grps_list">
+		<title> <function>cnt.grps_list</function></title>
+		<para>
+			Alias to cnt.list_groups.
+		</para>
+	</section>
+
+	<section id="cnt.r.list_vars">
+		<title> <function>cnt.list_vars</function></title>
 		<para>
 			Lists all the names of all the counters belonging to the
 			specified group.
 		</para>
+		<para>
+			Prototype: cnt.list_vars group
+		</para>
 		<example>
-			<title><function>cnt.var_list group</function> usage</title>
+			<title><function>cnt.list_vars group</function> usage</title>
 			<programlisting>
- $ &sercmd; cnt.var_list script
+ $ &sercmd; cnt.list_vars tmx
 			</programlisting>
 		</example>
 	</section>
 
-	<section id="cnt.grp_get_all">
-		<title> <function>cnt.grp_get_all</function></title>
+	<section id="cnt.r.var_list">
+		<title> <function>cnt.var_list</function></title>
+		<para>
+			Alias to cnt.list_vars.
+		</para>
+	</section>
+
+	<section id="cnt.r.get_vars">
+		<title> <function>cnt.get_vars</function></title>
 		<para>
 			Lists all the counter names and their values in the
 			specified group.
 		</para>
+		<para>
+			Prototype: cnt.get_vars group
+		</para>
 		<example>
-			<title><function>cnt.var_list group</function> usage</title>
+			<title><function>cnt.get_vars group</function> usage</title>
 			<programlisting>
- $ &sercmd; cnt.grp_get_all script
+ $ &sercmd; cnt.get_vars script
 			</programlisting>
 		</example>
 	</section>
 
-	<section id="cnt.help">
-		<title> <function>cnt.help group counter_name</function></title>
+	<section id="cnt.r.grp_get_all">
+		<title> <function>cnt.grp_get_all</function></title>
+		<para>
+			Alias to cnt.get_vars.
+		</para>
+	</section>
+
+	<section id="cnt.r.help">
+		<title> <function>cnt.help</function></title>
 		<para>
 			Displays the counter description.
 		</para>
+		<para>
+			Prototype: cnt.help group counter_name
+		</para>
 		<example>
 			<title><function>cnt.help grp name</function> usage</title>
 			<programlisting>