code:xmlrpc
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Previous revision | |||
— | code:xmlrpc [Unknown date] (current) – external edit (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== XML-RPC interface ====== | ||
+ | |||
+ | Standard XML-RPC is used. For specification of interface, please see [[http:// | ||
+ | |||
+ | * each call must as first parameter pass authentication token. More on that bellow. | ||
+ | * if some error occurs during execution of command, an XML-RPC error is raised | ||
+ | |||
+ | ===== Authentication token ===== | ||
+ | |||
+ | 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 // | ||
+ | |||
+ | <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 ===== | ||
+ | |||
+ | 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.values.list ==== | ||
+ | |||
+ | ==== rts2.value.set ==== | ||
+ | |||
+ | Set RTS2 variable. Three parameter must be specified, with following meaning: | ||
+ | |||
+ | - Name of device for which variable will be set. | ||
+ | - Name of variable which will be set. | ||
+ | - Value as string. | ||
+ | |||
+ | ==== rts2.values.list ==== | ||
+ | |||
+ | ==== rts2.targets.list ==== | ||
+ | |||
+ | ==== rts2.targets.info ==== | ||
+ | |||
+ | ==== rts2.observations.list ==== | ||
+ | |||
+ | ==== rts2.images.list ==== | ||
+ | |||
+ | ==== rts2.messages.get ==== | ||
+ | |||
+ | |||
+ | ==== rts2.user.login ==== | ||
+ | |||
+ | User login. Provides username and password, out true/false - true if login is OK. | ||
+ | |||
+ | ==== rts2.user.telma.new ==== | ||
+ | |||
+ | New user. Provides all user parameters (login, email, password, | ||
+ | |||
+ | |||
+ | |||
code/xmlrpc.txt · Last modified: 2009/02/20 00:00 (external edit)