-
Notifications
You must be signed in to change notification settings - Fork 12
/
rpc.txt
67 lines (53 loc) · 2.39 KB
/
rpc.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
aurweb RPC Interface
====================
Package Search
--------------
Package searches can be performed by issuing HTTP GET requests of the form
+/rpc?v=5&type=search&by=_field_&arg=_keywords_+ where _keywords_ is the
search argument and _field_ is one of the following values:
* `name` (search by package name only)
* `name-desc` (search by package name and description)
* `maintainer` (search by package maintainer)
* `depends` (search for packages that depend on _keywords_)
* `makedepends` (search for packages that makedepend on _keywords_)
* `optdepends` (search for packages that optdepend on _keywords_)
* `checkdepends` (search for packages that checkdepend on _keywords_)
The _by_ parameter can be skipped and defaults to `name-desc`.
If a maintainer search is performed and the search argument is left empty, a
list of orphan packages is returned.
Package Details
---------------
Package information can be obtained by issuing HTTP GET requests of the form
+/rpc?v=5&type=info&arg[]=_pkg1_&arg[]=_pkg2_&...+ where _pkg1_, _pkg2_, ...
are the names of packages to retrieve package details for.
Request Methods
---------------
Historically, the `type=multiinfo` `v=5` GET request has supported a
particular ordering of arguments. The POST request argument ordering
cannot be guaranteed, and so its behavior is different. Differences are
described below:
`GET`::
`type=multiinfo` arguments are parsed by iterating the query string
from last to first key, looking for an `arg` or `arg[]`. Once one is
found, behavior diverges depending on which is found first: the `arg`
parameter is used as the sole argument or the `arg[]` parameters are
built into a list until a non-argument key is encountered.
`POST (experimental)`::
All provided instances of `arg` and `arg[]` given to `type=multiinfo`
are supported in unison:
curl -d 'v=5' -d 'type=info' -d 'arg=one' -d 'arg[]=two' -d 'arg[]=three' ...
All other valid query types are supported without change.
Examples
--------
`search`::
`/rpc?v=5&type=search&arg=foobar`
`search` by maintainer::
`/rpc?v=5&type=search&by=maintainer&arg=john`
`search` packages that have _boost_ as `makedepends`::
`/rpc?v=5&type=search&by=makedepends&arg=boost`
`search` with callback::
`/rpc?v=5&type=search&arg=foobar&callback=jsonp1192244621103`
`info`::
`/rpc?v=5&type=info&arg[]=foobar`
`info` with multiple packages::
`/rpc?v=5&type=info&arg[]=foo&arg[]=bar`