code:xmlrpc
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| code:xmlrpc [2008/12/29 21:29] – added link to r2x.h pkubanek | code:xmlrpc [Unknown date] (current) – external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 10: | Line 10: | ||
| As first parameter to every XML-RPC call, you must pass an identification token. It is always a structure, and holds either credentials, | As first parameter to every XML-RPC call, you must pass an identification token. It is always a structure, and holds either credentials, | ||
| - | Credentials are passed in structure under //login// and // | + | Credentials are passed in structure under //login// and // |
| + | |||
| + | <code python> | ||
| + | import xmlrpclib | ||
| + | xmlRpcServer = xmlrpclib.ServerProxy(" | ||
| + | res = xmlRpcServer.rts2.mainstatus ({' | ||
| + | print res | ||
| + | </ | ||
| + | |||
| + | Session ID can be obtained by rts2.login call. Then it should be passed as session_id parameter to all subsequent calls. Following example demonstrates how to use session_id: | ||
| + | |||
| + | <code python> | ||
| + | res = xmlRpcServer.rts2.login ({' | ||
| + | sess_id = res[' | ||
| + | res = xmlRpcServer.rts2.mainstatus ({' | ||
| + | print res | ||
| + | </ | ||
| + | |||
| + | Session id's expire after inactivity. The time of inactivity is defined in response field ' | ||
| ===== Commands ===== | ===== Commands ===== | ||
| There is description of commands. Please see also [[http:// | There is description of commands. Please see also [[http:// | ||
| + | |||
| + | ==== rts2.login ==== | ||
| + | |||
| + | This call accepts two parameters. The first is login name, the second is password. Returns session id, which can be used in subsequent calls to authorize them. | ||
| ==== rts2.devices.list ==== | ==== rts2.devices.list ==== | ||
code/xmlrpc.1230586194.txt.gz · Last modified: 2008/12/28 23:00 (external edit)