Mercurial > public > src > rhodecode
annotate docs/api/api.rst @ 2633:d80a68e2ebcc beta
return proper id from users_group
update api docs
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sun, 01 Jul 2012 23:36:03 +0200 |
parents | 374693af2849 |
children | 4565e655ea2a |
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 |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
10 with JSON protocol both ways. An url to send API request to 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 |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
66 From version 1.4 RhodeCode adds a script that allows to easily |
2481
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 : { | |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
120 "repoid" : "<reponame or repo_id>" |
1676 | 121 } |
122 | |
123 OUTPUT:: | |
124 | |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
125 id : <id_given_in_input> |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
126 result : "Pulled from `<reponame>`" |
1676 | 127 error : null |
128 | |
129 | |
1928 | 130 get_user |
131 -------- | |
132 | |
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
|
133 Get's an user by username or user_id, Returns empty result if user is not found. |
1928 | 134 This command can be executed only using api_key belonging to user with admin |
135 rights. | |
136 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
137 |
1928 | 138 INPUT:: |
139 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
140 id : <id_for_response> |
1928 | 141 api_key : "<api_key>" |
142 method : "get_user" | |
143 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
|
144 "userid" : "<username or user_id>" |
1928 | 145 } |
146 | |
147 OUTPUT:: | |
148 | |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
149 id : <id_given_in_input> |
1928 | 150 result: None if user does not exist or |
151 { | |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
152 "user_id" : "<user_id>", |
1928 | 153 "username" : "<username>", |
154 "firstname": "<firstname>", | |
155 "lastname" : "<lastname>", | |
156 "email" : "<email>", | |
2608
7e3e9d0c5575
Add list of all emails that user may have into get_user call
Marcin Kuzminski <marcin@python-works.com>
parents:
2481
diff
changeset
|
157 "emails": "<list_of_all_additional_emails>", |
1928 | 158 "active" : "<bool>", |
159 "admin" :Â "<bool>", | |
2249
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
160 "ldap_dn" : "<ldap_dn>", |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
161 "last_login": "<last_login>", |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
162 "permissions": { |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
163 "global": ["hg.create.repository", |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
164 "repository.read", |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
165 "hg.register.manual_activate"], |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
166 "repositories": {"repo1": "repository.none"}, |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
167 "repositories_groups": {"Group1": "group.read"} |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
168 }, |
1928 | 169 } |
170 | |
171 error: null | |
172 | |
173 | |
1676 | 174 get_users |
175 --------- | |
176 | |
177 Lists all existing users. This command can be executed only using api_key | |
178 belonging to user with admin rights. | |
179 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
180 |
1676 | 181 INPUT:: |
182 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
183 id : <id_for_response> |
1676 | 184 api_key : "<api_key>" |
185 method : "get_users" | |
186 args : { } | |
187 | |
188 OUTPUT:: | |
189 | |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
190 id : <id_given_in_input> |
1676 | 191 result: [ |
192 { | |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
193 "user_id" : "<user_id>", |
1676 | 194 "username" : "<username>", |
195 "firstname": "<firstname>", | |
196 "lastname" : "<lastname>", | |
197 "email" : "<email>", | |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
198 "emails": "<list_of_all_additional_emails>", |
1676 | 199 "active" : "<bool>", |
200 "admin" :Â "<bool>", | |
2249
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
201 "ldap_dn" : "<ldap_dn>", |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
202 "last_login": "<last_login>", |
1676 | 203 }, |
204 … | |
205 ] | |
206 error: null | |
207 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
208 |
1676 | 209 create_user |
210 ----------- | |
211 | |
2090
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
212 Creates new user. This command can |
1994
f2bd5b0c1094
create user api_doc update
Marcin Kuzminski <marcin@python-works.com>
parents:
1928
diff
changeset
|
213 be executed only using api_key belonging to user with admin rights. |
1676 | 214 |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
215 |
1676 | 216 INPUT:: |
217 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
218 id : <id_for_response> |
1676 | 219 api_key : "<api_key>" |
220 method : "create_user" | |
221 args : { | |
222 "username" : "<username>", | |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
223 "email" : "<useremail>", |
1676 | 224 "password" : "<password>", |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
225 "firstname" : "<firstname> = Optional(None)", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
226 "lastname" : "<lastname> = Optional(None)", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
227 "active" : "<bool> = Optional(True)", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
228 "admin" : "<bool> = Optional(False)", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
229 "ldap_dn" : "<ldap_dn> = Optional(None)" |
1676 | 230 } |
1580 | 231 |
232 OUTPUT:: | |
233 | |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
234 id : <id_given_in_input> |
1676 | 235 result: { |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
236 "msg" : "created new user `<username>`", |
2467
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
237 "user": { |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
238 "user_id" : "<user_id>", |
2467
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
239 "username" : "<username>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
240 "firstname": "<firstname>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
241 "lastname" : "<lastname>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
242 "email" : "<email>", |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
243 "emails": "<list_of_all_additional_emails>", |
2467
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
244 "active" : "<bool>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
245 "admin" :Â "<bool>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
246 "ldap_dn" : "<ldap_dn>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
247 "last_login": "<last_login>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
248 }, |
1676 | 249 } |
250 error: null | |
251 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
252 |
2090
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
253 update_user |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
254 ----------- |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
255 |
2467
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
256 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
|
257 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
|
258 |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
259 |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
260 INPUT:: |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
261 |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
262 id : <id_for_response> |
2090
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
263 api_key : "<api_key>" |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
264 method : "update_user" |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
265 args : { |
2097 | 266 "userid" : "<user_id or username>", |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
267 "username" : "<username> = Optional", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
268 "email" : "<useremail> = Optional", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
269 "password" : "<password> = Optional", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
270 "firstname" : "<firstname> = Optional", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
271 "lastname" : "<lastname> = Optional", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
272 "active" : "<bool> = Optional", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
273 "admin" : "<bool> = Optional", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
274 "ldap_dn" : "<ldap_dn> = Optional" |
2090
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
275 } |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
276 |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
277 OUTPUT:: |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
278 |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
279 id : <id_given_in_input> |
2090
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
280 result: { |
2609
374693af2849
API: update_user returns new updated user data
Marcin Kuzminski <marcin@python-works.com>
parents:
2608
diff
changeset
|
281 "msg" : "updated user ID:<userid> <username>", |
374693af2849
API: update_user returns new updated user data
Marcin Kuzminski <marcin@python-works.com>
parents:
2608
diff
changeset
|
282 "user": { |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
283 "user_id" : "<user_id>", |
2609
374693af2849
API: update_user returns new updated user data
Marcin Kuzminski <marcin@python-works.com>
parents:
2608
diff
changeset
|
284 "username" : "<username>", |
374693af2849
API: update_user returns new updated user data
Marcin Kuzminski <marcin@python-works.com>
parents:
2608
diff
changeset
|
285 "firstname": "<firstname>", |
374693af2849
API: update_user returns new updated user data
Marcin Kuzminski <marcin@python-works.com>
parents:
2608
diff
changeset
|
286 "lastname" : "<lastname>", |
374693af2849
API: update_user returns new updated user data
Marcin Kuzminski <marcin@python-works.com>
parents:
2608
diff
changeset
|
287 "email" : "<email>", |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
288 "emails": "<list_of_all_additional_emails>", |
2609
374693af2849
API: update_user returns new updated user data
Marcin Kuzminski <marcin@python-works.com>
parents:
2608
diff
changeset
|
289 "active" : "<bool>", |
374693af2849
API: update_user returns new updated user data
Marcin Kuzminski <marcin@python-works.com>
parents:
2608
diff
changeset
|
290 "admin" :Â "<bool>", |
374693af2849
API: update_user returns new updated user data
Marcin Kuzminski <marcin@python-works.com>
parents:
2608
diff
changeset
|
291 "ldap_dn" : "<ldap_dn>", |
374693af2849
API: update_user returns new updated user data
Marcin Kuzminski <marcin@python-works.com>
parents:
2608
diff
changeset
|
292 "last_login": "<last_login>", |
374693af2849
API: update_user returns new updated user data
Marcin Kuzminski <marcin@python-works.com>
parents:
2608
diff
changeset
|
293 }, |
2467
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
294 } |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
295 error: null |
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 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
298 delete_user |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
299 ----------- |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
300 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
301 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
302 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
|
303 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
|
304 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
305 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
306 INPUT:: |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
307 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
308 id : <id_for_response> |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
309 api_key : "<api_key>" |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
310 method : "delete_user" |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
311 args : { |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
312 "userid" : "<user_id or username>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
313 } |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
314 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
315 OUTPUT:: |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
316 |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
317 id : <id_given_in_input> |
2467
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
318 result: { |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
319 "msg" : "deleted user ID:<userid> <username>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
320 "user": null |
2090
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
321 } |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
322 error: null |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
323 |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
324 |
1676 | 325 get_users_group |
326 --------------- | |
327 | |
328 Gets an existing users group. This command can be executed only using api_key | |
329 belonging to user with admin rights. | |
330 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
331 |
1676 | 332 INPUT:: |
333 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
334 id : <id_for_response> |
1676 | 335 api_key : "<api_key>" |
336 method : "get_users_group" | |
337 args : { | |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
338 "usersgroupid" : "<users group id or name>" |
1676 | 339 } |
340 | |
341 OUTPUT:: | |
342 | |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
343 id : <id_given_in_input> |
1676 | 344 result : None if group not exist |
345 { | |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
346 "users_group_id" : "<id>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
347 "group_name" : "<groupname>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
348 "active": "<bool>", |
1676 | 349 "members" : [ |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
350 { |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
351 "user_id" : "<user_id>", |
1928 | 352 "username" : "<username>", |
353 "firstname": "<firstname>", | |
354 "lastname" : "<lastname>", | |
355 "email" : "<email>", | |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
356 "emails": "<list_of_all_additional_emails>", |
1928 | 357 "active" : "<bool>", |
358 "admin" :Â "<bool>", | |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
359 "ldap_dn" : "<ldap_dn>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
360 "last_login": "<last_login>", |
1928 | 361 }, |
362 … | |
363 ] | |
1676 | 364 } |
365 error : null | |
366 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
367 |
1928 | 368 get_users_groups |
369 ---------------- | |
370 | |
371 Lists all existing users groups. This command can be executed only using | |
372 api_key belonging to user with admin rights. | |
373 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
374 |
1928 | 375 INPUT:: |
376 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
377 id : <id_for_response> |
1928 | 378 api_key : "<api_key>" |
379 method : "get_users_groups" | |
380 args : { } | |
381 | |
382 OUTPUT:: | |
383 | |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
384 id : <id_given_in_input> |
1928 | 385 result : [ |
386 { | |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
387 "users_group_id" : "<id>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
388 "group_name" : "<groupname>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
389 "active": "<bool>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
390 "members" : [ |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
391 { |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
392 "user_id" : "<user_id>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
393 "username" : "<username>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
394 "firstname": "<firstname>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
395 "lastname" : "<lastname>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
396 "email" : "<email>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
397 "emails": "<list_of_all_additional_emails>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
398 "active" : "<bool>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
399 "admin" :Â "<bool>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
400 "ldap_dn" : "<ldap_dn>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
401 "last_login": "<last_login>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
402 }, |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
403 … |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
404 ] |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
405 }, |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
406 … |
1928 | 407 ] |
408 error : null | |
409 | |
410 | |
1580 | 411 create_users_group |
412 ------------------ | |
413 | |
1676 | 414 Creates new users group. This command can be executed only using api_key |
1580 | 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 |
1580 | 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 : "create_users_group" | |
423 args: { | |
1928 | 424 "group_name": "<groupname>", |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
425 "active":"<bool> = Optional(True)" |
1676 | 426 } |
427 | |
428 OUTPUT:: | |
429 | |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
430 id : <id_given_in_input> |
1676 | 431 result: { |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
432 "msg": "created new users group `<groupname>`", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
433 "users_group": { |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
434 "users_group_id" : "<id>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
435 "group_name" : "<groupname>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
436 "active": "<bool>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
437 "members" : [ |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
438 { |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
439 "user_id" : "<user_id>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
440 "username" : "<username>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
441 "firstname": "<firstname>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
442 "lastname" : "<lastname>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
443 "email" : "<email>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
444 "emails": "<list_of_all_additional_emails>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
445 "active" : "<bool>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
446 "admin" :Â "<bool>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
447 "ldap_dn" : "<ldap_dn>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
448 "last_login": "<last_login>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
449 }, |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
450 … |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
451 ] |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
452 }, |
1676 | 453 } |
454 error: null | |
455 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
456 |
1878
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
457 add_user_to_users_group |
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
458 ----------------------- |
1676 | 459 |
2077 | 460 Adds a user to a users group. If user exists in that group success will be |
461 `false`. This command can be executed only using api_key | |
1676 | 462 belonging to user with admin rights |
463 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
464 |
1676 | 465 INPUT:: |
466 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
467 id : <id_for_response> |
1676 | 468 api_key : "<api_key>" |
469 method : "add_user_users_group" | |
470 args: { | |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
471 "usersgroupid" : "<users group id or name>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
472 "userid" : "<user_id or username>", |
1676 | 473 } |
474 | |
475 OUTPUT:: | |
476 | |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
477 id : <id_given_in_input> |
1676 | 478 result: { |
2077 | 479 "success": True|False # depends on if member is in group |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
480 "msg": "added member `<username>` to users group `<groupname>` | |
2077 | 481 User is already in that group" |
482 } | |
483 error: null | |
484 | |
485 | |
486 remove_user_from_users_group | |
487 ---------------------------- | |
488 | |
489 Removes a user from a users group. If user is not in given group success will | |
490 be `false`. This command can be executed only | |
491 using api_key belonging to user with admin rights | |
492 | |
493 | |
494 INPUT:: | |
495 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
496 id : <id_for_response> |
2077 | 497 api_key : "<api_key>" |
498 method : "remove_user_from_users_group" | |
499 args: { | |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
500 "usersgroupid" : "<users group id or name>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
501 "userid" : "<user_id or username>", |
2077 | 502 } |
503 | |
504 OUTPUT:: | |
505 | |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
506 id : <id_given_in_input> |
2077 | 507 result: { |
508 "success": True|False, # depends on if member is in group | |
509 "msg": "removed member <username> from users group <groupname> | | |
510 User wasn't in group" | |
1676 | 511 } |
512 error: null | |
513 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
514 |
1928 | 515 get_repo |
516 -------- | |
517 | |
2244 | 518 Gets an existing repository by it's name or repository_id. Members will return |
519 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
|
520 be executed only using api_key belonging to user with admin rights. |
1928 | 521 |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
522 |
1928 | 523 INPUT:: |
524 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
525 id : <id_for_response> |
1928 | 526 api_key : "<api_key>" |
527 method : "get_repo" | |
528 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
|
529 "repoid" : "<reponame or repo_id>" |
1928 | 530 } |
531 | |
532 OUTPUT:: | |
533 | |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
534 id : <id_given_in_input> |
1928 | 535 result: None if repository does not exist or |
536 { | |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
537 "repo_id" : "<repo_id>", |
1928 | 538 "repo_name" : "<reponame>" |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
539 "repo_type" : "<repo_type>", |
2440
347b00545b60
Updated API to return clone_uri, private, created_on
Marcin Kuzminski <marcin@python-works.com>
parents:
2249
diff
changeset
|
540 "clone_uri" : "<clone_uri>", |
347b00545b60
Updated API to return clone_uri, private, created_on
Marcin Kuzminski <marcin@python-works.com>
parents:
2249
diff
changeset
|
541 "private": : "<bool>", |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
542 "created_on" : "<datetimecreated>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
543 "description" : "<description>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
544 "landing_rev": "<landing_rev>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
545 "owner": "<repo_owner>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
546 "fork_of": "<name_of_fork_parent>", |
1928 | 547 "members" : [ |
2244 | 548 { |
549 "type": "user", | |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
550 "user_id" : "<user_id>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
551 "username" : "<username>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
552 "firstname": "<firstname>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
553 "lastname" : "<lastname>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
554 "email" : "<email>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
555 "emails": "<list_of_all_additional_emails>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
556 "active" : "<bool>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
557 "admin" :Â "<bool>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
558 "ldap_dn" : "<ldap_dn>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
559 "last_login": "<last_login>", |
1928 | 560 "permission" : "repository.(read|write|admin)" |
561 }, | |
562 … | |
2244 | 563 { |
564 "type": "users_group", | |
1928 | 565 "id" : "<usersgroupid>", |
566 "name" : "<usersgroupname>", | |
567 "active": "<bool>", | |
568 "permission" : "repository.(read|write|admin)" | |
569 }, | |
570 … | |
571 ] | |
572 } | |
573 error: null | |
574 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
575 |
1676 | 576 get_repos |
577 --------- | |
578 | |
579 Lists all existing repositories. This command can be executed only using api_key | |
580 belonging to user with admin rights | |
581 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
582 |
1676 | 583 INPUT:: |
584 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
585 id : <id_for_response> |
1676 | 586 api_key : "<api_key>" |
587 method : "get_repos" | |
588 args: { } | |
1580 | 589 |
590 OUTPUT:: | |
591 | |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
592 id : <id_given_in_input> |
1676 | 593 result: [ |
594 { | |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
595 "repo_id" : "<repo_id>", |
1928 | 596 "repo_name" : "<reponame>" |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
597 "repo_type" : "<repo_type>", |
2440
347b00545b60
Updated API to return clone_uri, private, created_on
Marcin Kuzminski <marcin@python-works.com>
parents:
2249
diff
changeset
|
598 "clone_uri" : "<clone_uri>", |
347b00545b60
Updated API to return clone_uri, private, created_on
Marcin Kuzminski <marcin@python-works.com>
parents:
2249
diff
changeset
|
599 "private": : "<bool>", |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
600 "created_on" : "<datetimecreated>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
601 "description" : "<description>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
602 "landing_rev": "<landing_rev>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
603 "owner": "<repo_owner>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
604 "fork_of": "<name_of_fork_parent>", |
1676 | 605 }, |
606 … | |
607 ] | |
608 error: null | |
609 | |
610 | |
1895
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
611 get_repo_nodes |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
612 -------------- |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
613 |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
614 returns a list of nodes and it's children in a flat list for a given path |
1928 | 615 at given revision. It's possible to specify ret_type to show only `files` or |
616 `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
|
617 with admin rights |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
618 |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
619 |
1895
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
620 INPUT:: |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
621 |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
622 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
|
623 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
|
624 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
|
625 args: { |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
626 "repoid" : "<reponame or repo_id>" |
1895
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
627 "revision" : "<revision>", |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
628 "root_path" : "<root_path>", |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
629 "ret_type" : "<ret_type> = Optional('all')" |
1895
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
630 } |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
631 |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
632 OUTPUT:: |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
633 |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
634 id : <id_given_in_input> |
1895
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
635 result: [ |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
636 { |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
637 "name" : "<name>" |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
638 "type" : "<type>", |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
639 }, |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
640 … |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
641 ] |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
642 error: null |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
643 |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
644 |
1676 | 645 create_repo |
646 ----------- | |
647 | |
648 Creates a repository. This command can be executed only using api_key | |
649 belonging to user with admin rights. | |
650 If repository name contains "/", all needed repository groups will be created. | |
651 For example "foo/bar/baz" will create groups "foo", "bar" (with "foo" as parent), | |
652 and create "baz" repository with "bar" as group. | |
653 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
654 |
1676 | 655 INPUT:: |
656 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
657 id : <id_for_response> |
1676 | 658 api_key : "<api_key>" |
659 method : "create_repo" | |
660 args: { | |
1928 | 661 "repo_name" : "<reponame>", |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
662 "owner" : "<onwer_name_or_id>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
663 "repo_type" : "<repo_type>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
664 "description" : "<description> = Optional('')", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
665 "private" : "<bool> = Optional(False)", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
666 "clone_uri" : "<clone_uri> = Optional(None)", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
667 "landing_rev" : "<landing_rev> = Optional('tip')", |
1676 | 668 } |
669 | |
670 OUTPUT:: | |
671 | |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
672 id : <id_given_in_input> |
1928 | 673 result: { |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
674 "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
|
675 "repo": { |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
676 "repo_id" : "<repo_id>", |
2480
04ef27ce939e
API: create_repo returns now repo object after creation
Marcin Kuzminski <marcin@python-works.com>
parents:
2467
diff
changeset
|
677 "repo_name" : "<reponame>" |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
678 "repo_type" : "<repo_type>", |
2480
04ef27ce939e
API: create_repo returns now repo object after creation
Marcin Kuzminski <marcin@python-works.com>
parents:
2467
diff
changeset
|
679 "clone_uri" : "<clone_uri>", |
04ef27ce939e
API: create_repo returns now repo object after creation
Marcin Kuzminski <marcin@python-works.com>
parents:
2467
diff
changeset
|
680 "private": : "<bool>", |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
681 "created_on" : "<datetimecreated>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
682 "description" : "<description>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
683 "landing_rev": "<landing_rev>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
684 "owner": "<repo_owner>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
685 "fork_of": "<name_of_fork_parent>", |
2480
04ef27ce939e
API: create_repo returns now repo object after creation
Marcin Kuzminski <marcin@python-works.com>
parents:
2467
diff
changeset
|
686 }, |
1928 | 687 } |
1676 | 688 error: null |
689 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
690 |
2091
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
691 delete_repo |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
692 ----------- |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
693 |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
694 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
|
695 belonging to user with admin rights. |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
696 |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
697 |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
698 INPUT:: |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
699 |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
700 id : <id_for_response> |
2091
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
701 api_key : "<api_key>" |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
702 method : "delete_repo" |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
703 args: { |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
704 "repoid" : "<reponame or repo_id>" |
2091
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
705 } |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
706 |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
707 OUTPUT:: |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
708 |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
709 id : <id_given_in_input> |
2091
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
710 result: { |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
711 "msg": "Deleted repository `<reponame>`", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
712 "success": true |
2091
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
713 } |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
714 error: null |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
715 |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
716 |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
717 grant_user_permission |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
718 --------------------- |
1676 | 719 |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
720 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
|
721 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
|
722 with admin rights. |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
723 |
1676 | 724 |
725 INPUT:: | |
726 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
727 id : <id_for_response> |
1676 | 728 api_key : "<api_key>" |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
729 method : "grant_user_permission" |
1676 | 730 args: { |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
731 "repoid" : "<reponame or repo_id>" |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
732 "userid" : "<username or user_id>" |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
733 "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
|
734 } |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
735 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
736 OUTPUT:: |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
737 |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
738 id : <id_given_in_input> |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
739 result: { |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
740 "msg" : "Granted perm: `<perm>` for user: `<username>` in repo: `<reponame>`", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
741 "success": true |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
742 } |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
743 error: null |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
744 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
745 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
746 revoke_user_permission |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
747 ---------------------- |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
748 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
749 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
|
750 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
|
751 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
752 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
753 INPUT:: |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
754 |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
755 id : <id_for_response> |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
756 api_key : "<api_key>" |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
757 method : "revoke_user_permission" |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
758 args: { |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
759 "repoid" : "<reponame or repo_id>" |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
760 "userid" : "<username or user_id>" |
1676 | 761 } |
762 | |
763 OUTPUT:: | |
764 | |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
765 id : <id_given_in_input> |
1928 | 766 result: { |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
767 "msg" : "Revoked perm for user: `<username>` in repo: `<reponame>`", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
768 "success": true |
1928 | 769 } |
1676 | 770 error: null |
1878
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
771 |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
772 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
773 grant_users_group_permission |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
774 ---------------------------- |
1878
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
775 |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
776 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
|
777 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
|
778 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
|
779 |
1878
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
780 |
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
781 INPUT:: |
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
782 |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
783 id : <id_for_response> |
1878
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
784 api_key : "<api_key>" |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
785 method : "grant_users_group_permission" |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
786 args: { |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
787 "repoid" : "<reponame or repo_id>" |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
788 "usersgroupid" : "<users group id or name>" |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
789 "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
|
790 } |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
791 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
792 OUTPUT:: |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
793 |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
794 id : <id_given_in_input> |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
795 result: { |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
796 "msg" : "Granted perm: `<perm>` for group: `<usersgroupname>` in repo: `<reponame>`", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
797 "success": true |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
798 } |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
799 error: null |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
800 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
801 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
802 revoke_users_group_permission |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
803 ----------------------------- |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
804 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
805 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
|
806 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
|
807 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
808 INPUT:: |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
809 |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
810 id : <id_for_response> |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
811 api_key : "<api_key>" |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
812 method : "revoke_users_group_permission" |
1878
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
813 args: { |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
814 "repoid" : "<reponame or repo_id>" |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
815 "usersgroupid" : "<users group id or name>" |
1928 | 816 } |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
817 |
1928 | 818 OUTPUT:: |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
819 |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
820 id : <id_given_in_input> |
1928 | 821 result: { |
2633
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
822 "msg" : "Revoked perm for group: `<usersgroupname>` in repo: `<reponame>`", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2609
diff
changeset
|
823 "success": true |
1928 | 824 } |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
825 error: null |