ljr/livejournal/doc/raw/build/protocol/consolecommand.mode.xml

177 lines
5.0 KiB
XML
Executable File

<method name="consolecommand">
<shortdes>
Run an administrative command.
</shortdes>
<des>
The LiveJournal server has a text-based shell-like admininistration
console where less-often used commands can be entered. There's a web
interface to this shell online, and this is another gateway to that.
</des>
<arguments><struct count="1">
&authInfo;
<key name="commands" count="1"><list count="1">
<scalar count="0more"><des>
The commands to send, with double quotes around any arguments with spaces,
and double quotes escaped by backslashes, and backslashes escaped with
backslashes. Optionally, you can send a listref instead of a string
for this argument, in which case, we'll use your argument separation
and not parse it ourselves.
</des></scalar>
</list></key>
</struct></arguments>
<expost>
POST /interface/xmlrpc HTTP/1.0
User-Agent: XMLRPC Client 1.0
Host: www.livejournal.com
Content-Type: text/xml
Content-Length: 542
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;methodCall&gt;
&lt;methodName&gt;LJ.XMLRPC.consolecommand&lt;/methodName&gt;
&lt;params&gt;
&lt;param&gt;
&lt;value&gt;&lt;struct&gt;
&lt;member&gt;&lt;name&gt;username&lt;/name&gt;
&lt;value&gt;&lt;string&gt;test&lt;/string&gt;&lt;/value&gt;
&lt;/member&gt;
&lt;member&gt;&lt;name&gt;password&lt;/name&gt;
&lt;value&gt;&lt;string&gt;test&lt;/string&gt;&lt;/value&gt;
&lt;/member&gt;
&lt;member&gt;&lt;name&gt;ver&lt;/name&gt;
&lt;value&gt;&lt;int&gt;1&lt;/int&gt;&lt;/value&gt;
&lt;/member&gt;
&lt;member&gt;&lt;name&gt;commands&lt;/name&gt;
&lt;value&gt;&lt;array&gt;
&lt;data&gt;
&lt;value&gt;&lt;string&gt;help print&lt;/string&gt;&lt;/value&gt;
&lt;/data&gt;
&lt;/array&gt;&lt;/value&gt;
&lt;/member&gt;
&lt;/struct&gt;&lt;/value&gt;
&lt;/param&gt;
&lt;/params&gt;
&lt;/methodCall&gt;
</expost>
<!--===================[ RETURN ]==============================-->
<returns><struct count="1">
<key name="results" count="1">
<list count="1"><des>
One stuct returned for each command run,
that struct containing both the overall return value,
and the line-by-line output of the command, with
each line of output being tagged by type (think
stdout vs. stderr, but with stdinfo also). The web interface
shows 'error' with red, '' (stdout) with black, and 'info'
with green. Clients are encouraged to also, if possible.
</des>
<struct count="0more">
<key name="success" count="1">
<scalar><des>
Return status of nth command. 0 or 1.
</des></scalar>
</key>
<key name="output" count="1">
<list count="1">
<scalar count="1"><des>
Type of output line. Either "" (normal output), "error", or "info",
something to be emphasized over normal output.
</des></scalar>
<scalar count="1"><des>
The text of that line.
</des></scalar>
</list>
</key>
</struct>
</list>
</key>
</struct></returns>
<exreturn>
HTTP/1.1 200 OK
Connection: close
Content-length: 1189
Content-Type: text/xml
Date: Tue, 16 Jul 2002 22:59:33 GMT
Server: Apache/1.3.4 (Unix)
&lt;?xml version="1.0"?&gt;
&lt;methodResponse&gt;
&lt;params&gt;
&lt;param&gt;
&lt;value&gt;&lt;struct&gt;
&lt;member&gt;&lt;name&gt;results&lt;/name&gt;
&lt;value&gt;&lt;array&gt;
&lt;data&gt;
&lt;value&gt;&lt;struct&gt;
&lt;member&gt;&lt;name&gt;success&lt;/name&gt;
&lt;value&gt;&lt;int&gt;1&lt;/int&gt;&lt;/value&gt;
&lt;/member&gt;
&lt;member&gt;&lt;name&gt;output&lt;/name&gt;
&lt;value&gt;&lt;array&gt;
&lt;data&gt;
&lt;value&gt;&lt;array&gt;
&lt;data&gt;
&lt;value&gt;&lt;string&gt;&lt;/string&gt;&lt;/value&gt;
&lt;value&gt;&lt;string&gt;print ...&lt;/string&gt;&lt;/value&gt;
&lt;/data&gt;
&lt;/array&gt;&lt;/value&gt;
&lt;value&gt;&lt;array&gt;
&lt;data&gt;
&lt;value&gt;&lt;string&gt;&lt;/string&gt;&lt;/value&gt;
&lt;value&gt;&lt;string&gt; This is a debugging function. Given an arbitrary number of&lt;/string&gt;&lt;/value&gt;
&lt;/data&gt;
&lt;/array&gt;&lt;/value&gt;
&lt;value&gt;&lt;array&gt;
&lt;data&gt;
&lt;value&gt;&lt;string&gt;&lt;/string&gt;&lt;/value&gt;
&lt;value&gt;&lt;string&gt; meaningless arguments, it'll print each one back to you. If an&lt;/string&gt;&lt;/value&gt;
&lt;/data&gt;
&lt;/array&gt;&lt;/value&gt;
&lt;value&gt;&lt;array&gt;
&lt;data&gt;
&lt;value&gt;&lt;string&gt;&lt;/string&gt;&lt;/value&gt;
&lt;value&gt;&lt;string&gt; argument begins with a bang (!) then it'll be printed to the error&lt;/string&gt;&lt;/value&gt;
&lt;/data&gt;
&lt;/array&gt;&lt;/value&gt;
&lt;value&gt;&lt;array&gt;
&lt;data&gt;
&lt;value&gt;&lt;string&gt;&lt;/string&gt;&lt;/value&gt;
&lt;value&gt;&lt;string&gt; stream instead.&lt;/string&gt;&lt;/value&gt;
&lt;/data&gt;
&lt;/array&gt;&lt;/value&gt;
&lt;/data&gt;
&lt;/array&gt;&lt;/value&gt;
&lt;/member&gt;
&lt;/struct&gt;&lt;/value&gt;
&lt;/data&gt;
&lt;/array&gt;&lt;/value&gt;
&lt;/member&gt;
&lt;/struct&gt;&lt;/value&gt;
&lt;/param&gt;
&lt;/params&gt;
&lt;/methodResponse&gt;
</exreturn>
</method>