Show More
@@ -1,55 +1,56 b'' | |||||
1 | .. _api: |
|
1 | .. _api: | |
2 |
|
2 | |||
3 |
|
3 | |||
4 | API |
|
4 | API | |
5 | === |
|
5 | === | |
6 |
|
6 | |||
7 |
|
7 | |||
8 | Starting from RhodeCode version 1.2 a simple API was implemented. |
|
8 | Starting from RhodeCode version 1.2 a simple API was implemented. | |
9 | There's one schema for calling all api methods. API is implemented |
|
9 | There's one schema for calling all api methods. API is implemented | |
10 | with JSON protocol both ways. |
|
10 | with JSON protocol both ways. | |
11 |
|
11 | |||
12 |
|
12 | |||
13 | Clients need to send JSON data in such format:: |
|
13 | Clients need to send JSON data in such format:: | |
14 |
|
14 | |||
15 | { |
|
15 | { | |
16 | "api_key":"<api_key>", |
|
16 | "api_key":"<api_key>", | |
17 | "method":"<method_name>", |
|
17 | "method":"<method_name>", | |
18 | "args":{"<arg_key>":"<arg_val>"} |
|
18 | "args":{"<arg_key>":"<arg_val>"} | |
19 | } |
|
19 | } | |
20 |
|
20 | |||
21 | Simply provide api_key for access and permission validation |
|
21 | Simply provide api_key for access and permission validation | |
22 | method is name of method to call |
|
22 | method is name of method to call | |
23 | and args is an key:value list of arguments to pass to method |
|
23 | and args is an key:value list of arguments to pass to method | |
24 |
|
24 | |||
25 | .. note:: |
|
25 | .. note:: | |
26 |
|
26 | |||
27 | api_key can be found in your user account page |
|
27 | api_key can be found in your user account page | |
28 |
|
28 | |||
29 |
|
29 | |||
30 | And will receive JSON formatted answer:: |
|
30 | And will receive JSON formatted answer:: | |
31 |
|
31 | |||
32 | { |
|
32 | { | |
33 | "result": "<result>", |
|
33 | "result": "<result>", | |
34 | "error": null |
|
34 | "error": null | |
35 | } |
|
35 | } | |
36 |
|
36 | |||
37 | All responses from API will be `HTTP/1.0 200 OK`, if there's an error while |
|
37 | All responses from API will be `HTTP/1.0 200 OK`, if there's an error while | |
38 | calling api **error** key from response will contain failure description |
|
38 | calling api **error** key from response will contain failure description | |
39 | and result will be null. |
|
39 | and result will be null. | |
40 |
|
40 | |||
41 | API METHODS |
|
41 | API METHODS | |
42 | +++++++++++ |
|
42 | +++++++++++ | |
43 |
|
43 | |||
44 |
|
44 | |||
45 | pull |
|
45 | pull | |
46 | ---- |
|
46 | ---- | |
47 |
|
47 | |||
48 | Pulls given repo from remote location. Can be used to autmatically keep |
|
48 | Pulls given repo from remote location. Can be used to automatically keep | |
49 | remote repos upto date |
|
49 | remote repos upto date. This command can be executed only using admin users | |
|
50 | api_key | |||
50 |
|
51 | |||
51 | :: |
|
52 | :: | |
52 |
|
53 | |||
53 | method: "pull" |
|
54 | method: "pull" | |
54 | args: {"repo":<repo_name>} |
|
55 | args: {"repo":<repo_name>} | |
55 |
|
56 |
General Comments 0
You need to be logged in to leave comments.
Login now