|
| 1 | +========================= |
| 2 | +XML-RPC access to Roundup |
| 3 | +========================= |
| 4 | + |
| 5 | +.. contents:: |
| 6 | + |
| 7 | +Introduction |
| 8 | +------------ |
| 9 | +Version 1.4 of Roundup includes an XML-RPC frontend. Some installations find |
| 10 | +that roundup-admins requirement of local access to the tracker instance |
| 11 | +limiting. The XML-RPC frontend provides the ability to execute a limited subset |
| 12 | +of commands similar to those found in roundup-admin from remote machines. |
| 13 | + |
| 14 | +roundup-xmlrpc-server |
| 15 | +--------------------- |
| 16 | +The Roundup XML-RPC server must be started before remote clients can access the |
| 17 | +tracker via XML-RPC. ``roundup-xmlrpc-server`` is installed in the scripts |
| 18 | +directory alongside ``roundup-server`` and roundup-admin``. When invoked, the |
| 19 | +location of the tracker instance must be specified. |
| 20 | + |
| 21 | + roundup-xmlrpc-server -i ``/path/to/tracker`` |
| 22 | + |
| 23 | +The default port is ``8000``. An alternative port can be specified with the |
| 24 | +``--port`` switch. |
| 25 | + |
| 26 | +security consideration |
| 27 | +====================== |
| 28 | +Note that the current ``roundup-xmlrpc-server`` implementation does not |
| 29 | +support SSL. This means that usernames and passwords will be passed in |
| 30 | +cleartext unless the server is being proxied behind another server (such as |
| 31 | +Apache or lighttpd) that provide SSL. |
| 32 | + |
| 33 | +client API |
| 34 | +---------- |
| 35 | +The server currently implements four methods. Each method requires that the |
| 36 | +user provide a username and password in the HTTP authorization header in order |
| 37 | +to authenticate the request against the tracker. |
| 38 | + |
| 39 | +list |
| 40 | + :arguments: classname, [property_name] |
| 41 | + |
| 42 | + List all elements of a given ``classname``. If ``property_name`` is |
| 43 | + specified, that is the property that will be displayed for each |
| 44 | + element. If ``property_name`` is not specified the default label |
| 45 | + property will be used. |
| 46 | + |
| 47 | +display |
| 48 | + :arguments: designator, [property_1, ..., property_N] |
| 49 | + |
| 50 | + Display a single item in the tracker as specified by ``designator`` |
| 51 | + (e.g. issue20 or user5). The default is to display all properties |
| 52 | + for the item. Alternatively, a list of properties to display can be |
| 53 | + specified. |
| 54 | + |
| 55 | +create |
| 56 | + :arguments: classname, arg_1 ... arg_N |
| 57 | + |
| 58 | + Create a new instance of ``classname`` with ``arg_1`` through |
| 59 | + ``arg_N`` as the values of the new instance. The arguments are |
| 60 | + name=value pairs (e.g. ``status='3'``). |
| 61 | + |
| 62 | +set |
| 63 | + :arguments: designator, arg_1 ... arg_N |
| 64 | + |
| 65 | + Set the values of an existing item in the tracker as specified by |
| 66 | + ``designator``. The new values are specified in ``arg_1`` through |
| 67 | + ``arg_N``. The arguments are name=value pairs (e.g. ``status='3'``). |
| 68 | + |
| 69 | +sample python client |
| 70 | +==================== |
| 71 | +:: |
| 72 | + |
| 73 | + >>> import xmlrpclib |
| 74 | + >>> roundup_server = xmlrpclib.ServerProxy('http://username:password@localhost:8000') |
| 75 | + >>> roundup_server.list('user') |
| 76 | + ['admin', 'anonymous', 'demo'] |
| 77 | + >>> roundup_server.list('issue', 'id') |
| 78 | + ['1'] |
| 79 | + >>> roundup_server.display('issue1') |
| 80 | + {'assignedto' : None, 'files' : [], 'title' = 'yes, ..... } |
| 81 | + >>> roundup_server.display('issue1', 'priority', 'status') |
| 82 | + {'priority' : '1', 'status' : '2'} |
| 83 | + >>> roundup_server.set('issue1', 'status=3' |
| 84 | + >>> roundup_server.display('issue1', 'status') |
| 85 | + {'status' : '3' } |
| 86 | + >>> roundup_server.create('issue', "title='another bug'", "status=2") |
| 87 | + '2' |
| 88 | + |
0 commit comments