Changeset 5802


Ignore:
Timestamp:
May 10, 2008, 4:38:42 PM (14 years ago)
Author:
charles
Message:

readability. better explain the response arguments a bit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/ipc-json-spec.txt

    r5801 r5802  
    2020
    2121   There are only two message types: request and response.  Both
    22    are json objects with two members:  "headers" (described in 2.1)
     22   are JSON objects with two members:  "headers" (described in 2.1)
    2323   and "body" (described in 2.2-2.3).
    2424
     
    3434   Request bodies support two members:
    3535   (1) A required "name" string telling the name of the request.
    36    (2) An optional "arguments" object of name/value argument pairs.
     36   (2) An optional "arguments" object of name/value pairs.
    3737
    38382.3.  Response Body
    3939
    4040   Response bodies support two members:
    41    (1) An optional "arguments" object of argument name/value pairs.
     41   (1) An optional "arguments" object of name/value pairs.
    4242   (2) An optional "error" string which may be omitted on success.
    4343
     
    5555   Request names: "torrent-start", "torrent-stop",
    5656                  "torrent-remove", "torrent-verify"
    57    The only supported argument is 3.1's "ids" argument.
    58    The response has no arguments.
     57   Request arguments: 3.1's optional "ids" argument.
     58   Response arguments: none.
    5959
    60603.3.  Torrent Info Requests
    6161
    6262   Request name: "torrent-info".
    63    The only supported argument is 3.1's "ids" argument.
     63   Request arguments: 3.1's optional "ids" argument.
    6464
    65    The response will contain an "info" argument holding an array of
    66    tr_info objects.  these are a (nearly) 1-to-1 mapping of
    67    libtransmission's tr_info struct, but differ in the following ways:
     65   Response arguments: "info", an array of objects based on libtransmission's
     66   tr_info struct but differ in the following ways:
    6867
    6968   (1) tr_info's "hash" field is omitted.
     
    8180            "arguments": {
    8281               "name": "torrent-info",
    83                "ids": [1, 2]
     82               "ids": [ 7, 10 ]
    8483            }
    8584         }
     
    9796               "info": [
    9897                  {
    99                      "id": 1,
     98                     "id": 7,
    10099                     "totalSize": 9803930483,
    101100                     "pieceCount": 1209233,
     
    105104                  }
    106105                  {
    107                      "id": 2,
     106                     "id": 10,
    108107                     "totalSize": 2398480394,
    109108                     "pieceCount": 83943,
     
    120119
    121120   Request name is "torrent-status".
    122    The only supported argument is 3.1's "ids" argument.
     121   Request arguments: 3.1's optional "ids" argument.
    123122
    124    The response will contain a "status" argument holding an array of
    125    tr_stat objects.  these are a (nearly) 1-to-1 mapping of
    126    libtransmission's tr_stat struct, but differ in the following ways:
     123   Response arguments: "status", an array of objects based on
     124   libtransmission's tr_stat struct but which differ the following ways:
    127125
    128126   (1) tr_stat's "tracker" field is omitted
     
    1321303.5.  Adding a Torrent
    133131
    134    Request name is "torrent-add".
    135    All arguments are optional except "filename".
    136    Supported arguments are:
     132   Request name: "torrent-add"
     133   Request arguments:
    137134
    138135   string             | value type & description
     
    145142   "speed-limit-up"   | int       maximum upload speed (in KiB/s)
    146143
     144   The "filename" argument is required; all others are optional.
     145
     146   Response arguments: 3.1's "error" if the request failed.
    147147
    1481484.   Session Status Requests
    149149
    150 4.1.  Mutators
    151 
    152    The request name to change the session's state is "session-set".
    153    Supported arguments are:
     1504.1.  Session Arguments
    154151
    155152   string             | value type & description
     
    165162   "speed-limit-up"   | int       maximum global upload speed (in KiB/s)
    166163
     1644.2.  Mutators
     165
     166   Request name: "session-set"
     167   Request arguments: one or more of 4.1's session arguments
     168   Response arguments: none
     169
    1671704.2.  Accessors
    168171
    169172   Request name: "session-get"
    170173   Request arguments: none
    171    Response arguments: all the arguments described in 4.1.
     174   Response arguments: all of 4.1's session arguments
    172175
Note: See TracChangeset for help on using the changeset viewer.