Mercurial > public > src > rhodecode
annotate docs/api/api.rst @ 2481:7ac09514a178 beta
created rhodecode-api binary script for working with api via cli
- created docs
- moved the backup script to bin folder
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sun, 03 Jun 2012 20:35:13 +0200 |
parents | 04ef27ce939e |
children | 7e3e9d0c5575 |
rev | line source |
---|---|
1526 | 1 .. _api: |
2 | |
2191 | 3 === |
1526 | 4 API |
5 === | |
6 | |
7 | |
8 Starting from RhodeCode version 1.2 a simple API was implemented. | |
1580 | 9 There's a single schema for calling all api methods. API is implemented |
1676 | 10 with JSON protocol both ways. An url to send API request in RhodeCode is |
1580 | 11 <your_server>/_admin/api |
1526 | 12 |
1924 | 13 API ACCESS FOR WEB VIEWS |
14 ++++++++++++++++++++++++ | |
1526 | 15 |
1996 | 16 API access can also be turned on for each web view in RhodeCode that is |
17 decorated with `@LoginRequired` decorator. To enable API access simple change | |
18 the standard login decorator to `@LoginRequired(api_access=True)`. | |
19 After this change, a rhodecode view can be accessed without login by adding a | |
20 GET parameter `?api_key=<api_key>` to url. By default this is only | |
1896
320dec24fb9a
Added instruction on enabling the API access to web views
Marcin Kuzminski <marcin@python-works.com>
parents:
1895
diff
changeset
|
21 enabled on RSS/ATOM feed views. |
320dec24fb9a
Added instruction on enabling the API access to web views
Marcin Kuzminski <marcin@python-works.com>
parents:
1895
diff
changeset
|
22 |
320dec24fb9a
Added instruction on enabling the API access to web views
Marcin Kuzminski <marcin@python-works.com>
parents:
1895
diff
changeset
|
23 |
1924 | 24 API ACCESS |
25 ++++++++++ | |
26 | |
1793
fee9895fa46e
changed API to match fully JSON-RPC specs
Marcin Kuzminski <marcin@python-works.com>
parents:
1676
diff
changeset
|
27 All clients are required to send JSON-RPC spec JSON data:: |
1526 | 28 |
1793
fee9895fa46e
changed API to match fully JSON-RPC specs
Marcin Kuzminski <marcin@python-works.com>
parents:
1676
diff
changeset
|
29 { |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
30 "id:"<id>", |
1526 | 31 "api_key":"<api_key>", |
32 "method":"<method_name>", | |
33 "args":{"<arg_key>":"<arg_val>"} | |
34 } | |
35 | |
1580 | 36 Example call for autopulling remotes repos using curl:: |
1793
fee9895fa46e
changed API to match fully JSON-RPC specs
Marcin Kuzminski <marcin@python-works.com>
parents:
1676
diff
changeset
|
37 curl https://server.com/_admin/api -X POST -H 'content-type:text/plain' --data-binary '{"id":1,"api_key":"xe7cdb2v278e4evbdf5vs04v832v0efvcbcve4a3","method":"pull","args":{"repo":"CPython"}}' |
1580 | 38 |
1676 | 39 Simply provide |
1793
fee9895fa46e
changed API to match fully JSON-RPC specs
Marcin Kuzminski <marcin@python-works.com>
parents:
1676
diff
changeset
|
40 - *id* A value of any type, which is used to match the response with the request that it is replying to. |
1580 | 41 - *api_key* for access and permission validation. |
42 - *method* is name of method to call | |
43 - *args* is an key:value list of arguments to pass to method | |
1676 | 44 |
1526 | 45 .. note:: |
1676 | 46 |
47 api_key can be found in your user account page | |
48 | |
49 | |
1793
fee9895fa46e
changed API to match fully JSON-RPC specs
Marcin Kuzminski <marcin@python-works.com>
parents:
1676
diff
changeset
|
50 RhodeCode API will return always a JSON-RPC response:: |
1676 | 51 |
1793
fee9895fa46e
changed API to match fully JSON-RPC specs
Marcin Kuzminski <marcin@python-works.com>
parents:
1676
diff
changeset
|
52 { |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
53 "id":<id>, # matching id sent by request |
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
54 "result": "<result>"|null, # JSON formatted result, null if any errors |
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
55 "error": "null"|<error_message> # JSON formatted error (if any) |
1526 | 56 } |
57 | |
58 All responses from API will be `HTTP/1.0 200 OK`, if there's an error while | |
1676 | 59 calling api *error* key from response will contain failure description |
1526 | 60 and result will be null. |
61 | |
2481
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
62 |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
63 API CLIENT |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
64 ++++++++++ |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
65 |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
66 From version 1.4 RhodeCode adds a binary script that allows to easily |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
67 communicate with API. After installing RhodeCode a `rhodecode-api` script |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
68 will be available. |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
69 |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
70 To get started quickly simply run:: |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
71 |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
72 rhodecode-api _create_config --apikey=<youapikey> --apihost=<rhodecode host> |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
73 |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
74 This will create a file named .config in the directory you executed it storing |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
75 json config file with credentials. You can skip this step and always provide |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
76 both of the arguments to be able to communicate with server |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
77 |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
78 |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
79 after that simply run any api command for example get_repo:: |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
80 |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
81 rhodecode-api get_repo |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
82 |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
83 calling {"api_key": "<apikey>", "id": 75, "args": {}, "method": "get_repo"} to http://127.0.0.1:5000 |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
84 rhodecode said: |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
85 {'error': 'Missing non optional `repoid` arg in JSON DATA', |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
86 'id': 75, |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
87 'result': None} |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
88 |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
89 Ups looks like we forgot to add an argument |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
90 |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
91 Let's try again now giving the repoid as parameters:: |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
92 |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
93 rhodecode-api get_repo repoid:rhodecode |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
94 |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
95 calling {"api_key": "<apikey>", "id": 39, "args": {"repoid": "rhodecode"}, "method": "get_repo"} to http://127.0.0.1:5000 |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
96 rhodecode said: |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
97 {'error': None, |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
98 'id': 39, |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
99 'result': <json data...>} |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
100 |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
101 |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2480
diff
changeset
|
102 |
1526 | 103 API METHODS |
104 +++++++++++ | |
105 | |
1676 | 106 |
1526 | 107 pull |
108 ---- | |
109 | |
1676 | 110 Pulls given repo from remote location. Can be used to automatically keep |
111 remote repos up to date. This command can be executed only using api_key | |
1580 | 112 belonging to user with admin rights |
113 | |
114 INPUT:: | |
115 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
116 id : <id_for_response> |
1676 | 117 api_key : "<api_key>" |
118 method : "pull" | |
119 args : { | |
1928 | 120 "repo_name" : "<reponame>" |
1676 | 121 } |
122 | |
123 OUTPUT:: | |
124 | |
1928 | 125 result : "Pulled from <reponame>" |
1676 | 126 error : null |
127 | |
128 | |
1928 | 129 get_user |
130 -------- | |
131 | |
2098
14dffcfebb02
API get_user and get_repo methods can fetch by id or names
Marcin Kuzminski <marcin@python-works.com>
parents:
2097
diff
changeset
|
132 Get's an user by username or user_id, Returns empty result if user is not found. |
1928 | 133 This command can be executed only using api_key belonging to user with admin |
134 rights. | |
135 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
136 |
1928 | 137 INPUT:: |
138 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
139 id : <id_for_response> |
1928 | 140 api_key : "<api_key>" |
141 method : "get_user" | |
142 args : { | |
2098
14dffcfebb02
API get_user and get_repo methods can fetch by id or names
Marcin Kuzminski <marcin@python-works.com>
parents:
2097
diff
changeset
|
143 "userid" : "<username or user_id>" |
1928 | 144 } |
145 | |
146 OUTPUT:: | |
147 | |
148 result: None if user does not exist or | |
149 { | |
150 "id" : "<id>", | |
151 "username" : "<username>", | |
152 "firstname": "<firstname>", | |
153 "lastname" : "<lastname>", | |
154 "email" : "<email>", | |
155 "active" : "<bool>", | |
156 "admin" :Â "<bool>", | |
2249
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
157 "ldap_dn" : "<ldap_dn>", |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
158 "last_login": "<last_login>", |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
159 "permissions": { |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
160 "global": ["hg.create.repository", |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
161 "repository.read", |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
162 "hg.register.manual_activate"], |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
163 "repositories": {"repo1": "repository.none"}, |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
164 "repositories_groups": {"Group1": "group.read"} |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
165 }, |
1928 | 166 } |
167 | |
168 error: null | |
169 | |
170 | |
1676 | 171 get_users |
172 --------- | |
173 | |
174 Lists all existing users. This command can be executed only using api_key | |
175 belonging to user with admin rights. | |
176 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
177 |
1676 | 178 INPUT:: |
179 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
180 id : <id_for_response> |
1676 | 181 api_key : "<api_key>" |
182 method : "get_users" | |
183 args : { } | |
184 | |
185 OUTPUT:: | |
186 | |
187 result: [ | |
188 { | |
189 "id" : "<id>", | |
190 "username" : "<username>", | |
191 "firstname": "<firstname>", | |
192 "lastname" : "<lastname>", | |
193 "email" : "<email>", | |
194 "active" : "<bool>", | |
195 "admin" :Â "<bool>", | |
2249
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
196 "ldap_dn" : "<ldap_dn>", |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
197 "last_login": "<last_login>", |
1676 | 198 }, |
199 … | |
200 ] | |
201 error: null | |
202 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
203 |
1676 | 204 create_user |
205 ----------- | |
206 | |
2090
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
207 Creates new user. This command can |
1994
f2bd5b0c1094
create user api_doc update
Marcin Kuzminski <marcin@python-works.com>
parents:
1928
diff
changeset
|
208 be executed only using api_key belonging to user with admin rights. |
1676 | 209 |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
210 |
1676 | 211 INPUT:: |
212 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
213 id : <id_for_response> |
1676 | 214 api_key : "<api_key>" |
215 method : "create_user" | |
216 args : { | |
217 "username" : "<username>", | |
218 "password" : "<password>", | |
2036
4ae17f819ee8
#344 optional firstname lastname on user creation
Marcin Kuzminski <marcin@python-works.com>
parents:
1996
diff
changeset
|
219 "email" : "<useremail>", |
4ae17f819ee8
#344 optional firstname lastname on user creation
Marcin Kuzminski <marcin@python-works.com>
parents:
1996
diff
changeset
|
220 "firstname" : "<firstname> = None", |
4ae17f819ee8
#344 optional firstname lastname on user creation
Marcin Kuzminski <marcin@python-works.com>
parents:
1996
diff
changeset
|
221 "lastname" : "<lastname> = None", |
1676 | 222 "active" : "<bool> = True", |
223 "admin" : "<bool> = False", | |
224 "ldap_dn" : "<ldap_dn> = None" | |
225 } | |
1580 | 226 |
227 OUTPUT:: | |
228 | |
1676 | 229 result: { |
1928 | 230 "id" : "<new_user_id>", |
2467
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
231 "msg" : "created new user <username>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
232 "user": { |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
233 "id" : "<id>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
234 "username" : "<username>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
235 "firstname": "<firstname>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
236 "lastname" : "<lastname>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
237 "email" : "<email>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
238 "active" : "<bool>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
239 "admin" :Â "<bool>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
240 "ldap_dn" : "<ldap_dn>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
241 "last_login": "<last_login>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
242 }, |
1676 | 243 } |
244 error: null | |
245 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
246 |
2090
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
247 update_user |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
248 ----------- |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
249 |
2467
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
250 updates given user if such user exists. This command can |
2090
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
251 be executed only using api_key belonging to user with admin rights. |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
252 |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
253 |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
254 INPUT:: |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
255 |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
256 id : <id_for_response> |
2090
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
257 api_key : "<api_key>" |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
258 method : "update_user" |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
259 args : { |
2097 | 260 "userid" : "<user_id or username>", |
2090
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
261 "username" : "<username>", |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
262 "password" : "<password>", |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
263 "email" : "<useremail>", |
2097 | 264 "firstname" : "<firstname>", |
265 "lastname" : "<lastname>", | |
266 "active" : "<bool>", | |
267 "admin" : "<bool>", | |
268 "ldap_dn" : "<ldap_dn>" | |
2090
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
269 } |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
270 |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
271 OUTPUT:: |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
272 |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
273 result: { |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
274 "id" : "<edited_user_id>", |
2467
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
275 "msg" : "updated user ID:<userid> <username>" |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
276 } |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
277 error: null |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
278 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
279 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
280 delete_user |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
281 ----------- |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
282 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
283 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
284 deletes givenuser if such user exists. This command can |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
285 be executed only using api_key belonging to user with admin rights. |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
286 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
287 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
288 INPUT:: |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
289 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
290 id : <id_for_response> |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
291 api_key : "<api_key>" |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
292 method : "delete_user" |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
293 args : { |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
294 "userid" : "<user_id or username>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
295 } |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
296 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
297 OUTPUT:: |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
298 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
299 result: { |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
300 "id" : "<edited_user_id>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
301 "msg" : "deleted user ID:<userid> <username>" |
2090
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
302 } |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
303 error: null |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
304 |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
305 |
1676 | 306 get_users_group |
307 --------------- | |
308 | |
309 Gets an existing users group. This command can be executed only using api_key | |
310 belonging to user with admin rights. | |
311 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
312 |
1676 | 313 INPUT:: |
314 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
315 id : <id_for_response> |
1676 | 316 api_key : "<api_key>" |
317 method : "get_users_group" | |
318 args : { | |
319 "group_name" : "<name>" | |
320 } | |
321 | |
322 OUTPUT:: | |
323 | |
324 result : None if group not exist | |
325 { | |
1928 | 326 "id" : "<id>", |
327 "group_name" : "<groupname>", | |
328 "active": "<bool>", | |
1676 | 329 "members" : [ |
1928 | 330 { "id" : "<userid>", |
331 "username" : "<username>", | |
332 "firstname": "<firstname>", | |
333 "lastname" : "<lastname>", | |
334 "email" : "<email>", | |
335 "active" : "<bool>", | |
336 "admin" :Â "<bool>", | |
337 "ldap" : "<ldap_dn>" | |
338 }, | |
339 … | |
340 ] | |
1676 | 341 } |
342 error : null | |
343 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
344 |
1928 | 345 get_users_groups |
346 ---------------- | |
347 | |
348 Lists all existing users groups. This command can be executed only using | |
349 api_key belonging to user with admin rights. | |
350 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
351 |
1928 | 352 INPUT:: |
353 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
354 id : <id_for_response> |
1928 | 355 api_key : "<api_key>" |
356 method : "get_users_groups" | |
357 args : { } | |
358 | |
359 OUTPUT:: | |
360 | |
361 result : [ | |
362 { | |
363 "id" : "<id>", | |
364 "group_name" : "<groupname>", | |
365 "active": "<bool>", | |
366 "members" : [ | |
367 { | |
368 "id" : "<userid>", | |
369 "username" : "<username>", | |
370 "firstname": "<firstname>", | |
371 "lastname" : "<lastname>", | |
372 "email" : "<email>", | |
373 "active" : "<bool>", | |
374 "admin" :Â "<bool>", | |
375 "ldap" : "<ldap_dn>" | |
376 }, | |
377 … | |
378 ] | |
379 } | |
380 ] | |
381 error : null | |
382 | |
383 | |
1580 | 384 create_users_group |
385 ------------------ | |
386 | |
1676 | 387 Creates new users group. This command can be executed only using api_key |
1580 | 388 belonging to user with admin rights |
389 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
390 |
1580 | 391 INPUT:: |
392 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
393 id : <id_for_response> |
1676 | 394 api_key : "<api_key>" |
395 method : "create_users_group" | |
396 args: { | |
1928 | 397 "group_name": "<groupname>", |
1676 | 398 "active":"<bool> = True" |
399 } | |
400 | |
401 OUTPUT:: | |
402 | |
403 result: { | |
404 "id": "<newusersgroupid>", | |
1928 | 405 "msg": "created new users group <groupname>" |
1676 | 406 } |
407 error: null | |
408 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
409 |
1878
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
410 add_user_to_users_group |
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
411 ----------------------- |
1676 | 412 |
2077 | 413 Adds a user to a users group. If user exists in that group success will be |
414 `false`. This command can be executed only using api_key | |
1676 | 415 belonging to user with admin rights |
416 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
417 |
1676 | 418 INPUT:: |
419 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
420 id : <id_for_response> |
1676 | 421 api_key : "<api_key>" |
422 method : "add_user_users_group" | |
423 args: { | |
424 "group_name" : "<groupname>", | |
1895
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
425 "username" : "<username>" |
1676 | 426 } |
427 | |
428 OUTPUT:: | |
429 | |
430 result: { | |
431 "id": "<newusersgroupmemberid>", | |
2077 | 432 "success": True|False # depends on if member is in group |
433 "msg": "added member <username> to users group <groupname> | | |
434 User is already in that group" | |
435 } | |
436 error: null | |
437 | |
438 | |
439 remove_user_from_users_group | |
440 ---------------------------- | |
441 | |
442 Removes a user from a users group. If user is not in given group success will | |
443 be `false`. This command can be executed only | |
444 using api_key belonging to user with admin rights | |
445 | |
446 | |
447 INPUT:: | |
448 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
449 id : <id_for_response> |
2077 | 450 api_key : "<api_key>" |
451 method : "remove_user_from_users_group" | |
452 args: { | |
453 "group_name" : "<groupname>", | |
454 "username" : "<username>" | |
455 } | |
456 | |
457 OUTPUT:: | |
458 | |
459 result: { | |
460 "success": True|False, # depends on if member is in group | |
461 "msg": "removed member <username> from users group <groupname> | | |
462 User wasn't in group" | |
1676 | 463 } |
464 error: null | |
465 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
466 |
1928 | 467 get_repo |
468 -------- | |
469 | |
2244 | 470 Gets an existing repository by it's name or repository_id. Members will return |
471 either users_group or user associated to that repository. This command can | |
2098
14dffcfebb02
API get_user and get_repo methods can fetch by id or names
Marcin Kuzminski <marcin@python-works.com>
parents:
2097
diff
changeset
|
472 be executed only using api_key belonging to user with admin rights. |
1928 | 473 |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
474 |
1928 | 475 INPUT:: |
476 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
477 id : <id_for_response> |
1928 | 478 api_key : "<api_key>" |
479 method : "get_repo" | |
480 args: { | |
2098
14dffcfebb02
API get_user and get_repo methods can fetch by id or names
Marcin Kuzminski <marcin@python-works.com>
parents:
2097
diff
changeset
|
481 "repoid" : "<reponame or repo_id>" |
1928 | 482 } |
483 | |
484 OUTPUT:: | |
485 | |
486 result: None if repository does not exist or | |
487 { | |
488 "id" : "<id>", | |
489 "repo_name" : "<reponame>" | |
490 "type" : "<type>", | |
491 "description" : "<description>", | |
2440
347b00545b60
Updated API to return clone_uri, private, created_on
Marcin Kuzminski <marcin@python-works.com>
parents:
2249
diff
changeset
|
492 "clone_uri" : "<clone_uri>", |
347b00545b60
Updated API to return clone_uri, private, created_on
Marcin Kuzminski <marcin@python-works.com>
parents:
2249
diff
changeset
|
493 "private": : "<bool>", |
347b00545b60
Updated API to return clone_uri, private, created_on
Marcin Kuzminski <marcin@python-works.com>
parents:
2249
diff
changeset
|
494 "created_on" : "<datetimecreated>", |
1928 | 495 "members" : [ |
2244 | 496 { |
497 "type": "user", | |
498 "id" : "<userid>", | |
1928 | 499 "username" : "<username>", |
500 "firstname": "<firstname>", | |
501 "lastname" : "<lastname>", | |
502 "email" : "<email>", | |
503 "active" : "<bool>", | |
504 "admin" :Â "<bool>", | |
505 "ldap" : "<ldap_dn>", | |
506 "permission" : "repository.(read|write|admin)" | |
507 }, | |
508 … | |
2244 | 509 { |
510 "type": "users_group", | |
1928 | 511 "id" : "<usersgroupid>", |
512 "name" : "<usersgroupname>", | |
513 "active": "<bool>", | |
514 "permission" : "repository.(read|write|admin)" | |
515 }, | |
516 … | |
517 ] | |
518 } | |
519 error: null | |
520 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
521 |
1676 | 522 get_repos |
523 --------- | |
524 | |
525 Lists all existing repositories. This command can be executed only using api_key | |
526 belonging to user with admin rights | |
527 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
528 |
1676 | 529 INPUT:: |
530 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
531 id : <id_for_response> |
1676 | 532 api_key : "<api_key>" |
533 method : "get_repos" | |
534 args: { } | |
1580 | 535 |
536 OUTPUT:: | |
537 | |
1676 | 538 result: [ |
539 { | |
540 "id" : "<id>", | |
1928 | 541 "repo_name" : "<reponame>" |
1676 | 542 "type" : "<type>", |
2440
347b00545b60
Updated API to return clone_uri, private, created_on
Marcin Kuzminski <marcin@python-works.com>
parents:
2249
diff
changeset
|
543 "description" : "<description>", |
347b00545b60
Updated API to return clone_uri, private, created_on
Marcin Kuzminski <marcin@python-works.com>
parents:
2249
diff
changeset
|
544 "clone_uri" : "<clone_uri>", |
347b00545b60
Updated API to return clone_uri, private, created_on
Marcin Kuzminski <marcin@python-works.com>
parents:
2249
diff
changeset
|
545 "private": : "<bool>", |
347b00545b60
Updated API to return clone_uri, private, created_on
Marcin Kuzminski <marcin@python-works.com>
parents:
2249
diff
changeset
|
546 "created_on" : "<datetimecreated>", |
1676 | 547 }, |
548 … | |
549 ] | |
550 error: null | |
551 | |
552 | |
1895
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
553 get_repo_nodes |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
554 -------------- |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
555 |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
556 returns a list of nodes and it's children in a flat list for a given path |
1928 | 557 at given revision. It's possible to specify ret_type to show only `files` or |
558 `dirs`. This command can be executed only using api_key belonging to user | |
1895
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
559 with admin rights |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
560 |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
561 |
1895
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
562 INPUT:: |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
563 |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
564 id : <id_for_response> |
1895
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
565 api_key : "<api_key>" |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
566 method : "get_repo_nodes" |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
567 args: { |
1928 | 568 "repo_name" : "<reponame>", |
1895
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
569 "revision" : "<revision>", |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
570 "root_path" : "<root_path>", |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
571 "ret_type" : "<ret_type>" = 'all' |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
572 } |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
573 |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
574 OUTPUT:: |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
575 |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
576 result: [ |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
577 { |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
578 "name" : "<name>" |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
579 "type" : "<type>", |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
580 }, |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
581 … |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
582 ] |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
583 error: null |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
584 |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
585 |
1676 | 586 create_repo |
587 ----------- | |
588 | |
589 Creates a repository. This command can be executed only using api_key | |
590 belonging to user with admin rights. | |
591 If repository name contains "/", all needed repository groups will be created. | |
592 For example "foo/bar/baz" will create groups "foo", "bar" (with "foo" as parent), | |
593 and create "baz" repository with "bar" as group. | |
594 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
595 |
1676 | 596 INPUT:: |
597 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
598 id : <id_for_response> |
1676 | 599 api_key : "<api_key>" |
600 method : "create_repo" | |
601 args: { | |
1928 | 602 "repo_name" : "<reponame>", |
1676 | 603 "owner_name" : "<ownername>", |
604 "description" : "<description> = ''", | |
605 "repo_type" : "<type> = 'hg'", | |
2094
34d009e5147a
added clone_uri to API method for creating users
Marcin Kuzminski <marcin@python-works.com>
parents:
2091
diff
changeset
|
606 "private" : "<bool> = False", |
34d009e5147a
added clone_uri to API method for creating users
Marcin Kuzminski <marcin@python-works.com>
parents:
2091
diff
changeset
|
607 "clone_uri" : "<clone_uri> = None", |
1676 | 608 } |
609 | |
610 OUTPUT:: | |
611 | |
1928 | 612 result: { |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
613 "id": "<newrepoid>", |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
614 "msg": "Created new repository <reponame>", |
2480
04ef27ce939e
API: create_repo returns now repo object after creation
Marcin Kuzminski <marcin@python-works.com>
parents:
2467
diff
changeset
|
615 "repo": { |
04ef27ce939e
API: create_repo returns now repo object after creation
Marcin Kuzminski <marcin@python-works.com>
parents:
2467
diff
changeset
|
616 "id" : "<id>", |
04ef27ce939e
API: create_repo returns now repo object after creation
Marcin Kuzminski <marcin@python-works.com>
parents:
2467
diff
changeset
|
617 "repo_name" : "<reponame>" |
04ef27ce939e
API: create_repo returns now repo object after creation
Marcin Kuzminski <marcin@python-works.com>
parents:
2467
diff
changeset
|
618 "type" : "<type>", |
04ef27ce939e
API: create_repo returns now repo object after creation
Marcin Kuzminski <marcin@python-works.com>
parents:
2467
diff
changeset
|
619 "description" : "<description>", |
04ef27ce939e
API: create_repo returns now repo object after creation
Marcin Kuzminski <marcin@python-works.com>
parents:
2467
diff
changeset
|
620 "clone_uri" : "<clone_uri>", |
04ef27ce939e
API: create_repo returns now repo object after creation
Marcin Kuzminski <marcin@python-works.com>
parents:
2467
diff
changeset
|
621 "private": : "<bool>", |
04ef27ce939e
API: create_repo returns now repo object after creation
Marcin Kuzminski <marcin@python-works.com>
parents:
2467
diff
changeset
|
622 "created_on" : "<datetimecreated>", |
04ef27ce939e
API: create_repo returns now repo object after creation
Marcin Kuzminski <marcin@python-works.com>
parents:
2467
diff
changeset
|
623 }, |
1928 | 624 } |
1676 | 625 error: null |
626 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
627 |
2091
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
628 delete_repo |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
629 ----------- |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
630 |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
631 Deletes a repository. This command can be executed only using api_key |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
632 belonging to user with admin rights. |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
633 |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
634 |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
635 INPUT:: |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
636 |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
637 id : <id_for_response> |
2091
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
638 api_key : "<api_key>" |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
639 method : "delete_repo" |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
640 args: { |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
641 "repo_name" : "<reponame>", |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
642 } |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
643 |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
644 OUTPUT:: |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
645 |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
646 result: { |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
647 "msg": "Deleted repository <reponame>", |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
648 } |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
649 error: null |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
650 |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
651 |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
652 grant_user_permission |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
653 --------------------- |
1676 | 654 |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
655 Grant permission for user on given repository, or update existing one |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
656 if found. This command can be executed only using api_key belonging to user |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
657 with admin rights. |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
658 |
1676 | 659 |
660 INPUT:: | |
661 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
662 id : <id_for_response> |
1676 | 663 api_key : "<api_key>" |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
664 method : "grant_user_permission" |
1676 | 665 args: { |
666 "repo_name" : "<reponame>", | |
1928 | 667 "username" : "<username>", |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
668 "perm" : "(repository.(none|read|write|admin))", |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
669 } |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
670 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
671 OUTPUT:: |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
672 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
673 result: { |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
674 "msg" : "Granted perm: <perm> for user: <username> in repo: <reponame>" |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
675 } |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
676 error: null |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
677 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
678 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
679 revoke_user_permission |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
680 ---------------------- |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
681 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
682 Revoke permission for user on given repository. This command can be executed |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
683 only using api_key belonging to user with admin rights. |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
684 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
685 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
686 INPUT:: |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
687 |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
688 id : <id_for_response> |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
689 api_key : "<api_key>" |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
690 method : "revoke_user_permission" |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
691 args: { |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
692 "repo_name" : "<reponame>", |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
693 "username" : "<username>", |
1676 | 694 } |
695 | |
696 OUTPUT:: | |
697 | |
1928 | 698 result: { |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
699 "msg" : "Revoked perm for user: <suername> in repo: <reponame>" |
1928 | 700 } |
1676 | 701 error: null |
1878
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
702 |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
703 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
704 grant_users_group_permission |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
705 ---------------------------- |
1878
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
706 |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
707 Grant permission for users group on given repository, or update |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
708 existing one if found. This command can be executed only using |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
709 api_key belonging to user with admin rights. |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
710 |
1878
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
711 |
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
712 INPUT:: |
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
713 |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
714 id : <id_for_response> |
1878
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
715 api_key : "<api_key>" |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
716 method : "grant_users_group_permission" |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
717 args: { |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
718 "repo_name" : "<reponame>", |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
719 "group_name" : "<usersgroupname>", |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
720 "perm" : "(repository.(none|read|write|admin))", |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
721 } |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
722 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
723 OUTPUT:: |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
724 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
725 result: { |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
726 "msg" : "Granted perm: <perm> for group: <usersgroupname> in repo: <reponame>" |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
727 } |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
728 error: null |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
729 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
730 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
731 revoke_users_group_permission |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
732 ----------------------------- |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
733 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
734 Revoke permission for users group on given repository.This command can be |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
735 executed only using api_key belonging to user with admin rights. |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
736 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
737 INPUT:: |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
738 |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
739 id : <id_for_response> |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
740 api_key : "<api_key>" |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
741 method : "revoke_users_group_permission" |
1878
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
742 args: { |
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
743 "repo_name" : "<reponame>", |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
744 "users_group" : "<usersgroupname>", |
1928 | 745 } |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
746 |
1928 | 747 OUTPUT:: |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
748 |
1928 | 749 result: { |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
750 "msg" : "Revoked perm for group: <usersgroupname> in repo: <reponame>" |
1928 | 751 } |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
752 error: null |