Mercurial > kallithea
annotate docs/api/api.rst @ 3672:55585c86be83 beta
hooks: make_lock is tristate
Missed in 260a7a01.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Thu, 04 Apr 2013 17:45:55 +0200 |
parents | b44979649915 |
children | 3563bb7b4b82 7e3d89d9d3a2 |
rev | line source |
---|---|
1446 | 1 .. _api: |
2 | |
2095 | 3 === |
1446 | 4 API |
5 === | |
6 | |
7 | |
8 Starting from RhodeCode version 1.2 a simple API was implemented. | |
1500 | 9 There's a single schema for calling all api methods. API is implemented |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
10 with JSON protocol both ways. An url to send API request to RhodeCode is |
1500 | 11 <your_server>/_admin/api |
1446 | 12 |
1839 | 13 API ACCESS FOR WEB VIEWS |
14 ++++++++++++++++++++++++ | |
1446 | 15 |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
16 API access can also be turned on for each web view in RhodeCode that is |
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
17 decorated with `@LoginRequired` decorator. To enable API access simple change |
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
18 the standard login decorator to `@LoginRequired(api_access=True)`. |
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
19 After this change, a rhodecode view can be accessed without login by adding a |
1911 | 20 GET parameter `?api_key=<api_key>` to url. By default this is only |
1812
320dec24fb9a
Added instruction on enabling the API access to web views
Marcin Kuzminski <marcin@python-works.com>
parents:
1810
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:
1810
diff
changeset
|
22 |
320dec24fb9a
Added instruction on enabling the API access to web views
Marcin Kuzminski <marcin@python-works.com>
parents:
1810
diff
changeset
|
23 |
1839 | 24 API ACCESS |
25 ++++++++++ | |
26 | |
1708
fee9895fa46e
changed API to match fully JSON-RPC specs
Marcin Kuzminski <marcin@python-works.com>
parents:
1592
diff
changeset
|
27 All clients are required to send JSON-RPC spec JSON data:: |
1446 | 28 |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
29 { |
2143
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2095
diff
changeset
|
30 "id:"<id>", |
1446 | 31 "api_key":"<api_key>", |
32 "method":"<method_name>", | |
33 "args":{"<arg_key>":"<arg_val>"} | |
34 } | |
35 | |
1500 | 36 Example call for autopulling remotes repos using curl:: |
1708
fee9895fa46e
changed API to match fully JSON-RPC specs
Marcin Kuzminski <marcin@python-works.com>
parents:
1592
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"}}' |
1500 | 38 |
1592 | 39 Simply provide |
1708
fee9895fa46e
changed API to match fully JSON-RPC specs
Marcin Kuzminski <marcin@python-works.com>
parents:
1592
diff
changeset
|
40 - *id* A value of any type, which is used to match the response with the request that it is replying to. |
1500 | 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 | |
1592 | 44 |
1446 | 45 .. note:: |
1592 | 46 |
47 api_key can be found in your user account page | |
48 | |
49 | |
1708
fee9895fa46e
changed API to match fully JSON-RPC specs
Marcin Kuzminski <marcin@python-works.com>
parents:
1592
diff
changeset
|
50 RhodeCode API will return always a JSON-RPC response:: |
1592 | 51 |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
52 { |
2143
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2095
diff
changeset
|
53 "id":<id>, # matching id sent by request |
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2095
diff
changeset
|
54 "result": "<result>"|null, # JSON formatted result, null if any errors |
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2095
diff
changeset
|
55 "error": "null"|<error_message> # JSON formatted error (if any) |
1446 | 56 } |
57 | |
58 All responses from API will be `HTTP/1.0 200 OK`, if there's an error while | |
1592 | 59 calling api *error* key from response will contain failure description |
1446 | 60 and result will be null. |
61 | |
2379
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2378
diff
changeset
|
62 |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2378
diff
changeset
|
63 API CLIENT |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2378
diff
changeset
|
64 ++++++++++ |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2378
diff
changeset
|
65 |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
66 From version 1.4 RhodeCode adds a script that allows to easily |
2379
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2378
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:
2378
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:
2378
diff
changeset
|
69 |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2378
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:
2378
diff
changeset
|
71 |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2378
diff
changeset
|
72 rhodecode-api _create_config --apikey=<youapikey> --apihost=<rhodecode host> |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
73 |
2379
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2378
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:
2378
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:
2378
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:
2378
diff
changeset
|
77 |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2378
diff
changeset
|
78 |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2378
diff
changeset
|
79 after that simply run any api command for example get_repo:: |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
80 |
2379
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2378
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:
2378
diff
changeset
|
82 |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2378
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:
2378
diff
changeset
|
84 rhodecode said: |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2378
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:
2378
diff
changeset
|
86 'id': 75, |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2378
diff
changeset
|
87 'result': None} |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2378
diff
changeset
|
88 |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2378
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:
2378
diff
changeset
|
90 |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2378
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:
2378
diff
changeset
|
92 |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
93 rhodecode-api get_repo repoid:rhodecode |
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
94 |
2379
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2378
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:
2378
diff
changeset
|
96 rhodecode said: |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2378
diff
changeset
|
97 {'error': None, |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2378
diff
changeset
|
98 'id': 39, |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2378
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:
2378
diff
changeset
|
100 |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2378
diff
changeset
|
101 |
7ac09514a178
created rhodecode-api binary script for working with api via cli
Marcin Kuzminski <marcin@python-works.com>
parents:
2378
diff
changeset
|
102 |
1446 | 103 API METHODS |
104 +++++++++++ | |
105 | |
1592 | 106 |
1446 | 107 pull |
108 ---- | |
109 | |
1592 | 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 | |
1500 | 112 belonging to user with admin rights |
113 | |
114 INPUT:: | |
115 | |
2143
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2095
diff
changeset
|
116 id : <id_for_response> |
1592 | 117 api_key : "<api_key>" |
118 method : "pull" | |
119 args : { | |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
120 "repoid" : "<reponame or repo_id>" |
1592 | 121 } |
122 | |
123 OUTPUT:: | |
124 | |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
125 id : <id_given_in_input> |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
126 result : "Pulled from `<reponame>`" |
1592 | 127 error : null |
128 | |
129 | |
2697
4565e655ea2a
API: Added option to rescann repositories via api call
Marcin Kuzminski <marcin@python-works.com>
parents:
2531
diff
changeset
|
130 rescan_repos |
4565e655ea2a
API: Added option to rescann repositories via api call
Marcin Kuzminski <marcin@python-works.com>
parents:
2531
diff
changeset
|
131 ------------ |
4565e655ea2a
API: Added option to rescann repositories via api call
Marcin Kuzminski <marcin@python-works.com>
parents:
2531
diff
changeset
|
132 |
4565e655ea2a
API: Added option to rescann repositories via api call
Marcin Kuzminski <marcin@python-works.com>
parents:
2531
diff
changeset
|
133 Dispatch rescan repositories action. If remove_obsolete is set |
4565e655ea2a
API: Added option to rescann repositories via api call
Marcin Kuzminski <marcin@python-works.com>
parents:
2531
diff
changeset
|
134 RhodeCode will delete repos that are in database but not in the filesystem. |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
135 This command can be executed only using api_key belonging to user with admin |
2697
4565e655ea2a
API: Added option to rescann repositories via api call
Marcin Kuzminski <marcin@python-works.com>
parents:
2531
diff
changeset
|
136 rights. |
4565e655ea2a
API: Added option to rescann repositories via api call
Marcin Kuzminski <marcin@python-works.com>
parents:
2531
diff
changeset
|
137 |
4565e655ea2a
API: Added option to rescann repositories via api call
Marcin Kuzminski <marcin@python-works.com>
parents:
2531
diff
changeset
|
138 INPUT:: |
4565e655ea2a
API: Added option to rescann repositories via api call
Marcin Kuzminski <marcin@python-works.com>
parents:
2531
diff
changeset
|
139 |
4565e655ea2a
API: Added option to rescann repositories via api call
Marcin Kuzminski <marcin@python-works.com>
parents:
2531
diff
changeset
|
140 id : <id_for_response> |
4565e655ea2a
API: Added option to rescann repositories via api call
Marcin Kuzminski <marcin@python-works.com>
parents:
2531
diff
changeset
|
141 api_key : "<api_key>" |
4565e655ea2a
API: Added option to rescann repositories via api call
Marcin Kuzminski <marcin@python-works.com>
parents:
2531
diff
changeset
|
142 method : "rescan_repos" |
4565e655ea2a
API: Added option to rescann repositories via api call
Marcin Kuzminski <marcin@python-works.com>
parents:
2531
diff
changeset
|
143 args : { |
4565e655ea2a
API: Added option to rescann repositories via api call
Marcin Kuzminski <marcin@python-works.com>
parents:
2531
diff
changeset
|
144 "remove_obsolete" : "<boolean = Optional(False)>" |
4565e655ea2a
API: Added option to rescann repositories via api call
Marcin Kuzminski <marcin@python-works.com>
parents:
2531
diff
changeset
|
145 } |
4565e655ea2a
API: Added option to rescann repositories via api call
Marcin Kuzminski <marcin@python-works.com>
parents:
2531
diff
changeset
|
146 |
4565e655ea2a
API: Added option to rescann repositories via api call
Marcin Kuzminski <marcin@python-works.com>
parents:
2531
diff
changeset
|
147 OUTPUT:: |
4565e655ea2a
API: Added option to rescann repositories via api call
Marcin Kuzminski <marcin@python-works.com>
parents:
2531
diff
changeset
|
148 |
4565e655ea2a
API: Added option to rescann repositories via api call
Marcin Kuzminski <marcin@python-works.com>
parents:
2531
diff
changeset
|
149 id : <id_given_in_input> |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
150 result : "{'added': [<list of names of added repos>], |
2697
4565e655ea2a
API: Added option to rescann repositories via api call
Marcin Kuzminski <marcin@python-works.com>
parents:
2531
diff
changeset
|
151 'removed': [<list of names of removed repos>]}" |
4565e655ea2a
API: Added option to rescann repositories via api call
Marcin Kuzminski <marcin@python-works.com>
parents:
2531
diff
changeset
|
152 error : null |
4565e655ea2a
API: Added option to rescann repositories via api call
Marcin Kuzminski <marcin@python-works.com>
parents:
2531
diff
changeset
|
153 |
4565e655ea2a
API: Added option to rescann repositories via api call
Marcin Kuzminski <marcin@python-works.com>
parents:
2531
diff
changeset
|
154 |
3235
d6029dacbcc4
API invalidate_cache function ref #733
Marcin Kuzminski <marcin@python-works.com>
parents:
3224
diff
changeset
|
155 invalidate_cache |
d6029dacbcc4
API invalidate_cache function ref #733
Marcin Kuzminski <marcin@python-works.com>
parents:
3224
diff
changeset
|
156 ---------------- |
d6029dacbcc4
API invalidate_cache function ref #733
Marcin Kuzminski <marcin@python-works.com>
parents:
3224
diff
changeset
|
157 |
d6029dacbcc4
API invalidate_cache function ref #733
Marcin Kuzminski <marcin@python-works.com>
parents:
3224
diff
changeset
|
158 Invalidate cache for repository. |
d6029dacbcc4
API invalidate_cache function ref #733
Marcin Kuzminski <marcin@python-works.com>
parents:
3224
diff
changeset
|
159 This command can be executed only using api_key belonging to user with admin |
d6029dacbcc4
API invalidate_cache function ref #733
Marcin Kuzminski <marcin@python-works.com>
parents:
3224
diff
changeset
|
160 rights or regular user that have write or admin or write access to repository. |
d6029dacbcc4
API invalidate_cache function ref #733
Marcin Kuzminski <marcin@python-works.com>
parents:
3224
diff
changeset
|
161 |
d6029dacbcc4
API invalidate_cache function ref #733
Marcin Kuzminski <marcin@python-works.com>
parents:
3224
diff
changeset
|
162 INPUT:: |
d6029dacbcc4
API invalidate_cache function ref #733
Marcin Kuzminski <marcin@python-works.com>
parents:
3224
diff
changeset
|
163 |
d6029dacbcc4
API invalidate_cache function ref #733
Marcin Kuzminski <marcin@python-works.com>
parents:
3224
diff
changeset
|
164 id : <id_for_response> |
d6029dacbcc4
API invalidate_cache function ref #733
Marcin Kuzminski <marcin@python-works.com>
parents:
3224
diff
changeset
|
165 api_key : "<api_key>" |
d6029dacbcc4
API invalidate_cache function ref #733
Marcin Kuzminski <marcin@python-works.com>
parents:
3224
diff
changeset
|
166 method : "invalidate_cache" |
d6029dacbcc4
API invalidate_cache function ref #733
Marcin Kuzminski <marcin@python-works.com>
parents:
3224
diff
changeset
|
167 args : { |
d6029dacbcc4
API invalidate_cache function ref #733
Marcin Kuzminski <marcin@python-works.com>
parents:
3224
diff
changeset
|
168 "repoid" : "<reponame or repo_id>" |
d6029dacbcc4
API invalidate_cache function ref #733
Marcin Kuzminski <marcin@python-works.com>
parents:
3224
diff
changeset
|
169 } |
d6029dacbcc4
API invalidate_cache function ref #733
Marcin Kuzminski <marcin@python-works.com>
parents:
3224
diff
changeset
|
170 |
d6029dacbcc4
API invalidate_cache function ref #733
Marcin Kuzminski <marcin@python-works.com>
parents:
3224
diff
changeset
|
171 OUTPUT:: |
d6029dacbcc4
API invalidate_cache function ref #733
Marcin Kuzminski <marcin@python-works.com>
parents:
3224
diff
changeset
|
172 |
d6029dacbcc4
API invalidate_cache function ref #733
Marcin Kuzminski <marcin@python-works.com>
parents:
3224
diff
changeset
|
173 id : <id_given_in_input> |
d6029dacbcc4
API invalidate_cache function ref #733
Marcin Kuzminski <marcin@python-works.com>
parents:
3224
diff
changeset
|
174 result : "Cache for repository `<reponame>` was invalidated: invalidated cache keys: <list_of_cache_keys>" |
d6029dacbcc4
API invalidate_cache function ref #733
Marcin Kuzminski <marcin@python-works.com>
parents:
3224
diff
changeset
|
175 error : null |
d6029dacbcc4
API invalidate_cache function ref #733
Marcin Kuzminski <marcin@python-works.com>
parents:
3224
diff
changeset
|
176 |
2737
e21cb7b1a4a5
added API call for locking/unlocking repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2697
diff
changeset
|
177 lock |
e21cb7b1a4a5
added API call for locking/unlocking repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2697
diff
changeset
|
178 ---- |
e21cb7b1a4a5
added API call for locking/unlocking repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2697
diff
changeset
|
179 |
3161
3563c47e52fd
Implemented API calls for non-admin users for locking/unlocking repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
3127
diff
changeset
|
180 Set locking state on given repository by given user. If userid param is skipped |
3457
08e8115585bd
calling lock function without lock attribute, will return lock state
Marcin Kuzminski <marcin@python-works.com>
parents:
3410
diff
changeset
|
181 , then it is set to id of user whos calling this method. If locked param is skipped |
08e8115585bd
calling lock function without lock attribute, will return lock state
Marcin Kuzminski <marcin@python-works.com>
parents:
3410
diff
changeset
|
182 then function shows current lock state of given repo. |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
183 This command can be executed only using api_key belonging to user with admin |
3161
3563c47e52fd
Implemented API calls for non-admin users for locking/unlocking repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
3127
diff
changeset
|
184 rights or regular user that have admin or write access to repository. |
2737
e21cb7b1a4a5
added API call for locking/unlocking repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2697
diff
changeset
|
185 |
e21cb7b1a4a5
added API call for locking/unlocking repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2697
diff
changeset
|
186 INPUT:: |
e21cb7b1a4a5
added API call for locking/unlocking repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2697
diff
changeset
|
187 |
e21cb7b1a4a5
added API call for locking/unlocking repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2697
diff
changeset
|
188 id : <id_for_response> |
e21cb7b1a4a5
added API call for locking/unlocking repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2697
diff
changeset
|
189 api_key : "<api_key>" |
e21cb7b1a4a5
added API call for locking/unlocking repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2697
diff
changeset
|
190 method : "lock" |
e21cb7b1a4a5
added API call for locking/unlocking repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2697
diff
changeset
|
191 args : { |
e21cb7b1a4a5
added API call for locking/unlocking repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2697
diff
changeset
|
192 "repoid" : "<reponame or repo_id>" |
3161
3563c47e52fd
Implemented API calls for non-admin users for locking/unlocking repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
3127
diff
changeset
|
193 "userid" : "<user_id or username = Optional(=apiuser)>", |
3457
08e8115585bd
calling lock function without lock attribute, will return lock state
Marcin Kuzminski <marcin@python-works.com>
parents:
3410
diff
changeset
|
194 "locked" : "<bool true|false = Optional(=None)>" |
2737
e21cb7b1a4a5
added API call for locking/unlocking repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2697
diff
changeset
|
195 } |
e21cb7b1a4a5
added API call for locking/unlocking repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2697
diff
changeset
|
196 |
e21cb7b1a4a5
added API call for locking/unlocking repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2697
diff
changeset
|
197 OUTPUT:: |
e21cb7b1a4a5
added API call for locking/unlocking repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2697
diff
changeset
|
198 |
e21cb7b1a4a5
added API call for locking/unlocking repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2697
diff
changeset
|
199 id : <id_given_in_input> |
e21cb7b1a4a5
added API call for locking/unlocking repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2697
diff
changeset
|
200 result : "User `<username>` set lock state for repo `<reponame>` to `true|false`" |
e21cb7b1a4a5
added API call for locking/unlocking repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2697
diff
changeset
|
201 error : null |
e21cb7b1a4a5
added API call for locking/unlocking repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2697
diff
changeset
|
202 |
e21cb7b1a4a5
added API call for locking/unlocking repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2697
diff
changeset
|
203 |
3126
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
204 show_ip |
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
205 ------- |
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
206 |
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
207 Shows IP address as seen from RhodeCode server, together with all |
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
208 defined IP addresses for given user. |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
209 This command can be executed only using api_key belonging to user with admin |
3126
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
210 rights. |
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
211 |
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
212 INPUT:: |
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
213 |
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
214 id : <id_for_response> |
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
215 api_key : "<api_key>" |
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
216 method : "show_ip" |
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
217 args : { |
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
218 "userid" : "<user_id or username>", |
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
219 } |
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
220 |
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
221 OUTPUT:: |
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
222 |
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
223 id : <id_given_in_input> |
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
224 result : { |
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
225 "ip_addr_server": <ip_from_clien>", |
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
226 "user_ips": [ |
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
227 { |
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
228 "ip_addr": "<ip_with_mask>", |
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
229 "ip_range": ["<start_ip>", "<end_ip>"], |
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
230 }, |
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
231 ... |
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
232 ] |
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
233 } |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
234 |
3126
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
235 error : null |
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
236 |
703070153bc1
added API method for checking IP
Marcin Kuzminski <marcin@python-works.com>
parents:
3122
diff
changeset
|
237 |
1843 | 238 get_user |
239 -------- | |
240 | |
2010
14dffcfebb02
API get_user and get_repo methods can fetch by id or names
Marcin Kuzminski <marcin@python-works.com>
parents:
2009
diff
changeset
|
241 Get's an user by username or user_id, Returns empty result if user is not found. |
3162
a0a8f38e8fb8
API method get_user can be executed by non-admin users ref #539
Marcin Kuzminski <marcin@python-works.com>
parents:
3161
diff
changeset
|
242 If userid param is skipped it is set to id of user who is calling this method. |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
243 This command can be executed only using api_key belonging to user with admin |
3163
28571535dd61
API methods create_repo, fork_repo, delete_repo, get_repo, get_repos
Marcin Kuzminski <marcin@python-works.com>
parents:
3162
diff
changeset
|
244 rights, or regular users that cannot specify different userid than theirs |
1843 | 245 |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
246 |
1843 | 247 INPUT:: |
248 | |
2143
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2095
diff
changeset
|
249 id : <id_for_response> |
1843 | 250 api_key : "<api_key>" |
251 method : "get_user" | |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
252 args : { |
3162
a0a8f38e8fb8
API method get_user can be executed by non-admin users ref #539
Marcin Kuzminski <marcin@python-works.com>
parents:
3161
diff
changeset
|
253 "userid" : "<username or user_id Optional(=apiuser)>" |
1843 | 254 } |
255 | |
256 OUTPUT:: | |
257 | |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
258 id : <id_given_in_input> |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
259 result: None if user does not exist or |
1843 | 260 { |
3127
71ce052f8b6b
add ipaddresses to repo data on API calls
Marcin Kuzminski <marcin@python-works.com>
parents:
3126
diff
changeset
|
261 "user_id" : "<user_id>", |
3213
f5dcee2b3153
updated api docs
Marcin Kuzminski <marcin@python-works.com>
parents:
3174
diff
changeset
|
262 "api_key" : "<api_key>", |
3127
71ce052f8b6b
add ipaddresses to repo data on API calls
Marcin Kuzminski <marcin@python-works.com>
parents:
3126
diff
changeset
|
263 "username" : "<username>", |
71ce052f8b6b
add ipaddresses to repo data on API calls
Marcin Kuzminski <marcin@python-works.com>
parents:
3126
diff
changeset
|
264 "firstname": "<firstname>", |
71ce052f8b6b
add ipaddresses to repo data on API calls
Marcin Kuzminski <marcin@python-works.com>
parents:
3126
diff
changeset
|
265 "lastname" : "<lastname>", |
71ce052f8b6b
add ipaddresses to repo data on API calls
Marcin Kuzminski <marcin@python-works.com>
parents:
3126
diff
changeset
|
266 "email" : "<email>", |
71ce052f8b6b
add ipaddresses to repo data on API calls
Marcin Kuzminski <marcin@python-works.com>
parents:
3126
diff
changeset
|
267 "emails": "<list_of_all_additional_emails>", |
71ce052f8b6b
add ipaddresses to repo data on API calls
Marcin Kuzminski <marcin@python-works.com>
parents:
3126
diff
changeset
|
268 "ip_addresses": "<list_of_ip_addresses_for_user>", |
71ce052f8b6b
add ipaddresses to repo data on API calls
Marcin Kuzminski <marcin@python-works.com>
parents:
3126
diff
changeset
|
269 "active" : "<bool>", |
71ce052f8b6b
add ipaddresses to repo data on API calls
Marcin Kuzminski <marcin@python-works.com>
parents:
3126
diff
changeset
|
270 "admin" :Â "<bool>", |
71ce052f8b6b
add ipaddresses to repo data on API calls
Marcin Kuzminski <marcin@python-works.com>
parents:
3126
diff
changeset
|
271 "ldap_dn" : "<ldap_dn>", |
71ce052f8b6b
add ipaddresses to repo data on API calls
Marcin Kuzminski <marcin@python-works.com>
parents:
3126
diff
changeset
|
272 "last_login": "<last_login>", |
2151
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2146
diff
changeset
|
273 "permissions": { |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2146
diff
changeset
|
274 "global": ["hg.create.repository", |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2146
diff
changeset
|
275 "repository.read", |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2146
diff
changeset
|
276 "hg.register.manual_activate"], |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2146
diff
changeset
|
277 "repositories": {"repo1": "repository.none"}, |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2146
diff
changeset
|
278 "repositories_groups": {"Group1": "group.read"} |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2146
diff
changeset
|
279 }, |
1843 | 280 } |
281 | |
282 error: null | |
283 | |
284 | |
1592 | 285 get_users |
286 --------- | |
287 | |
288 Lists all existing users. This command can be executed only using api_key | |
289 belonging to user with admin rights. | |
290 | |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
291 |
1592 | 292 INPUT:: |
293 | |
2143
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2095
diff
changeset
|
294 id : <id_for_response> |
1592 | 295 api_key : "<api_key>" |
296 method : "get_users" | |
297 args : { } | |
298 | |
299 OUTPUT:: | |
300 | |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
301 id : <id_given_in_input> |
1592 | 302 result: [ |
303 { | |
3127
71ce052f8b6b
add ipaddresses to repo data on API calls
Marcin Kuzminski <marcin@python-works.com>
parents:
3126
diff
changeset
|
304 "user_id" : "<user_id>", |
71ce052f8b6b
add ipaddresses to repo data on API calls
Marcin Kuzminski <marcin@python-works.com>
parents:
3126
diff
changeset
|
305 "username" : "<username>", |
71ce052f8b6b
add ipaddresses to repo data on API calls
Marcin Kuzminski <marcin@python-works.com>
parents:
3126
diff
changeset
|
306 "firstname": "<firstname>", |
71ce052f8b6b
add ipaddresses to repo data on API calls
Marcin Kuzminski <marcin@python-works.com>
parents:
3126
diff
changeset
|
307 "lastname" : "<lastname>", |
71ce052f8b6b
add ipaddresses to repo data on API calls
Marcin Kuzminski <marcin@python-works.com>
parents:
3126
diff
changeset
|
308 "email" : "<email>", |
71ce052f8b6b
add ipaddresses to repo data on API calls
Marcin Kuzminski <marcin@python-works.com>
parents:
3126
diff
changeset
|
309 "emails": "<list_of_all_additional_emails>", |
71ce052f8b6b
add ipaddresses to repo data on API calls
Marcin Kuzminski <marcin@python-works.com>
parents:
3126
diff
changeset
|
310 "ip_addresses": "<list_of_ip_addresses_for_user>", |
71ce052f8b6b
add ipaddresses to repo data on API calls
Marcin Kuzminski <marcin@python-works.com>
parents:
3126
diff
changeset
|
311 "active" : "<bool>", |
71ce052f8b6b
add ipaddresses to repo data on API calls
Marcin Kuzminski <marcin@python-works.com>
parents:
3126
diff
changeset
|
312 "admin" :Â "<bool>", |
71ce052f8b6b
add ipaddresses to repo data on API calls
Marcin Kuzminski <marcin@python-works.com>
parents:
3126
diff
changeset
|
313 "ldap_dn" : "<ldap_dn>", |
71ce052f8b6b
add ipaddresses to repo data on API calls
Marcin Kuzminski <marcin@python-works.com>
parents:
3126
diff
changeset
|
314 "last_login": "<last_login>", |
1592 | 315 }, |
3267
7b74079beec9
coding style: fix trailing and leading spaces and tabs
Mads Kiilerich <madski@unity3d.com>
parents:
3235
diff
changeset
|
316 … |
1592 | 317 ] |
318 error: null | |
319 | |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
320 |
1592 | 321 create_user |
322 ----------- | |
323 | |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
324 Creates new user. This command can |
1909
f2bd5b0c1094
create user api_doc update
Marcin Kuzminski <marcin@python-works.com>
parents:
1843
diff
changeset
|
325 be executed only using api_key belonging to user with admin rights. |
1592 | 326 |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
327 |
1592 | 328 INPUT:: |
329 | |
2143
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2095
diff
changeset
|
330 id : <id_for_response> |
1592 | 331 api_key : "<api_key>" |
332 method : "create_user" | |
333 args : { | |
334 "username" : "<username>", | |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
335 "email" : "<useremail>", |
1592 | 336 "password" : "<password>", |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
337 "firstname" : "<firstname> = Optional(None)", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
338 "lastname" : "<lastname> = Optional(None)", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
339 "active" : "<bool> = Optional(True)", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
340 "admin" : "<bool> = Optional(False)", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
341 "ldap_dn" : "<ldap_dn> = Optional(None)" |
1592 | 342 } |
1500 | 343 |
344 OUTPUT:: | |
345 | |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
346 id : <id_given_in_input> |
1592 | 347 result: { |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
348 "msg" : "created new user `<username>`", |
2365
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
349 "user": { |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
350 "user_id" : "<user_id>", |
2365
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
351 "username" : "<username>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
352 "firstname": "<firstname>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
353 "lastname" : "<lastname>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
354 "email" : "<email>", |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
355 "emails": "<list_of_all_additional_emails>", |
2365
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
356 "active" : "<bool>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
357 "admin" :Â "<bool>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
358 "ldap_dn" : "<ldap_dn>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
359 "last_login": "<last_login>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
360 }, |
1592 | 361 } |
362 error: null | |
363 | |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
364 |
2002
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
365 update_user |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
366 ----------- |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
367 |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
368 updates given user if such user exists. This command can |
2002
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
369 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:
1989
diff
changeset
|
370 |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
371 |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
372 INPUT:: |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
373 |
2143
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2095
diff
changeset
|
374 id : <id_for_response> |
2002
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
375 api_key : "<api_key>" |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
376 method : "update_user" |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
377 args : { |
2009 | 378 "userid" : "<user_id or username>", |
3162
a0a8f38e8fb8
API method get_user can be executed by non-admin users ref #539
Marcin Kuzminski <marcin@python-works.com>
parents:
3161
diff
changeset
|
379 "username" : "<username> = Optional(None)", |
a0a8f38e8fb8
API method get_user can be executed by non-admin users ref #539
Marcin Kuzminski <marcin@python-works.com>
parents:
3161
diff
changeset
|
380 "email" : "<useremail> = Optional(None)", |
a0a8f38e8fb8
API method get_user can be executed by non-admin users ref #539
Marcin Kuzminski <marcin@python-works.com>
parents:
3161
diff
changeset
|
381 "password" : "<password> = Optional(None)", |
a0a8f38e8fb8
API method get_user can be executed by non-admin users ref #539
Marcin Kuzminski <marcin@python-works.com>
parents:
3161
diff
changeset
|
382 "firstname" : "<firstname> = Optional(None)", |
a0a8f38e8fb8
API method get_user can be executed by non-admin users ref #539
Marcin Kuzminski <marcin@python-works.com>
parents:
3161
diff
changeset
|
383 "lastname" : "<lastname> = Optional(None)", |
a0a8f38e8fb8
API method get_user can be executed by non-admin users ref #539
Marcin Kuzminski <marcin@python-works.com>
parents:
3161
diff
changeset
|
384 "active" : "<bool> = Optional(None)", |
a0a8f38e8fb8
API method get_user can be executed by non-admin users ref #539
Marcin Kuzminski <marcin@python-works.com>
parents:
3161
diff
changeset
|
385 "admin" : "<bool> = Optional(None)", |
a0a8f38e8fb8
API method get_user can be executed by non-admin users ref #539
Marcin Kuzminski <marcin@python-works.com>
parents:
3161
diff
changeset
|
386 "ldap_dn" : "<ldap_dn> = Optional(None)" |
2002
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
387 } |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
388 |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
389 OUTPUT:: |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
390 |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
391 id : <id_given_in_input> |
2002
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
392 result: { |
2507
374693af2849
API: update_user returns new updated user data
Marcin Kuzminski <marcin@python-works.com>
parents:
2506
diff
changeset
|
393 "msg" : "updated user ID:<userid> <username>", |
374693af2849
API: update_user returns new updated user data
Marcin Kuzminski <marcin@python-works.com>
parents:
2506
diff
changeset
|
394 "user": { |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
395 "user_id" : "<user_id>", |
2507
374693af2849
API: update_user returns new updated user data
Marcin Kuzminski <marcin@python-works.com>
parents:
2506
diff
changeset
|
396 "username" : "<username>", |
374693af2849
API: update_user returns new updated user data
Marcin Kuzminski <marcin@python-works.com>
parents:
2506
diff
changeset
|
397 "firstname": "<firstname>", |
374693af2849
API: update_user returns new updated user data
Marcin Kuzminski <marcin@python-works.com>
parents:
2506
diff
changeset
|
398 "lastname" : "<lastname>", |
374693af2849
API: update_user returns new updated user data
Marcin Kuzminski <marcin@python-works.com>
parents:
2506
diff
changeset
|
399 "email" : "<email>", |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
400 "emails": "<list_of_all_additional_emails>", |
2507
374693af2849
API: update_user returns new updated user data
Marcin Kuzminski <marcin@python-works.com>
parents:
2506
diff
changeset
|
401 "active" : "<bool>", |
374693af2849
API: update_user returns new updated user data
Marcin Kuzminski <marcin@python-works.com>
parents:
2506
diff
changeset
|
402 "admin" :Â "<bool>", |
374693af2849
API: update_user returns new updated user data
Marcin Kuzminski <marcin@python-works.com>
parents:
2506
diff
changeset
|
403 "ldap_dn" : "<ldap_dn>", |
374693af2849
API: update_user returns new updated user data
Marcin Kuzminski <marcin@python-works.com>
parents:
2506
diff
changeset
|
404 "last_login": "<last_login>", |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
405 }, |
2365
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
406 } |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
407 error: null |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
408 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
409 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
410 delete_user |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
411 ----------- |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
412 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
413 |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
414 deletes givenuser if such user exists. This command can |
2365
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
415 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:
2338
diff
changeset
|
416 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
417 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
418 INPUT:: |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
419 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
420 id : <id_for_response> |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
421 api_key : "<api_key>" |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
422 method : "delete_user" |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
423 args : { |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
424 "userid" : "<user_id or username>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
425 } |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
426 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
427 OUTPUT:: |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
428 |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
429 id : <id_given_in_input> |
2365
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2338
diff
changeset
|
430 result: { |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
431 "msg" : "deleted user ID:<userid> <username>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
432 "user": null |
2002
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
433 } |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
434 error: null |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
435 |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
436 |
1592 | 437 get_users_group |
438 --------------- | |
439 | |
3410
5f1850e4712a
"Users groups" is grammatically incorrect English - rename to "user groups"
Mads Kiilerich <madski@unity3d.com>
parents:
3267
diff
changeset
|
440 Gets an existing user group. This command can be executed only using api_key |
1592 | 441 belonging to user with admin rights. |
442 | |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
443 |
1592 | 444 INPUT:: |
445 | |
2143
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2095
diff
changeset
|
446 id : <id_for_response> |
1592 | 447 api_key : "<api_key>" |
448 method : "get_users_group" | |
449 args : { | |
3410
5f1850e4712a
"Users groups" is grammatically incorrect English - rename to "user groups"
Mads Kiilerich <madski@unity3d.com>
parents:
3267
diff
changeset
|
450 "usersgroupid" : "<user group id or name>" |
1592 | 451 } |
452 | |
453 OUTPUT:: | |
454 | |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
455 id : <id_given_in_input> |
1592 | 456 result : None if group not exist |
457 { | |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
458 "users_group_id" : "<id>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
459 "group_name" : "<groupname>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
460 "active": "<bool>", |
1592 | 461 "members" : [ |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
462 { |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
463 "user_id" : "<user_id>", |
1843 | 464 "username" : "<username>", |
465 "firstname": "<firstname>", | |
466 "lastname" : "<lastname>", | |
467 "email" : "<email>", | |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
468 "emails": "<list_of_all_additional_emails>", |
1843 | 469 "active" : "<bool>", |
470 "admin" :Â "<bool>", | |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
471 "ldap_dn" : "<ldap_dn>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
472 "last_login": "<last_login>", |
1843 | 473 }, |
474 … | |
475 ] | |
1592 | 476 } |
477 error : null | |
478 | |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
479 |
1843 | 480 get_users_groups |
481 ---------------- | |
482 | |
3410
5f1850e4712a
"Users groups" is grammatically incorrect English - rename to "user groups"
Mads Kiilerich <madski@unity3d.com>
parents:
3267
diff
changeset
|
483 Lists all existing user groups. This command can be executed only using |
1843 | 484 api_key belonging to user with admin rights. |
485 | |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
486 |
1843 | 487 INPUT:: |
488 | |
2143
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2095
diff
changeset
|
489 id : <id_for_response> |
1843 | 490 api_key : "<api_key>" |
491 method : "get_users_groups" | |
492 args : { } | |
493 | |
494 OUTPUT:: | |
495 | |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
496 id : <id_given_in_input> |
1843 | 497 result : [ |
498 { | |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
499 "users_group_id" : "<id>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
500 "group_name" : "<groupname>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
501 "active": "<bool>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
502 }, |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
503 … |
1843 | 504 ] |
505 error : null | |
506 | |
507 | |
1500 | 508 create_users_group |
509 ------------------ | |
510 | |
3410
5f1850e4712a
"Users groups" is grammatically incorrect English - rename to "user groups"
Mads Kiilerich <madski@unity3d.com>
parents:
3267
diff
changeset
|
511 Creates new user group. This command can be executed only using api_key |
1500 | 512 belonging to user with admin rights |
513 | |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
514 |
1500 | 515 INPUT:: |
516 | |
2143
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2095
diff
changeset
|
517 id : <id_for_response> |
1592 | 518 api_key : "<api_key>" |
519 method : "create_users_group" | |
520 args: { | |
1843 | 521 "group_name": "<groupname>", |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
522 "active":"<bool> = Optional(True)" |
1592 | 523 } |
524 | |
525 OUTPUT:: | |
526 | |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
527 id : <id_given_in_input> |
1592 | 528 result: { |
3410
5f1850e4712a
"Users groups" is grammatically incorrect English - rename to "user groups"
Mads Kiilerich <madski@unity3d.com>
parents:
3267
diff
changeset
|
529 "msg": "created new user group `<groupname>`", |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
530 "users_group": { |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
531 "users_group_id" : "<id>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
532 "group_name" : "<groupname>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
533 "active": "<bool>", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
534 }, |
1592 | 535 } |
536 error: null | |
537 | |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
538 |
1793
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1708
diff
changeset
|
539 add_user_to_users_group |
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1708
diff
changeset
|
540 ----------------------- |
1592 | 541 |
3410
5f1850e4712a
"Users groups" is grammatically incorrect English - rename to "user groups"
Mads Kiilerich <madski@unity3d.com>
parents:
3267
diff
changeset
|
542 Adds a user to a user group. If user exists in that group success will be |
1989 | 543 `false`. This command can be executed only using api_key |
1592 | 544 belonging to user with admin rights |
545 | |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
546 |
1592 | 547 INPUT:: |
548 | |
2143
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2095
diff
changeset
|
549 id : <id_for_response> |
1592 | 550 api_key : "<api_key>" |
551 method : "add_user_users_group" | |
552 args: { | |
3410
5f1850e4712a
"Users groups" is grammatically incorrect English - rename to "user groups"
Mads Kiilerich <madski@unity3d.com>
parents:
3267
diff
changeset
|
553 "usersgroupid" : "<user group id or name>", |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
554 "userid" : "<user_id or username>", |
1592 | 555 } |
556 | |
557 OUTPUT:: | |
558 | |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
559 id : <id_given_in_input> |
1592 | 560 result: { |
1989 | 561 "success": True|False # depends on if member is in group |
3410
5f1850e4712a
"Users groups" is grammatically incorrect English - rename to "user groups"
Mads Kiilerich <madski@unity3d.com>
parents:
3267
diff
changeset
|
562 "msg": "added member `<username>` to user group `<groupname>` | |
1989 | 563 User is already in that group" |
564 } | |
565 error: null | |
566 | |
567 | |
568 remove_user_from_users_group | |
569 ---------------------------- | |
570 | |
3410
5f1850e4712a
"Users groups" is grammatically incorrect English - rename to "user groups"
Mads Kiilerich <madski@unity3d.com>
parents:
3267
diff
changeset
|
571 Removes a user from a user group. If user is not in given group success will |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
572 be `false`. This command can be executed only |
1989 | 573 using api_key belonging to user with admin rights |
574 | |
575 | |
576 INPUT:: | |
577 | |
2143
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2095
diff
changeset
|
578 id : <id_for_response> |
1989 | 579 api_key : "<api_key>" |
580 method : "remove_user_from_users_group" | |
581 args: { | |
3410
5f1850e4712a
"Users groups" is grammatically incorrect English - rename to "user groups"
Mads Kiilerich <madski@unity3d.com>
parents:
3267
diff
changeset
|
582 "usersgroupid" : "<user group id or name>", |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
583 "userid" : "<user_id or username>", |
1989 | 584 } |
585 | |
586 OUTPUT:: | |
587 | |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
588 id : <id_given_in_input> |
1989 | 589 result: { |
590 "success": True|False, # depends on if member is in group | |
3410
5f1850e4712a
"Users groups" is grammatically incorrect English - rename to "user groups"
Mads Kiilerich <madski@unity3d.com>
parents:
3267
diff
changeset
|
591 "msg": "removed member <username> from user group <groupname> | |
1989 | 592 User wasn't in group" |
1592 | 593 } |
594 error: null | |
595 | |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
596 |
1843 | 597 get_repo |
598 -------- | |
599 | |
2146 | 600 Gets an existing repository by it's name or repository_id. Members will return |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
601 either users_group or user associated to that repository. This command can be |
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
602 executed only using api_key belonging to user with admin |
3163
28571535dd61
API methods create_repo, fork_repo, delete_repo, get_repo, get_repos
Marcin Kuzminski <marcin@python-works.com>
parents:
3162
diff
changeset
|
603 rights or regular user that have at least read access to repository. |
1843 | 604 |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
605 |
1843 | 606 INPUT:: |
607 | |
2143
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2095
diff
changeset
|
608 id : <id_for_response> |
1843 | 609 api_key : "<api_key>" |
610 method : "get_repo" | |
611 args: { | |
2010
14dffcfebb02
API get_user and get_repo methods can fetch by id or names
Marcin Kuzminski <marcin@python-works.com>
parents:
2009
diff
changeset
|
612 "repoid" : "<reponame or repo_id>" |
1843 | 613 } |
614 | |
615 OUTPUT:: | |
616 | |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
617 id : <id_given_in_input> |
1843 | 618 result: None if repository does not exist or |
619 { | |
3115
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
620 "repo_id" : "<repo_id>", |
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
621 "repo_name" : "<reponame>" |
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
622 "repo_type" : "<repo_type>", |
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
623 "clone_uri" : "<clone_uri>", |
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
624 "enable_downloads": "<bool>", |
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
625 "enable_locking": "<bool>", |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
626 "enable_statistics": "<bool>", |
3115
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
627 "private": "<bool>", |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
628 "created_on" : "<date_time_created>", |
3115
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
629 "description" : "<description>", |
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
630 "landing_rev": "<landing_rev>", |
3174
37c0ac5fe42f
added last_changeset information in get_repo API function
Marcin Kuzminski <marcin@python-works.com>
parents:
3163
diff
changeset
|
631 "last_changeset": { |
37c0ac5fe42f
added last_changeset information in get_repo API function
Marcin Kuzminski <marcin@python-works.com>
parents:
3163
diff
changeset
|
632 "author": "<full_author>", |
37c0ac5fe42f
added last_changeset information in get_repo API function
Marcin Kuzminski <marcin@python-works.com>
parents:
3163
diff
changeset
|
633 "date": "<date_time_of_commit>", |
37c0ac5fe42f
added last_changeset information in get_repo API function
Marcin Kuzminski <marcin@python-works.com>
parents:
3163
diff
changeset
|
634 "message": "<commit_message>", |
37c0ac5fe42f
added last_changeset information in get_repo API function
Marcin Kuzminski <marcin@python-works.com>
parents:
3163
diff
changeset
|
635 "raw_id": "<raw_id>", |
37c0ac5fe42f
added last_changeset information in get_repo API function
Marcin Kuzminski <marcin@python-works.com>
parents:
3163
diff
changeset
|
636 "revision": "<numeric_revision>", |
37c0ac5fe42f
added last_changeset information in get_repo API function
Marcin Kuzminski <marcin@python-works.com>
parents:
3163
diff
changeset
|
637 "short_id": "<short_id>" |
37c0ac5fe42f
added last_changeset information in get_repo API function
Marcin Kuzminski <marcin@python-works.com>
parents:
3163
diff
changeset
|
638 } |
3115
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
639 "owner": "<repo_owner>", |
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
640 "fork_of": "<name_of_fork_parent>", |
1843 | 641 "members" : [ |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
642 { |
3213
f5dcee2b3153
updated api docs
Marcin Kuzminski <marcin@python-works.com>
parents:
3174
diff
changeset
|
643 "type": "user", |
3174
37c0ac5fe42f
added last_changeset information in get_repo API function
Marcin Kuzminski <marcin@python-works.com>
parents:
3163
diff
changeset
|
644 "user_id" : "<user_id>", |
37c0ac5fe42f
added last_changeset information in get_repo API function
Marcin Kuzminski <marcin@python-works.com>
parents:
3163
diff
changeset
|
645 "username" : "<username>", |
37c0ac5fe42f
added last_changeset information in get_repo API function
Marcin Kuzminski <marcin@python-works.com>
parents:
3163
diff
changeset
|
646 "firstname": "<firstname>", |
37c0ac5fe42f
added last_changeset information in get_repo API function
Marcin Kuzminski <marcin@python-works.com>
parents:
3163
diff
changeset
|
647 "lastname" : "<lastname>", |
37c0ac5fe42f
added last_changeset information in get_repo API function
Marcin Kuzminski <marcin@python-works.com>
parents:
3163
diff
changeset
|
648 "email" : "<email>", |
37c0ac5fe42f
added last_changeset information in get_repo API function
Marcin Kuzminski <marcin@python-works.com>
parents:
3163
diff
changeset
|
649 "emails": "<list_of_all_additional_emails>", |
37c0ac5fe42f
added last_changeset information in get_repo API function
Marcin Kuzminski <marcin@python-works.com>
parents:
3163
diff
changeset
|
650 "active" : "<bool>", |
37c0ac5fe42f
added last_changeset information in get_repo API function
Marcin Kuzminski <marcin@python-works.com>
parents:
3163
diff
changeset
|
651 "admin" :Â "<bool>", |
37c0ac5fe42f
added last_changeset information in get_repo API function
Marcin Kuzminski <marcin@python-works.com>
parents:
3163
diff
changeset
|
652 "ldap_dn" : "<ldap_dn>", |
37c0ac5fe42f
added last_changeset information in get_repo API function
Marcin Kuzminski <marcin@python-works.com>
parents:
3163
diff
changeset
|
653 "last_login": "<last_login>", |
1843 | 654 "permission" : "repository.(read|write|admin)" |
655 }, | |
656 … | |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
657 { |
3213
f5dcee2b3153
updated api docs
Marcin Kuzminski <marcin@python-works.com>
parents:
3174
diff
changeset
|
658 "type": "users_group", |
1843 | 659 "id" : "<usersgroupid>", |
660 "name" : "<usersgroupname>", | |
661 "active": "<bool>", | |
662 "permission" : "repository.(read|write|admin)" | |
663 }, | |
664 … | |
665 ] | |
3213
f5dcee2b3153
updated api docs
Marcin Kuzminski <marcin@python-works.com>
parents:
3174
diff
changeset
|
666 "followers": [ |
f5dcee2b3153
updated api docs
Marcin Kuzminski <marcin@python-works.com>
parents:
3174
diff
changeset
|
667 { |
f5dcee2b3153
updated api docs
Marcin Kuzminski <marcin@python-works.com>
parents:
3174
diff
changeset
|
668 "user_id" : "<user_id>", |
f5dcee2b3153
updated api docs
Marcin Kuzminski <marcin@python-works.com>
parents:
3174
diff
changeset
|
669 "username" : "<username>", |
f5dcee2b3153
updated api docs
Marcin Kuzminski <marcin@python-works.com>
parents:
3174
diff
changeset
|
670 "firstname": "<firstname>", |
f5dcee2b3153
updated api docs
Marcin Kuzminski <marcin@python-works.com>
parents:
3174
diff
changeset
|
671 "lastname" : "<lastname>", |
f5dcee2b3153
updated api docs
Marcin Kuzminski <marcin@python-works.com>
parents:
3174
diff
changeset
|
672 "email" : "<email>", |
f5dcee2b3153
updated api docs
Marcin Kuzminski <marcin@python-works.com>
parents:
3174
diff
changeset
|
673 "emails": "<list_of_all_additional_emails>", |
f5dcee2b3153
updated api docs
Marcin Kuzminski <marcin@python-works.com>
parents:
3174
diff
changeset
|
674 "ip_addresses": "<list_of_ip_addresses_for_user>", |
f5dcee2b3153
updated api docs
Marcin Kuzminski <marcin@python-works.com>
parents:
3174
diff
changeset
|
675 "active" : "<bool>", |
f5dcee2b3153
updated api docs
Marcin Kuzminski <marcin@python-works.com>
parents:
3174
diff
changeset
|
676 "admin" :Â "<bool>", |
f5dcee2b3153
updated api docs
Marcin Kuzminski <marcin@python-works.com>
parents:
3174
diff
changeset
|
677 "ldap_dn" : "<ldap_dn>", |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
678 "last_login": "<last_login>", |
3213
f5dcee2b3153
updated api docs
Marcin Kuzminski <marcin@python-works.com>
parents:
3174
diff
changeset
|
679 }, |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
680 … |
3213
f5dcee2b3153
updated api docs
Marcin Kuzminski <marcin@python-works.com>
parents:
3174
diff
changeset
|
681 ] |
1843 | 682 } |
683 error: null | |
684 | |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
685 |
1592 | 686 get_repos |
687 --------- | |
688 | |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
689 Lists all existing repositories. This command can be executed only using |
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
690 api_key belonging to user with admin rights or regular user that have |
3163
28571535dd61
API methods create_repo, fork_repo, delete_repo, get_repo, get_repos
Marcin Kuzminski <marcin@python-works.com>
parents:
3162
diff
changeset
|
691 admin, write or read access to repository. |
1592 | 692 |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
693 |
1592 | 694 INPUT:: |
695 | |
2143
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2095
diff
changeset
|
696 id : <id_for_response> |
1592 | 697 api_key : "<api_key>" |
698 method : "get_repos" | |
699 args: { } | |
1500 | 700 |
701 OUTPUT:: | |
702 | |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
703 id : <id_given_in_input> |
1592 | 704 result: [ |
705 { | |
3115
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
706 "repo_id" : "<repo_id>", |
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
707 "repo_name" : "<reponame>" |
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
708 "repo_type" : "<repo_type>", |
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
709 "clone_uri" : "<clone_uri>", |
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
710 "private": : "<bool>", |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
711 "created_on" : "<datetimecreated>", |
3115
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
712 "description" : "<description>", |
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
713 "landing_rev": "<landing_rev>", |
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
714 "owner": "<repo_owner>", |
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
715 "fork_of": "<name_of_fork_parent>", |
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
716 "enable_downloads": "<bool>", |
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
717 "enable_locking": "<bool>", |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
718 "enable_statistics": "<bool>", |
1592 | 719 }, |
720 … | |
721 ] | |
722 error: null | |
723 | |
724 | |
1810
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
725 get_repo_nodes |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
726 -------------- |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
727 |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
728 returns a list of nodes and it's children in a flat list for a given path |
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
729 at given revision. It's possible to specify ret_type to show only `files` or |
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
730 `dirs`. This command can be executed only using api_key belonging to user |
1810
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
731 with admin rights |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
732 |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
733 |
1810
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
734 INPUT:: |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
735 |
2143
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2095
diff
changeset
|
736 id : <id_for_response> |
1810
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
737 api_key : "<api_key>" |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
738 method : "get_repo_nodes" |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
739 args: { |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
740 "repoid" : "<reponame or repo_id>" |
1810
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
741 "revision" : "<revision>", |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
742 "root_path" : "<root_path>", |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
743 "ret_type" : "<ret_type> = Optional('all')" |
1810
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
744 } |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
745 |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
746 OUTPUT:: |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
747 |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
748 id : <id_given_in_input> |
1810
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
749 result: [ |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
750 { |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
751 "name" : "<name>" |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
752 "type" : "<type>", |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
753 }, |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
754 … |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
755 ] |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
756 error: null |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
757 |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
758 |
1592 | 759 create_repo |
760 ----------- | |
761 | |
3163
28571535dd61
API methods create_repo, fork_repo, delete_repo, get_repo, get_repos
Marcin Kuzminski <marcin@python-works.com>
parents:
3162
diff
changeset
|
762 Creates a repository. If repository name contains "/", all needed repository |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
763 groups will be created. For example "foo/bar/baz" will create groups |
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
764 "foo", "bar" (with "foo" as parent), and create "baz" repository with |
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
765 "bar" as group. This command can be executed only using api_key belonging to user with admin |
3163
28571535dd61
API methods create_repo, fork_repo, delete_repo, get_repo, get_repos
Marcin Kuzminski <marcin@python-works.com>
parents:
3162
diff
changeset
|
766 rights or regular user that have create repository permission. Regular users |
28571535dd61
API methods create_repo, fork_repo, delete_repo, get_repo, get_repos
Marcin Kuzminski <marcin@python-works.com>
parents:
3162
diff
changeset
|
767 cannot specify owner parameter |
1592 | 768 |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
769 |
1592 | 770 INPUT:: |
771 | |
2143
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2095
diff
changeset
|
772 id : <id_for_response> |
1592 | 773 api_key : "<api_key>" |
774 method : "create_repo" | |
775 args: { | |
3115
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
776 "repo_name" : "<reponame>", |
3163
28571535dd61
API methods create_repo, fork_repo, delete_repo, get_repo, get_repos
Marcin Kuzminski <marcin@python-works.com>
parents:
3162
diff
changeset
|
777 "owner" : "<onwer_name_or_id = Optional(=apiuser)>", |
3115
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
778 "repo_type" : "<repo_type> = Optional('hg')", |
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
779 "description" : "<description> = Optional('')", |
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
780 "private" : "<bool> = Optional(False)", |
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
781 "clone_uri" : "<clone_uri> = Optional(None)", |
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
782 "landing_rev" : "<landing_rev> = Optional('tip')", |
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
783 "enable_downloads": "<bool> = Optional(False)", |
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
784 "enable_locking": "<bool> = Optional(False)", |
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
785 "enable_statistics": "<bool> = Optional(False)", |
1592 | 786 } |
787 | |
788 OUTPUT:: | |
789 | |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
790 id : <id_given_in_input> |
1843 | 791 result: { |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
792 "msg": "Created new repository `<reponame>`", |
2378
04ef27ce939e
API: create_repo returns now repo object after creation
Marcin Kuzminski <marcin@python-works.com>
parents:
2365
diff
changeset
|
793 "repo": { |
3115
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
794 "repo_id" : "<repo_id>", |
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
795 "repo_name" : "<reponame>" |
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
796 "repo_type" : "<repo_type>", |
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
797 "clone_uri" : "<clone_uri>", |
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
798 "private": : "<bool>", |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
799 "created_on" : "<datetimecreated>", |
3115
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
800 "description" : "<description>", |
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
801 "landing_rev": "<landing_rev>", |
3122
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
802 "owner": "<username or user_id>", |
3115
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
803 "fork_of": "<name_of_fork_parent>", |
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
804 "enable_downloads": "<bool>", |
ebd76deee70d
Default parameters are now also used for creating repos using API calls, and initial repo scanner
Marcin Kuzminski <marcin@python-works.com>
parents:
2903
diff
changeset
|
805 "enable_locking": "<bool>", |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
806 "enable_statistics": "<bool>", |
2378
04ef27ce939e
API: create_repo returns now repo object after creation
Marcin Kuzminski <marcin@python-works.com>
parents:
2365
diff
changeset
|
807 }, |
1843 | 808 } |
1592 | 809 error: null |
810 | |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
811 |
3122
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
812 fork_repo |
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
813 --------- |
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
814 |
3163
28571535dd61
API methods create_repo, fork_repo, delete_repo, get_repo, get_repos
Marcin Kuzminski <marcin@python-works.com>
parents:
3162
diff
changeset
|
815 Creates a fork of given repo. In case of using celery this will |
3122
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
816 immidiatelly return success message, while fork is going to be created |
3163
28571535dd61
API methods create_repo, fork_repo, delete_repo, get_repo, get_repos
Marcin Kuzminski <marcin@python-works.com>
parents:
3162
diff
changeset
|
817 asynchronous. This command can be executed only using api_key belonging to |
28571535dd61
API methods create_repo, fork_repo, delete_repo, get_repo, get_repos
Marcin Kuzminski <marcin@python-works.com>
parents:
3162
diff
changeset
|
818 user with admin rights or regular user that have fork permission, and at least |
28571535dd61
API methods create_repo, fork_repo, delete_repo, get_repo, get_repos
Marcin Kuzminski <marcin@python-works.com>
parents:
3162
diff
changeset
|
819 read access to forking repository. Regular users cannot specify owner parameter. |
3122
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
820 |
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
821 |
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
822 INPUT:: |
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
823 |
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
824 id : <id_for_response> |
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
825 api_key : "<api_key>" |
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
826 method : "fork_repo" |
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
827 args: { |
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
828 "repoid" : "<reponame or repo_id>", |
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
829 "fork_name": "<forkname>", |
3163
28571535dd61
API methods create_repo, fork_repo, delete_repo, get_repo, get_repos
Marcin Kuzminski <marcin@python-works.com>
parents:
3162
diff
changeset
|
830 "owner": "<username or user_id = Optional(=apiuser)>", |
3122
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
831 "description": "<description>", |
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
832 "copy_permissions": "<bool>", |
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
833 "private": "<bool>", |
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
834 "landing_rev": "<landing_rev>" |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
835 |
3122
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
836 } |
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
837 |
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
838 OUTPUT:: |
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
839 |
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
840 id : <id_given_in_input> |
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
841 result: { |
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
842 "msg": "Created fork of `<reponame>` as `<forkname>`", |
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
843 "success": true |
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
844 } |
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
845 error: null |
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
846 |
4ef6a7ed5e3e
#699: fix missing fork docs for API
Marcin Kuzminski <marcin@python-works.com>
parents:
3115
diff
changeset
|
847 |
2003
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
848 delete_repo |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
849 ----------- |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
850 |
3641
b44979649915
recursive forks detach
Marcin Kuzminski <marcin@python-works.com>
parents:
3457
diff
changeset
|
851 Deletes a repository. This command can be executed only using api_key belonging |
b44979649915
recursive forks detach
Marcin Kuzminski <marcin@python-works.com>
parents:
3457
diff
changeset
|
852 to user with admin rights or regular user that have admin access to repository. |
b44979649915
recursive forks detach
Marcin Kuzminski <marcin@python-works.com>
parents:
3457
diff
changeset
|
853 When `forks` param is set it's possible to detach or delete forks of deleting |
b44979649915
recursive forks detach
Marcin Kuzminski <marcin@python-works.com>
parents:
3457
diff
changeset
|
854 repository |
2003
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
855 |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
856 |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
857 INPUT:: |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
858 |
2143
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2095
diff
changeset
|
859 id : <id_for_response> |
2003
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
860 api_key : "<api_key>" |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
861 method : "delete_repo" |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
862 args: { |
3641
b44979649915
recursive forks detach
Marcin Kuzminski <marcin@python-works.com>
parents:
3457
diff
changeset
|
863 "repoid" : "<reponame or repo_id>", |
b44979649915
recursive forks detach
Marcin Kuzminski <marcin@python-works.com>
parents:
3457
diff
changeset
|
864 "forks" : "`delete` or `detach` = Optional(None)" |
2003
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
865 } |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
866 |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
867 OUTPUT:: |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
868 |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
869 id : <id_given_in_input> |
2003
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
870 result: { |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
871 "msg": "Deleted repository `<reponame>`", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
872 "success": true |
2003
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
873 } |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
874 error: null |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
875 |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
876 |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
877 grant_user_permission |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
878 --------------------- |
1592 | 879 |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
880 Grant permission for user on given repository, or update existing one |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
881 if found. This command can be executed only using api_key belonging to user |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
882 with admin rights. |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
883 |
1592 | 884 |
885 INPUT:: | |
886 | |
2143
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2095
diff
changeset
|
887 id : <id_for_response> |
1592 | 888 api_key : "<api_key>" |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
889 method : "grant_user_permission" |
1592 | 890 args: { |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
891 "repoid" : "<reponame or repo_id>" |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
892 "userid" : "<username or user_id>" |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
893 "perm" : "(repository.(none|read|write|admin))", |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
894 } |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
895 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
896 OUTPUT:: |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
897 |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
898 id : <id_given_in_input> |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
899 result: { |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
900 "msg" : "Granted perm: `<perm>` for user: `<username>` in repo: `<reponame>`", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
901 "success": true |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
902 } |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
903 error: null |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
904 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
905 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
906 revoke_user_permission |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
907 ---------------------- |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
908 |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
909 Revoke permission for user on given repository. This command can be executed |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
910 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:
1950
diff
changeset
|
911 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
912 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
913 INPUT:: |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
914 |
2143
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2095
diff
changeset
|
915 id : <id_for_response> |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
916 api_key : "<api_key>" |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
917 method : "revoke_user_permission" |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
918 args: { |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
919 "repoid" : "<reponame or repo_id>" |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
920 "userid" : "<username or user_id>" |
1592 | 921 } |
922 | |
923 OUTPUT:: | |
924 | |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
925 id : <id_given_in_input> |
1843 | 926 result: { |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
927 "msg" : "Revoked perm for user: `<username>` in repo: `<reponame>`", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
928 "success": true |
1843 | 929 } |
1592 | 930 error: null |
1793
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1708
diff
changeset
|
931 |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
932 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
933 grant_users_group_permission |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
934 ---------------------------- |
1793
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1708
diff
changeset
|
935 |
3410
5f1850e4712a
"Users groups" is grammatically incorrect English - rename to "user groups"
Mads Kiilerich <madski@unity3d.com>
parents:
3267
diff
changeset
|
936 Grant permission for user group on given repository, or update |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
937 existing one if found. This command can be executed only using |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
938 api_key belonging to user with admin rights. |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
939 |
1793
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1708
diff
changeset
|
940 |
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1708
diff
changeset
|
941 INPUT:: |
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1708
diff
changeset
|
942 |
2143
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2095
diff
changeset
|
943 id : <id_for_response> |
1793
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1708
diff
changeset
|
944 api_key : "<api_key>" |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
945 method : "grant_users_group_permission" |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
946 args: { |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
947 "repoid" : "<reponame or repo_id>" |
3410
5f1850e4712a
"Users groups" is grammatically incorrect English - rename to "user groups"
Mads Kiilerich <madski@unity3d.com>
parents:
3267
diff
changeset
|
948 "usersgroupid" : "<user group id or name>" |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
949 "perm" : "(repository.(none|read|write|admin))", |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
950 } |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
951 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
952 OUTPUT:: |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
953 |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
954 id : <id_given_in_input> |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
955 result: { |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
956 "msg" : "Granted perm: `<perm>` for group: `<usersgroupname>` in repo: `<reponame>`", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
957 "success": true |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
958 } |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
959 error: null |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
960 |
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
961 |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
962 revoke_users_group_permission |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
963 ----------------------------- |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
964 |
3410
5f1850e4712a
"Users groups" is grammatically incorrect English - rename to "user groups"
Mads Kiilerich <madski@unity3d.com>
parents:
3267
diff
changeset
|
965 Revoke permission for user group on given repository.This command can be |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
966 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:
1950
diff
changeset
|
967 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
968 INPUT:: |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
969 |
2143
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2095
diff
changeset
|
970 id : <id_for_response> |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
971 api_key : "<api_key>" |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
972 method : "revoke_users_group_permission" |
1793
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1708
diff
changeset
|
973 args: { |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
974 "repoid" : "<reponame or repo_id>" |
3410
5f1850e4712a
"Users groups" is grammatically incorrect English - rename to "user groups"
Mads Kiilerich <madski@unity3d.com>
parents:
3267
diff
changeset
|
975 "usersgroupid" : "<user group id or name>" |
1843 | 976 } |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
977 |
1843 | 978 OUTPUT:: |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
979 |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
980 id : <id_given_in_input> |
1843 | 981 result: { |
2531
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
982 "msg" : "Revoked perm for group: `<usersgroupname>` in repo: `<reponame>`", |
d80a68e2ebcc
return proper id from users_group
Marcin Kuzminski <marcin@python-works.com>
parents:
2507
diff
changeset
|
983 "success": true |
1843 | 984 } |
3224
8b8edfc25856
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3213
diff
changeset
|
985 error: null |