瀏覽代碼

jsonrpc-s: documentation for jsonrpc_exec(cmd)

Daniel-Constantin Mierla 11 年之前
父節點
當前提交
74a2f193bc
共有 2 個文件被更改,包括 40 次插入1 次删除
  1. 17 0
      modules/jsonrpc-s/README
  2. 23 1
      modules/jsonrpc-s/doc/jsonrpc-s_admin.xml

+ 17 - 0
modules/jsonrpc-s/README

@@ -33,11 +33,13 @@ Daniel-Constantin Mierla
         4. Functions
 
               4.1. jsonrpc_dispatch()
+              4.2. jsonrpc_exec(cmd)
 
    List of Examples
 
    1.1. Set pretty_format parameter
    1.2. jsonrpc_dispatch usage
+   1.3. jsonrpc_exec usage
 
 Chapter 1. Admin Guide
 
@@ -59,6 +61,7 @@ Chapter 1. Admin Guide
    4. Functions
 
         4.1. jsonrpc_dispatch()
+        4.2. jsonrpc_exec(cmd)
 
 1. Overview
 
@@ -113,6 +116,7 @@ modparam("jsonrpc-s", "pretty_format", 1)
 4. Functions
 
    4.1. jsonrpc_dispatch()
+   4.2. jsonrpc_exec(cmd)
 
 4.1. jsonrpc_dispatch()
 
@@ -160,3 +164,16 @@ event_route[xhttp:request] {
     return;
 }
 ...
+
+4.2. jsonrpc_exec(cmd)
+
+   Execute JSONRPC command given as parameter.
+
+   The parameter has to be a full valid JSONRPC document. It can be a
+   dynamic string with variables. The result of the command can be
+   accessed via $jsonrpl(key) variables.
+
+   Example 1.3. jsonrpc_exec usage
+...
+jsonrpc_exec({"jsonrpc": "2.0", "method": "dispatcher.reload", "id": 1}');
+...

+ 23 - 1
modules/jsonrpc-s/doc/jsonrpc-s_admin.xml

@@ -100,7 +100,7 @@ modparam("jsonrpc-s", "pretty_format", 1)
 
 	<section>
 	<title>Functions</title>
- 	<section>
+ 	<section id="jsonrpc-s.f.jsonrpc_dispatch">
 	    <title>
 		<function moreinfo="none">jsonrpc_dispatch()</function>
 	    </title>
@@ -154,6 +154,28 @@ event_route[xhttp:request] {
 </programlisting>
 	    </example>
 	</section>
+ 	<section id="jsonrpc-s.f.jsonrpc_exec">
+	    <title>
+		<function moreinfo="none">jsonrpc_exec(cmd)</function>
+	    </title>
+	    <para>
+			Execute JSONRPC command given as parameter.
+		</para>
+		<para>
+			The parameter has to be a full valid JSONRPC document. It can
+			be a dynamic string with variables. The result of the command
+			can be accessed via $jsonrpl(key) variables.
+	    </para>
+		<example>
+		<title><function>jsonrpc_exec</function> usage</title>
+		<programlisting format="linespecific">
+...
+jsonrpc_exec({"jsonrpc": "2.0", "method": "dispatcher.reload", "id": 1}');
+...
+</programlisting>
+	    </example>
+	</section>
+
 	</section>
 </chapter>