Show More
@@ -1,371 +1,376 b'' | |||||
1 | .. _pull-request-methods-ref: |
|
1 | .. _pull-request-methods-ref: | |
2 |
|
2 | |||
3 | pull_request methods |
|
3 | pull_request methods | |
4 | ==================== |
|
4 | ==================== | |
5 |
|
5 | |||
6 | close_pull_request |
|
6 | close_pull_request | |
7 | ------------------ |
|
7 | ------------------ | |
8 |
|
8 | |||
9 | .. py:function:: close_pull_request(apiuser, repoid, pullrequestid, userid=<Optional:<OptionalAttr:apiuser>>) |
|
9 | .. py:function:: close_pull_request(apiuser, repoid, pullrequestid, userid=<Optional:<OptionalAttr:apiuser>>) | |
10 |
|
10 | |||
11 | Close the pull request specified by `pullrequestid`. |
|
11 | Close the pull request specified by `pullrequestid`. | |
12 |
|
12 | |||
13 | :param apiuser: This is filled automatically from the |authtoken|. |
|
13 | :param apiuser: This is filled automatically from the |authtoken|. | |
14 | :type apiuser: AuthUser |
|
14 | :type apiuser: AuthUser | |
15 | :param repoid: Repository name or repository ID to which the pull |
|
15 | :param repoid: Repository name or repository ID to which the pull | |
16 | request belongs. |
|
16 | request belongs. | |
17 | :type repoid: str or int |
|
17 | :type repoid: str or int | |
18 | :param pullrequestid: ID of the pull request to be closed. |
|
18 | :param pullrequestid: ID of the pull request to be closed. | |
19 | :type pullrequestid: int |
|
19 | :type pullrequestid: int | |
20 | :param userid: Close the pull request as this user. |
|
20 | :param userid: Close the pull request as this user. | |
21 | :type userid: Optional(str or int) |
|
21 | :type userid: Optional(str or int) | |
22 |
|
22 | |||
23 | Example output: |
|
23 | Example output: | |
24 |
|
24 | |||
25 | .. code-block:: bash |
|
25 | .. code-block:: bash | |
26 |
|
26 | |||
27 | "id": <id_given_in_input>, |
|
27 | "id": <id_given_in_input>, | |
28 | "result": |
|
28 | "result": | |
29 | { |
|
29 | { | |
30 | "pull_request_id": "<int>", |
|
30 | "pull_request_id": "<int>", | |
31 | "closed": "<bool>" |
|
31 | "closed": "<bool>" | |
32 | }, |
|
32 | }, | |
33 | "error": null |
|
33 | "error": null | |
34 |
|
34 | |||
35 |
|
35 | |||
36 | comment_pull_request |
|
36 | comment_pull_request | |
37 | -------------------- |
|
37 | -------------------- | |
38 |
|
38 | |||
39 | .. py:function:: comment_pull_request(apiuser, repoid, pullrequestid, message=<Optional:None>, status=<Optional:None>, userid=<Optional:<OptionalAttr:apiuser>>) |
|
39 | .. py:function:: comment_pull_request(apiuser, repoid, pullrequestid, message=<Optional:None>, commit_id=<Optional:None>, status=<Optional:None>, comment_type=<Optional:u'note'>, resolves_comment_id=<Optional:None>, userid=<Optional:<OptionalAttr:apiuser>>) | |
40 |
|
40 | |||
41 | Comment on the pull request specified with the `pullrequestid`, |
|
41 | Comment on the pull request specified with the `pullrequestid`, | |
42 | in the |repo| specified by the `repoid`, and optionally change the |
|
42 | in the |repo| specified by the `repoid`, and optionally change the | |
43 | review status. |
|
43 | review status. | |
44 |
|
44 | |||
45 | :param apiuser: This is filled automatically from the |authtoken|. |
|
45 | :param apiuser: This is filled automatically from the |authtoken|. | |
46 | :type apiuser: AuthUser |
|
46 | :type apiuser: AuthUser | |
47 | :param repoid: The repository name or repository ID. |
|
47 | :param repoid: The repository name or repository ID. | |
48 | :type repoid: str or int |
|
48 | :type repoid: str or int | |
49 | :param pullrequestid: The pull request ID. |
|
49 | :param pullrequestid: The pull request ID. | |
50 | :type pullrequestid: int |
|
50 | :type pullrequestid: int | |
|
51 | :param commit_id: Specify the commit_id for which to set a comment. If | |||
|
52 | given commit_id is different than latest in the PR status | |||
|
53 | change won't be performed. | |||
|
54 | :type commit_id: str | |||
51 | :param message: The text content of the comment. |
|
55 | :param message: The text content of the comment. | |
52 | :type message: str |
|
56 | :type message: str | |
53 | :param status: (**Optional**) Set the approval status of the pull |
|
57 | :param status: (**Optional**) Set the approval status of the pull | |
54 | request. Valid options are: |
|
58 | request. One of: 'not_reviewed', 'approved', 'rejected', | |
55 |
|
|
59 | 'under_review' | |
56 | * approved |
|
|||
57 | * rejected |
|
|||
58 | * under_review |
|
|||
59 | :type status: str |
|
60 | :type status: str | |
|
61 | :param comment_type: Comment type, one of: 'note', 'todo' | |||
|
62 | :type comment_type: Optional(str), default: 'note' | |||
60 | :param userid: Comment on the pull request as this user |
|
63 | :param userid: Comment on the pull request as this user | |
61 | :type userid: Optional(str or int) |
|
64 | :type userid: Optional(str or int) | |
62 |
|
65 | |||
63 | Example output: |
|
66 | Example output: | |
64 |
|
67 | |||
65 | .. code-block:: bash |
|
68 | .. code-block:: bash | |
66 |
|
69 | |||
67 | id : <id_given_in_input> |
|
70 | id : <id_given_in_input> | |
68 | result : |
|
71 | result : | |
69 | { |
|
72 | { | |
70 | "pull_request_id": "<Integer>", |
|
73 | "pull_request_id": "<Integer>", | |
71 | "comment_id": "<Integer>" |
|
74 | "comment_id": "<Integer>", | |
|
75 | "status": {"given": <given_status>, | |||
|
76 | "was_changed": <bool status_was_actually_changed> }, | |||
72 | } |
|
77 | } | |
73 | error : null |
|
78 | error : null | |
74 |
|
79 | |||
75 |
|
80 | |||
76 | create_pull_request |
|
81 | create_pull_request | |
77 | ------------------- |
|
82 | ------------------- | |
78 |
|
83 | |||
79 | .. py:function:: create_pull_request(apiuser, source_repo, target_repo, source_ref, target_ref, title, description=<Optional:''>, reviewers=<Optional:None>) |
|
84 | .. py:function:: create_pull_request(apiuser, source_repo, target_repo, source_ref, target_ref, title, description=<Optional:''>, reviewers=<Optional:None>) | |
80 |
|
85 | |||
81 | Creates a new pull request. |
|
86 | Creates a new pull request. | |
82 |
|
87 | |||
83 | Accepts refs in the following formats: |
|
88 | Accepts refs in the following formats: | |
84 |
|
89 | |||
85 | * branch:<branch_name>:<sha> |
|
90 | * branch:<branch_name>:<sha> | |
86 | * branch:<branch_name> |
|
91 | * branch:<branch_name> | |
87 | * bookmark:<bookmark_name>:<sha> (Mercurial only) |
|
92 | * bookmark:<bookmark_name>:<sha> (Mercurial only) | |
88 | * bookmark:<bookmark_name> (Mercurial only) |
|
93 | * bookmark:<bookmark_name> (Mercurial only) | |
89 |
|
94 | |||
90 | :param apiuser: This is filled automatically from the |authtoken|. |
|
95 | :param apiuser: This is filled automatically from the |authtoken|. | |
91 | :type apiuser: AuthUser |
|
96 | :type apiuser: AuthUser | |
92 | :param source_repo: Set the source repository name. |
|
97 | :param source_repo: Set the source repository name. | |
93 | :type source_repo: str |
|
98 | :type source_repo: str | |
94 | :param target_repo: Set the target repository name. |
|
99 | :param target_repo: Set the target repository name. | |
95 | :type target_repo: str |
|
100 | :type target_repo: str | |
96 | :param source_ref: Set the source ref name. |
|
101 | :param source_ref: Set the source ref name. | |
97 | :type source_ref: str |
|
102 | :type source_ref: str | |
98 | :param target_ref: Set the target ref name. |
|
103 | :param target_ref: Set the target ref name. | |
99 | :type target_ref: str |
|
104 | :type target_ref: str | |
100 | :param title: Set the pull request title. |
|
105 | :param title: Set the pull request title. | |
101 | :type title: str |
|
106 | :type title: str | |
102 | :param description: Set the pull request description. |
|
107 | :param description: Set the pull request description. | |
103 | :type description: Optional(str) |
|
108 | :type description: Optional(str) | |
104 | :param reviewers: Set the new pull request reviewers list. |
|
109 | :param reviewers: Set the new pull request reviewers list. | |
105 | :type reviewers: Optional(list) |
|
110 | :type reviewers: Optional(list) | |
106 | Accepts username strings or objects of the format: |
|
111 | Accepts username strings or objects of the format: | |
107 | { |
|
112 | { | |
108 | 'username': 'nick', 'reasons': ['original author'] |
|
113 | 'username': 'nick', 'reasons': ['original author'] | |
109 | } |
|
114 | } | |
110 |
|
115 | |||
111 |
|
116 | |||
112 | get_pull_request |
|
117 | get_pull_request | |
113 | ---------------- |
|
118 | ---------------- | |
114 |
|
119 | |||
115 | .. py:function:: get_pull_request(apiuser, repoid, pullrequestid) |
|
120 | .. py:function:: get_pull_request(apiuser, repoid, pullrequestid) | |
116 |
|
121 | |||
117 | Get a pull request based on the given ID. |
|
122 | Get a pull request based on the given ID. | |
118 |
|
123 | |||
119 | :param apiuser: This is filled automatically from the |authtoken|. |
|
124 | :param apiuser: This is filled automatically from the |authtoken|. | |
120 | :type apiuser: AuthUser |
|
125 | :type apiuser: AuthUser | |
121 | :param repoid: Repository name or repository ID from where the pull |
|
126 | :param repoid: Repository name or repository ID from where the pull | |
122 | request was opened. |
|
127 | request was opened. | |
123 | :type repoid: str or int |
|
128 | :type repoid: str or int | |
124 | :param pullrequestid: ID of the requested pull request. |
|
129 | :param pullrequestid: ID of the requested pull request. | |
125 | :type pullrequestid: int |
|
130 | :type pullrequestid: int | |
126 |
|
131 | |||
127 | Example output: |
|
132 | Example output: | |
128 |
|
133 | |||
129 | .. code-block:: bash |
|
134 | .. code-block:: bash | |
130 |
|
135 | |||
131 | "id": <id_given_in_input>, |
|
136 | "id": <id_given_in_input>, | |
132 | "result": |
|
137 | "result": | |
133 | { |
|
138 | { | |
134 | "pull_request_id": "<pull_request_id>", |
|
139 | "pull_request_id": "<pull_request_id>", | |
135 | "url": "<url>", |
|
140 | "url": "<url>", | |
136 | "title": "<title>", |
|
141 | "title": "<title>", | |
137 | "description": "<description>", |
|
142 | "description": "<description>", | |
138 | "status" : "<status>", |
|
143 | "status" : "<status>", | |
139 | "created_on": "<date_time_created>", |
|
144 | "created_on": "<date_time_created>", | |
140 | "updated_on": "<date_time_updated>", |
|
145 | "updated_on": "<date_time_updated>", | |
141 | "commit_ids": [ |
|
146 | "commit_ids": [ | |
142 | ... |
|
147 | ... | |
143 | "<commit_id>", |
|
148 | "<commit_id>", | |
144 | "<commit_id>", |
|
149 | "<commit_id>", | |
145 | ... |
|
150 | ... | |
146 | ], |
|
151 | ], | |
147 | "review_status": "<review_status>", |
|
152 | "review_status": "<review_status>", | |
148 | "mergeable": { |
|
153 | "mergeable": { | |
149 | "status": "<bool>", |
|
154 | "status": "<bool>", | |
150 | "message": "<message>", |
|
155 | "message": "<message>", | |
151 | }, |
|
156 | }, | |
152 | "source": { |
|
157 | "source": { | |
153 | "clone_url": "<clone_url>", |
|
158 | "clone_url": "<clone_url>", | |
154 | "repository": "<repository_name>", |
|
159 | "repository": "<repository_name>", | |
155 | "reference": |
|
160 | "reference": | |
156 | { |
|
161 | { | |
157 | "name": "<name>", |
|
162 | "name": "<name>", | |
158 | "type": "<type>", |
|
163 | "type": "<type>", | |
159 | "commit_id": "<commit_id>", |
|
164 | "commit_id": "<commit_id>", | |
160 | } |
|
165 | } | |
161 | }, |
|
166 | }, | |
162 | "target": { |
|
167 | "target": { | |
163 | "clone_url": "<clone_url>", |
|
168 | "clone_url": "<clone_url>", | |
164 | "repository": "<repository_name>", |
|
169 | "repository": "<repository_name>", | |
165 | "reference": |
|
170 | "reference": | |
166 | { |
|
171 | { | |
167 | "name": "<name>", |
|
172 | "name": "<name>", | |
168 | "type": "<type>", |
|
173 | "type": "<type>", | |
169 | "commit_id": "<commit_id>", |
|
174 | "commit_id": "<commit_id>", | |
170 | } |
|
175 | } | |
171 | }, |
|
176 | }, | |
172 | "merge": { |
|
177 | "merge": { | |
173 | "clone_url": "<clone_url>", |
|
178 | "clone_url": "<clone_url>", | |
174 | "reference": |
|
179 | "reference": | |
175 | { |
|
180 | { | |
176 | "name": "<name>", |
|
181 | "name": "<name>", | |
177 | "type": "<type>", |
|
182 | "type": "<type>", | |
178 | "commit_id": "<commit_id>", |
|
183 | "commit_id": "<commit_id>", | |
179 | } |
|
184 | } | |
180 | }, |
|
185 | }, | |
181 | "author": <user_obj>, |
|
186 | "author": <user_obj>, | |
182 | "reviewers": [ |
|
187 | "reviewers": [ | |
183 | ... |
|
188 | ... | |
184 | { |
|
189 | { | |
185 | "user": "<user_obj>", |
|
190 | "user": "<user_obj>", | |
186 | "review_status": "<review_status>", |
|
191 | "review_status": "<review_status>", | |
187 | } |
|
192 | } | |
188 | ... |
|
193 | ... | |
189 | ] |
|
194 | ] | |
190 | }, |
|
195 | }, | |
191 | "error": null |
|
196 | "error": null | |
192 |
|
197 | |||
193 |
|
198 | |||
194 | get_pull_requests |
|
199 | get_pull_requests | |
195 | ----------------- |
|
200 | ----------------- | |
196 |
|
201 | |||
197 | .. py:function:: get_pull_requests(apiuser, repoid, status=<Optional:'new'>) |
|
202 | .. py:function:: get_pull_requests(apiuser, repoid, status=<Optional:'new'>) | |
198 |
|
203 | |||
199 | Get all pull requests from the repository specified in `repoid`. |
|
204 | Get all pull requests from the repository specified in `repoid`. | |
200 |
|
205 | |||
201 | :param apiuser: This is filled automatically from the |authtoken|. |
|
206 | :param apiuser: This is filled automatically from the |authtoken|. | |
202 | :type apiuser: AuthUser |
|
207 | :type apiuser: AuthUser | |
203 | :param repoid: Repository name or repository ID. |
|
208 | :param repoid: Repository name or repository ID. | |
204 | :type repoid: str or int |
|
209 | :type repoid: str or int | |
205 | :param status: Only return pull requests with the specified status. |
|
210 | :param status: Only return pull requests with the specified status. | |
206 | Valid options are. |
|
211 | Valid options are. | |
207 | * ``new`` (default) |
|
212 | * ``new`` (default) | |
208 | * ``open`` |
|
213 | * ``open`` | |
209 | * ``closed`` |
|
214 | * ``closed`` | |
210 | :type status: str |
|
215 | :type status: str | |
211 |
|
216 | |||
212 | Example output: |
|
217 | Example output: | |
213 |
|
218 | |||
214 | .. code-block:: bash |
|
219 | .. code-block:: bash | |
215 |
|
220 | |||
216 | "id": <id_given_in_input>, |
|
221 | "id": <id_given_in_input>, | |
217 | "result": |
|
222 | "result": | |
218 | [ |
|
223 | [ | |
219 | ... |
|
224 | ... | |
220 | { |
|
225 | { | |
221 | "pull_request_id": "<pull_request_id>", |
|
226 | "pull_request_id": "<pull_request_id>", | |
222 | "url": "<url>", |
|
227 | "url": "<url>", | |
223 | "title" : "<title>", |
|
228 | "title" : "<title>", | |
224 | "description": "<description>", |
|
229 | "description": "<description>", | |
225 | "status": "<status>", |
|
230 | "status": "<status>", | |
226 | "created_on": "<date_time_created>", |
|
231 | "created_on": "<date_time_created>", | |
227 | "updated_on": "<date_time_updated>", |
|
232 | "updated_on": "<date_time_updated>", | |
228 | "commit_ids": [ |
|
233 | "commit_ids": [ | |
229 | ... |
|
234 | ... | |
230 | "<commit_id>", |
|
235 | "<commit_id>", | |
231 | "<commit_id>", |
|
236 | "<commit_id>", | |
232 | ... |
|
237 | ... | |
233 | ], |
|
238 | ], | |
234 | "review_status": "<review_status>", |
|
239 | "review_status": "<review_status>", | |
235 | "mergeable": { |
|
240 | "mergeable": { | |
236 | "status": "<bool>", |
|
241 | "status": "<bool>", | |
237 | "message: "<message>", |
|
242 | "message: "<message>", | |
238 | }, |
|
243 | }, | |
239 | "source": { |
|
244 | "source": { | |
240 | "clone_url": "<clone_url>", |
|
245 | "clone_url": "<clone_url>", | |
241 | "reference": |
|
246 | "reference": | |
242 | { |
|
247 | { | |
243 | "name": "<name>", |
|
248 | "name": "<name>", | |
244 | "type": "<type>", |
|
249 | "type": "<type>", | |
245 | "commit_id": "<commit_id>", |
|
250 | "commit_id": "<commit_id>", | |
246 | } |
|
251 | } | |
247 | }, |
|
252 | }, | |
248 | "target": { |
|
253 | "target": { | |
249 | "clone_url": "<clone_url>", |
|
254 | "clone_url": "<clone_url>", | |
250 | "reference": |
|
255 | "reference": | |
251 | { |
|
256 | { | |
252 | "name": "<name>", |
|
257 | "name": "<name>", | |
253 | "type": "<type>", |
|
258 | "type": "<type>", | |
254 | "commit_id": "<commit_id>", |
|
259 | "commit_id": "<commit_id>", | |
255 | } |
|
260 | } | |
256 | }, |
|
261 | }, | |
257 | "merge": { |
|
262 | "merge": { | |
258 | "clone_url": "<clone_url>", |
|
263 | "clone_url": "<clone_url>", | |
259 | "reference": |
|
264 | "reference": | |
260 | { |
|
265 | { | |
261 | "name": "<name>", |
|
266 | "name": "<name>", | |
262 | "type": "<type>", |
|
267 | "type": "<type>", | |
263 | "commit_id": "<commit_id>", |
|
268 | "commit_id": "<commit_id>", | |
264 | } |
|
269 | } | |
265 | }, |
|
270 | }, | |
266 | "author": <user_obj>, |
|
271 | "author": <user_obj>, | |
267 | "reviewers": [ |
|
272 | "reviewers": [ | |
268 | ... |
|
273 | ... | |
269 | { |
|
274 | { | |
270 | "user": "<user_obj>", |
|
275 | "user": "<user_obj>", | |
271 | "review_status": "<review_status>", |
|
276 | "review_status": "<review_status>", | |
272 | } |
|
277 | } | |
273 | ... |
|
278 | ... | |
274 | ] |
|
279 | ] | |
275 | } |
|
280 | } | |
276 | ... |
|
281 | ... | |
277 | ], |
|
282 | ], | |
278 | "error": null |
|
283 | "error": null | |
279 |
|
284 | |||
280 |
|
285 | |||
281 | merge_pull_request |
|
286 | merge_pull_request | |
282 | ------------------ |
|
287 | ------------------ | |
283 |
|
288 | |||
284 | .. py:function:: merge_pull_request(apiuser, repoid, pullrequestid, userid=<Optional:<OptionalAttr:apiuser>>) |
|
289 | .. py:function:: merge_pull_request(apiuser, repoid, pullrequestid, userid=<Optional:<OptionalAttr:apiuser>>) | |
285 |
|
290 | |||
286 | Merge the pull request specified by `pullrequestid` into its target |
|
291 | Merge the pull request specified by `pullrequestid` into its target | |
287 | repository. |
|
292 | repository. | |
288 |
|
293 | |||
289 | :param apiuser: This is filled automatically from the |authtoken|. |
|
294 | :param apiuser: This is filled automatically from the |authtoken|. | |
290 | :type apiuser: AuthUser |
|
295 | :type apiuser: AuthUser | |
291 | :param repoid: The Repository name or repository ID of the |
|
296 | :param repoid: The Repository name or repository ID of the | |
292 | target repository to which the |pr| is to be merged. |
|
297 | target repository to which the |pr| is to be merged. | |
293 | :type repoid: str or int |
|
298 | :type repoid: str or int | |
294 | :param pullrequestid: ID of the pull request which shall be merged. |
|
299 | :param pullrequestid: ID of the pull request which shall be merged. | |
295 | :type pullrequestid: int |
|
300 | :type pullrequestid: int | |
296 | :param userid: Merge the pull request as this user. |
|
301 | :param userid: Merge the pull request as this user. | |
297 | :type userid: Optional(str or int) |
|
302 | :type userid: Optional(str or int) | |
298 |
|
303 | |||
299 | Example output: |
|
304 | Example output: | |
300 |
|
305 | |||
301 | .. code-block:: bash |
|
306 | .. code-block:: bash | |
302 |
|
307 | |||
303 | "id": <id_given_in_input>, |
|
308 | "id": <id_given_in_input>, | |
304 | "result": |
|
309 | "result": | |
305 | { |
|
310 | { | |
306 | "executed": "<bool>", |
|
311 | "executed": "<bool>", | |
307 | "failure_reason": "<int>", |
|
312 | "failure_reason": "<int>", | |
308 | "merge_commit_id": "<merge_commit_id>", |
|
313 | "merge_commit_id": "<merge_commit_id>", | |
309 | "possible": "<bool>", |
|
314 | "possible": "<bool>", | |
310 | "merge_ref": { |
|
315 | "merge_ref": { | |
311 | "commit_id": "<commit_id>", |
|
316 | "commit_id": "<commit_id>", | |
312 | "type": "<type>", |
|
317 | "type": "<type>", | |
313 | "name": "<name>" |
|
318 | "name": "<name>" | |
314 | } |
|
319 | } | |
315 | }, |
|
320 | }, | |
316 | "error": null |
|
321 | "error": null | |
317 |
|
322 | |||
318 |
|
323 | |||
319 | update_pull_request |
|
324 | update_pull_request | |
320 | ------------------- |
|
325 | ------------------- | |
321 |
|
326 | |||
322 | .. py:function:: update_pull_request(apiuser, repoid, pullrequestid, title=<Optional:''>, description=<Optional:''>, reviewers=<Optional:None>, update_commits=<Optional:None>, close_pull_request=<Optional:None>) |
|
327 | .. py:function:: update_pull_request(apiuser, repoid, pullrequestid, title=<Optional:''>, description=<Optional:''>, reviewers=<Optional:None>, update_commits=<Optional:None>, close_pull_request=<Optional:None>) | |
323 |
|
328 | |||
324 | Updates a pull request. |
|
329 | Updates a pull request. | |
325 |
|
330 | |||
326 | :param apiuser: This is filled automatically from the |authtoken|. |
|
331 | :param apiuser: This is filled automatically from the |authtoken|. | |
327 | :type apiuser: AuthUser |
|
332 | :type apiuser: AuthUser | |
328 | :param repoid: The repository name or repository ID. |
|
333 | :param repoid: The repository name or repository ID. | |
329 | :type repoid: str or int |
|
334 | :type repoid: str or int | |
330 | :param pullrequestid: The pull request ID. |
|
335 | :param pullrequestid: The pull request ID. | |
331 | :type pullrequestid: int |
|
336 | :type pullrequestid: int | |
332 | :param title: Set the pull request title. |
|
337 | :param title: Set the pull request title. | |
333 | :type title: str |
|
338 | :type title: str | |
334 | :param description: Update pull request description. |
|
339 | :param description: Update pull request description. | |
335 | :type description: Optional(str) |
|
340 | :type description: Optional(str) | |
336 | :param reviewers: Update pull request reviewers list with new value. |
|
341 | :param reviewers: Update pull request reviewers list with new value. | |
337 | :type reviewers: Optional(list) |
|
342 | :type reviewers: Optional(list) | |
338 | :param update_commits: Trigger update of commits for this pull request |
|
343 | :param update_commits: Trigger update of commits for this pull request | |
339 | :type: update_commits: Optional(bool) |
|
344 | :type: update_commits: Optional(bool) | |
340 | :param close_pull_request: Close this pull request with rejected state |
|
345 | :param close_pull_request: Close this pull request with rejected state | |
341 | :type: close_pull_request: Optional(bool) |
|
346 | :type: close_pull_request: Optional(bool) | |
342 |
|
347 | |||
343 | Example output: |
|
348 | Example output: | |
344 |
|
349 | |||
345 | .. code-block:: bash |
|
350 | .. code-block:: bash | |
346 |
|
351 | |||
347 | id : <id_given_in_input> |
|
352 | id : <id_given_in_input> | |
348 | result : |
|
353 | result : | |
349 | { |
|
354 | { | |
350 | "msg": "Updated pull request `63`", |
|
355 | "msg": "Updated pull request `63`", | |
351 | "pull_request": <pull_request_object>, |
|
356 | "pull_request": <pull_request_object>, | |
352 | "updated_reviewers": { |
|
357 | "updated_reviewers": { | |
353 | "added": [ |
|
358 | "added": [ | |
354 | "username" |
|
359 | "username" | |
355 | ], |
|
360 | ], | |
356 | "removed": [] |
|
361 | "removed": [] | |
357 | }, |
|
362 | }, | |
358 | "updated_commits": { |
|
363 | "updated_commits": { | |
359 | "added": [ |
|
364 | "added": [ | |
360 | "<sha1_hash>" |
|
365 | "<sha1_hash>" | |
361 | ], |
|
366 | ], | |
362 | "common": [ |
|
367 | "common": [ | |
363 | "<sha1_hash>", |
|
368 | "<sha1_hash>", | |
364 | "<sha1_hash>", |
|
369 | "<sha1_hash>", | |
365 | ], |
|
370 | ], | |
366 | "removed": [] |
|
371 | "removed": [] | |
367 | } |
|
372 | } | |
368 | } |
|
373 | } | |
369 | error : null |
|
374 | error : null | |
370 |
|
375 | |||
371 |
|
376 |
@@ -1,990 +1,1000 b'' | |||||
1 | .. _repo-methods-ref: |
|
1 | .. _repo-methods-ref: | |
2 |
|
2 | |||
3 | repo methods |
|
3 | repo methods | |
4 | ============ |
|
4 | ============ | |
5 |
|
5 | |||
6 | add_field_to_repo |
|
6 | add_field_to_repo | |
7 | ----------------- |
|
7 | ----------------- | |
8 |
|
8 | |||
9 | .. py:function:: add_field_to_repo(apiuser, repoid, key, label=<Optional:''>, description=<Optional:''>) |
|
9 | .. py:function:: add_field_to_repo(apiuser, repoid, key, label=<Optional:''>, description=<Optional:''>) | |
10 |
|
10 | |||
11 | Adds an extra field to a repository. |
|
11 | Adds an extra field to a repository. | |
12 |
|
12 | |||
13 | This command can only be run using an |authtoken| with at least |
|
13 | This command can only be run using an |authtoken| with at least | |
14 | write permissions to the |repo|. |
|
14 | write permissions to the |repo|. | |
15 |
|
15 | |||
16 | :param apiuser: This is filled automatically from the |authtoken|. |
|
16 | :param apiuser: This is filled automatically from the |authtoken|. | |
17 | :type apiuser: AuthUser |
|
17 | :type apiuser: AuthUser | |
18 | :param repoid: Set the repository name or repository id. |
|
18 | :param repoid: Set the repository name or repository id. | |
19 | :type repoid: str or int |
|
19 | :type repoid: str or int | |
20 | :param key: Create a unique field key for this repository. |
|
20 | :param key: Create a unique field key for this repository. | |
21 | :type key: str |
|
21 | :type key: str | |
22 | :param label: |
|
22 | :param label: | |
23 | :type label: Optional(str) |
|
23 | :type label: Optional(str) | |
24 | :param description: |
|
24 | :param description: | |
25 | :type description: Optional(str) |
|
25 | :type description: Optional(str) | |
26 |
|
26 | |||
27 |
|
27 | |||
28 | comment_commit |
|
28 | comment_commit | |
29 | -------------- |
|
29 | -------------- | |
30 |
|
30 | |||
31 |
.. py:function:: comment_commit(apiuser, repoid, commit_id, message, userid=<Optional:<OptionalAttr:apiuser> |
|
31 | .. py:function:: comment_commit(apiuser, repoid, commit_id, message, status=<Optional:None>, comment_type=<Optional:u'note'>, resolves_comment_id=<Optional:None>, userid=<Optional:<OptionalAttr:apiuser>>) | |
32 |
|
32 | |||
33 | Set a commit comment, and optionally change the status of the commit. |
|
33 | Set a commit comment, and optionally change the status of the commit. | |
34 |
|
34 | |||
35 | :param apiuser: This is filled automatically from the |authtoken|. |
|
35 | :param apiuser: This is filled automatically from the |authtoken|. | |
36 | :type apiuser: AuthUser |
|
36 | :type apiuser: AuthUser | |
37 | :param repoid: Set the repository name or repository ID. |
|
37 | :param repoid: Set the repository name or repository ID. | |
38 | :type repoid: str or int |
|
38 | :type repoid: str or int | |
39 | :param commit_id: Specify the commit_id for which to set a comment. |
|
39 | :param commit_id: Specify the commit_id for which to set a comment. | |
40 | :type commit_id: str |
|
40 | :type commit_id: str | |
41 | :param message: The comment text. |
|
41 | :param message: The comment text. | |
42 | :type message: str |
|
42 | :type message: str | |
|
43 | :param status: (**Optional**) status of commit, one of: 'not_reviewed', | |||
|
44 | 'approved', 'rejected', 'under_review' | |||
|
45 | :type status: str | |||
|
46 | :param comment_type: Comment type, one of: 'note', 'todo' | |||
|
47 | :type comment_type: Optional(str), default: 'note' | |||
43 | :param userid: Set the user name of the comment creator. |
|
48 | :param userid: Set the user name of the comment creator. | |
44 | :type userid: Optional(str or int) |
|
49 | :type userid: Optional(str or int) | |
45 | :param status: status, one of 'not_reviewed', 'approved', 'rejected', |
|
|||
46 | 'under_review' |
|
|||
47 | :type status: str |
|
|||
48 |
|
50 | |||
49 | Example error output: |
|
51 | Example error output: | |
50 |
|
52 | |||
51 |
.. code-block:: |
|
53 | .. code-block:: bash | |
52 |
|
54 | |||
53 | { |
|
55 | { | |
54 | "id" : <id_given_in_input>, |
|
56 | "id" : <id_given_in_input>, | |
55 | "result" : { |
|
57 | "result" : { | |
56 | "msg": "Commented on commit `<commit_id>` for repository `<repoid>`", |
|
58 | "msg": "Commented on commit `<commit_id>` for repository `<repoid>`", | |
57 | "status_change": null or <status>, |
|
59 | "status_change": null or <status>, | |
58 | "success": true |
|
60 | "success": true | |
59 | }, |
|
61 | }, | |
60 | "error" : null |
|
62 | "error" : null | |
61 | } |
|
63 | } | |
62 |
|
64 | |||
63 |
|
65 | |||
64 | create_repo |
|
66 | create_repo | |
65 | ----------- |
|
67 | ----------- | |
66 |
|
68 | |||
67 | .. py:function:: create_repo(apiuser, repo_name, repo_type, owner=<Optional:<OptionalAttr:apiuser>>, description=<Optional:''>, private=<Optional:False>, clone_uri=<Optional:None>, landing_rev=<Optional:'rev:tip'>, enable_statistics=<Optional:False>, enable_locking=<Optional:False>, enable_downloads=<Optional:False>, copy_permissions=<Optional:False>) |
|
69 | .. py:function:: create_repo(apiuser, repo_name, repo_type, owner=<Optional:<OptionalAttr:apiuser>>, description=<Optional:''>, private=<Optional:False>, clone_uri=<Optional:None>, landing_rev=<Optional:'rev:tip'>, enable_statistics=<Optional:False>, enable_locking=<Optional:False>, enable_downloads=<Optional:False>, copy_permissions=<Optional:False>) | |
68 |
|
70 | |||
69 | Creates a repository. |
|
71 | Creates a repository. | |
70 |
|
72 | |||
71 | * If the repository name contains "/", repository will be created inside |
|
73 | * If the repository name contains "/", repository will be created inside | |
72 | a repository group or nested repository groups |
|
74 | a repository group or nested repository groups | |
73 |
|
75 | |||
74 | For example "foo/bar/repo1" will create |repo| called "repo1" inside |
|
76 | For example "foo/bar/repo1" will create |repo| called "repo1" inside | |
75 | group "foo/bar". You have to have permissions to access and write to |
|
77 | group "foo/bar". You have to have permissions to access and write to | |
76 | the last repository group ("bar" in this example) |
|
78 | the last repository group ("bar" in this example) | |
77 |
|
79 | |||
78 | This command can only be run using an |authtoken| with at least |
|
80 | This command can only be run using an |authtoken| with at least | |
79 | permissions to create repositories, or write permissions to |
|
81 | permissions to create repositories, or write permissions to | |
80 | parent repository groups. |
|
82 | parent repository groups. | |
81 |
|
83 | |||
82 | :param apiuser: This is filled automatically from the |authtoken|. |
|
84 | :param apiuser: This is filled automatically from the |authtoken|. | |
83 | :type apiuser: AuthUser |
|
85 | :type apiuser: AuthUser | |
84 | :param repo_name: Set the repository name. |
|
86 | :param repo_name: Set the repository name. | |
85 | :type repo_name: str |
|
87 | :type repo_name: str | |
86 | :param repo_type: Set the repository type; 'hg','git', or 'svn'. |
|
88 | :param repo_type: Set the repository type; 'hg','git', or 'svn'. | |
87 | :type repo_type: str |
|
89 | :type repo_type: str | |
88 | :param owner: user_id or username |
|
90 | :param owner: user_id or username | |
89 | :type owner: Optional(str) |
|
91 | :type owner: Optional(str) | |
90 | :param description: Set the repository description. |
|
92 | :param description: Set the repository description. | |
91 | :type description: Optional(str) |
|
93 | :type description: Optional(str) | |
92 | :param private: set repository as private |
|
94 | :param private: set repository as private | |
93 | :type private: bool |
|
95 | :type private: bool | |
94 | :param clone_uri: set clone_uri |
|
96 | :param clone_uri: set clone_uri | |
95 | :type clone_uri: str |
|
97 | :type clone_uri: str | |
96 | :param landing_rev: <rev_type>:<rev> |
|
98 | :param landing_rev: <rev_type>:<rev> | |
97 | :type landing_rev: str |
|
99 | :type landing_rev: str | |
98 | :param enable_locking: |
|
100 | :param enable_locking: | |
99 | :type enable_locking: bool |
|
101 | :type enable_locking: bool | |
100 | :param enable_downloads: |
|
102 | :param enable_downloads: | |
101 | :type enable_downloads: bool |
|
103 | :type enable_downloads: bool | |
102 | :param enable_statistics: |
|
104 | :param enable_statistics: | |
103 | :type enable_statistics: bool |
|
105 | :type enable_statistics: bool | |
104 | :param copy_permissions: Copy permission from group in which the |
|
106 | :param copy_permissions: Copy permission from group in which the | |
105 | repository is being created. |
|
107 | repository is being created. | |
106 | :type copy_permissions: bool |
|
108 | :type copy_permissions: bool | |
107 |
|
109 | |||
108 |
|
110 | |||
109 | Example output: |
|
111 | Example output: | |
110 |
|
112 | |||
111 | .. code-block:: bash |
|
113 | .. code-block:: bash | |
112 |
|
114 | |||
113 | id : <id_given_in_input> |
|
115 | id : <id_given_in_input> | |
114 | result: { |
|
116 | result: { | |
115 | "msg": "Created new repository `<reponame>`", |
|
117 | "msg": "Created new repository `<reponame>`", | |
116 | "success": true, |
|
118 | "success": true, | |
117 | "task": "<celery task id or None if done sync>" |
|
119 | "task": "<celery task id or None if done sync>" | |
118 | } |
|
120 | } | |
119 | error: null |
|
121 | error: null | |
120 |
|
122 | |||
121 |
|
123 | |||
122 | Example error output: |
|
124 | Example error output: | |
123 |
|
125 | |||
124 | .. code-block:: bash |
|
126 | .. code-block:: bash | |
125 |
|
127 | |||
126 | id : <id_given_in_input> |
|
128 | id : <id_given_in_input> | |
127 | result : null |
|
129 | result : null | |
128 | error : { |
|
130 | error : { | |
129 | 'failed to create repository `<repo_name>`' |
|
131 | 'failed to create repository `<repo_name>`' | |
130 | } |
|
132 | } | |
131 |
|
133 | |||
132 |
|
134 | |||
133 | delete_repo |
|
135 | delete_repo | |
134 | ----------- |
|
136 | ----------- | |
135 |
|
137 | |||
136 | .. py:function:: delete_repo(apiuser, repoid, forks=<Optional:''>) |
|
138 | .. py:function:: delete_repo(apiuser, repoid, forks=<Optional:''>) | |
137 |
|
139 | |||
138 | Deletes a repository. |
|
140 | Deletes a repository. | |
139 |
|
141 | |||
140 | * When the `forks` parameter is set it's possible to detach or delete |
|
142 | * When the `forks` parameter is set it's possible to detach or delete | |
141 | forks of deleted repository. |
|
143 | forks of deleted repository. | |
142 |
|
144 | |||
143 | This command can only be run using an |authtoken| with admin |
|
145 | This command can only be run using an |authtoken| with admin | |
144 | permissions on the |repo|. |
|
146 | permissions on the |repo|. | |
145 |
|
147 | |||
146 | :param apiuser: This is filled automatically from the |authtoken|. |
|
148 | :param apiuser: This is filled automatically from the |authtoken|. | |
147 | :type apiuser: AuthUser |
|
149 | :type apiuser: AuthUser | |
148 | :param repoid: Set the repository name or repository ID. |
|
150 | :param repoid: Set the repository name or repository ID. | |
149 | :type repoid: str or int |
|
151 | :type repoid: str or int | |
150 | :param forks: Set to `detach` or `delete` forks from the |repo|. |
|
152 | :param forks: Set to `detach` or `delete` forks from the |repo|. | |
151 | :type forks: Optional(str) |
|
153 | :type forks: Optional(str) | |
152 |
|
154 | |||
153 | Example error output: |
|
155 | Example error output: | |
154 |
|
156 | |||
155 | .. code-block:: bash |
|
157 | .. code-block:: bash | |
156 |
|
158 | |||
157 | id : <id_given_in_input> |
|
159 | id : <id_given_in_input> | |
158 | result: { |
|
160 | result: { | |
159 | "msg": "Deleted repository `<reponame>`", |
|
161 | "msg": "Deleted repository `<reponame>`", | |
160 | "success": true |
|
162 | "success": true | |
161 | } |
|
163 | } | |
162 | error: null |
|
164 | error: null | |
163 |
|
165 | |||
164 |
|
166 | |||
165 | fork_repo |
|
167 | fork_repo | |
166 | --------- |
|
168 | --------- | |
167 |
|
169 | |||
168 | .. py:function:: fork_repo(apiuser, repoid, fork_name, owner=<Optional:<OptionalAttr:apiuser>>, description=<Optional:''>, private=<Optional:False>, clone_uri=<Optional:None>, landing_rev=<Optional:'rev:tip'>, copy_permissions=<Optional:False>) |
|
170 | .. py:function:: fork_repo(apiuser, repoid, fork_name, owner=<Optional:<OptionalAttr:apiuser>>, description=<Optional:''>, private=<Optional:False>, clone_uri=<Optional:None>, landing_rev=<Optional:'rev:tip'>, copy_permissions=<Optional:False>) | |
169 |
|
171 | |||
170 | Creates a fork of the specified |repo|. |
|
172 | Creates a fork of the specified |repo|. | |
171 |
|
173 | |||
172 | * If the fork_name contains "/", fork will be created inside |
|
174 | * If the fork_name contains "/", fork will be created inside | |
173 | a repository group or nested repository groups |
|
175 | a repository group or nested repository groups | |
174 |
|
176 | |||
175 | For example "foo/bar/fork-repo" will create fork called "fork-repo" |
|
177 | For example "foo/bar/fork-repo" will create fork called "fork-repo" | |
176 | inside group "foo/bar". You have to have permissions to access and |
|
178 | inside group "foo/bar". You have to have permissions to access and | |
177 | write to the last repository group ("bar" in this example) |
|
179 | write to the last repository group ("bar" in this example) | |
178 |
|
180 | |||
179 | This command can only be run using an |authtoken| with minimum |
|
181 | This command can only be run using an |authtoken| with minimum | |
180 | read permissions of the forked repo, create fork permissions for an user. |
|
182 | read permissions of the forked repo, create fork permissions for an user. | |
181 |
|
183 | |||
182 | :param apiuser: This is filled automatically from the |authtoken|. |
|
184 | :param apiuser: This is filled automatically from the |authtoken|. | |
183 | :type apiuser: AuthUser |
|
185 | :type apiuser: AuthUser | |
184 | :param repoid: Set repository name or repository ID. |
|
186 | :param repoid: Set repository name or repository ID. | |
185 | :type repoid: str or int |
|
187 | :type repoid: str or int | |
186 | :param fork_name: Set the fork name, including it's repository group membership. |
|
188 | :param fork_name: Set the fork name, including it's repository group membership. | |
187 | :type fork_name: str |
|
189 | :type fork_name: str | |
188 | :param owner: Set the fork owner. |
|
190 | :param owner: Set the fork owner. | |
189 | :type owner: str |
|
191 | :type owner: str | |
190 | :param description: Set the fork description. |
|
192 | :param description: Set the fork description. | |
191 | :type description: str |
|
193 | :type description: str | |
192 | :param copy_permissions: Copy permissions from parent |repo|. The |
|
194 | :param copy_permissions: Copy permissions from parent |repo|. The | |
193 | default is False. |
|
195 | default is False. | |
194 | :type copy_permissions: bool |
|
196 | :type copy_permissions: bool | |
195 | :param private: Make the fork private. The default is False. |
|
197 | :param private: Make the fork private. The default is False. | |
196 | :type private: bool |
|
198 | :type private: bool | |
197 | :param landing_rev: Set the landing revision. The default is tip. |
|
199 | :param landing_rev: Set the landing revision. The default is tip. | |
198 |
|
200 | |||
199 | Example output: |
|
201 | Example output: | |
200 |
|
202 | |||
201 | .. code-block:: bash |
|
203 | .. code-block:: bash | |
202 |
|
204 | |||
203 | id : <id_for_response> |
|
205 | id : <id_for_response> | |
204 | api_key : "<api_key>" |
|
206 | api_key : "<api_key>" | |
205 | args: { |
|
207 | args: { | |
206 | "repoid" : "<reponame or repo_id>", |
|
208 | "repoid" : "<reponame or repo_id>", | |
207 | "fork_name": "<forkname>", |
|
209 | "fork_name": "<forkname>", | |
208 | "owner": "<username or user_id = Optional(=apiuser)>", |
|
210 | "owner": "<username or user_id = Optional(=apiuser)>", | |
209 | "description": "<description>", |
|
211 | "description": "<description>", | |
210 | "copy_permissions": "<bool>", |
|
212 | "copy_permissions": "<bool>", | |
211 | "private": "<bool>", |
|
213 | "private": "<bool>", | |
212 | "landing_rev": "<landing_rev>" |
|
214 | "landing_rev": "<landing_rev>" | |
213 | } |
|
215 | } | |
214 |
|
216 | |||
215 | Example error output: |
|
217 | Example error output: | |
216 |
|
218 | |||
217 | .. code-block:: bash |
|
219 | .. code-block:: bash | |
218 |
|
220 | |||
219 | id : <id_given_in_input> |
|
221 | id : <id_given_in_input> | |
220 | result: { |
|
222 | result: { | |
221 | "msg": "Created fork of `<reponame>` as `<forkname>`", |
|
223 | "msg": "Created fork of `<reponame>` as `<forkname>`", | |
222 | "success": true, |
|
224 | "success": true, | |
223 | "task": "<celery task id or None if done sync>" |
|
225 | "task": "<celery task id or None if done sync>" | |
224 | } |
|
226 | } | |
225 | error: null |
|
227 | error: null | |
226 |
|
228 | |||
227 |
|
229 | |||
228 | get_repo |
|
230 | get_repo | |
229 | -------- |
|
231 | -------- | |
230 |
|
232 | |||
231 | .. py:function:: get_repo(apiuser, repoid, cache=<Optional:True>) |
|
233 | .. py:function:: get_repo(apiuser, repoid, cache=<Optional:True>) | |
232 |
|
234 | |||
233 | Gets an existing repository by its name or repository_id. |
|
235 | Gets an existing repository by its name or repository_id. | |
234 |
|
236 | |||
235 | The members section so the output returns users groups or users |
|
237 | The members section so the output returns users groups or users | |
236 | associated with that repository. |
|
238 | associated with that repository. | |
237 |
|
239 | |||
238 | This command can only be run using an |authtoken| with admin rights, |
|
240 | This command can only be run using an |authtoken| with admin rights, | |
239 | or users with at least read rights to the |repo|. |
|
241 | or users with at least read rights to the |repo|. | |
240 |
|
242 | |||
241 | :param apiuser: This is filled automatically from the |authtoken|. |
|
243 | :param apiuser: This is filled automatically from the |authtoken|. | |
242 | :type apiuser: AuthUser |
|
244 | :type apiuser: AuthUser | |
243 | :param repoid: The repository name or repository id. |
|
245 | :param repoid: The repository name or repository id. | |
244 | :type repoid: str or int |
|
246 | :type repoid: str or int | |
245 | :param cache: use the cached value for last changeset |
|
247 | :param cache: use the cached value for last changeset | |
246 | :type: cache: Optional(bool) |
|
248 | :type: cache: Optional(bool) | |
247 |
|
249 | |||
248 | Example output: |
|
250 | Example output: | |
249 |
|
251 | |||
250 | .. code-block:: bash |
|
252 | .. code-block:: bash | |
251 |
|
253 | |||
252 | { |
|
254 | { | |
253 | "error": null, |
|
255 | "error": null, | |
254 | "id": <repo_id>, |
|
256 | "id": <repo_id>, | |
255 | "result": { |
|
257 | "result": { | |
256 | "clone_uri": null, |
|
258 | "clone_uri": null, | |
257 | "created_on": "timestamp", |
|
259 | "created_on": "timestamp", | |
258 | "description": "repo description", |
|
260 | "description": "repo description", | |
259 | "enable_downloads": false, |
|
261 | "enable_downloads": false, | |
260 | "enable_locking": false, |
|
262 | "enable_locking": false, | |
261 | "enable_statistics": false, |
|
263 | "enable_statistics": false, | |
262 | "followers": [ |
|
264 | "followers": [ | |
263 | { |
|
265 | { | |
264 | "active": true, |
|
266 | "active": true, | |
265 | "admin": false, |
|
267 | "admin": false, | |
266 | "api_key": "****************************************", |
|
268 | "api_key": "****************************************", | |
267 | "api_keys": [ |
|
269 | "api_keys": [ | |
268 | "****************************************" |
|
270 | "****************************************" | |
269 | ], |
|
271 | ], | |
270 | "email": "user@example.com", |
|
272 | "email": "user@example.com", | |
271 | "emails": [ |
|
273 | "emails": [ | |
272 | "user@example.com" |
|
274 | "user@example.com" | |
273 | ], |
|
275 | ], | |
274 | "extern_name": "rhodecode", |
|
276 | "extern_name": "rhodecode", | |
275 | "extern_type": "rhodecode", |
|
277 | "extern_type": "rhodecode", | |
276 | "firstname": "username", |
|
278 | "firstname": "username", | |
277 | "ip_addresses": [], |
|
279 | "ip_addresses": [], | |
278 | "language": null, |
|
280 | "language": null, | |
279 | "last_login": "2015-09-16T17:16:35.854", |
|
281 | "last_login": "2015-09-16T17:16:35.854", | |
280 | "lastname": "surname", |
|
282 | "lastname": "surname", | |
281 | "user_id": <user_id>, |
|
283 | "user_id": <user_id>, | |
282 | "username": "name" |
|
284 | "username": "name" | |
283 | } |
|
285 | } | |
284 | ], |
|
286 | ], | |
285 | "fork_of": "parent-repo", |
|
287 | "fork_of": "parent-repo", | |
286 | "landing_rev": [ |
|
288 | "landing_rev": [ | |
287 | "rev", |
|
289 | "rev", | |
288 | "tip" |
|
290 | "tip" | |
289 | ], |
|
291 | ], | |
290 | "last_changeset": { |
|
292 | "last_changeset": { | |
291 | "author": "User <user@example.com>", |
|
293 | "author": "User <user@example.com>", | |
292 | "branch": "default", |
|
294 | "branch": "default", | |
293 | "date": "timestamp", |
|
295 | "date": "timestamp", | |
294 | "message": "last commit message", |
|
296 | "message": "last commit message", | |
295 | "parents": [ |
|
297 | "parents": [ | |
296 | { |
|
298 | { | |
297 | "raw_id": "commit-id" |
|
299 | "raw_id": "commit-id" | |
298 | } |
|
300 | } | |
299 | ], |
|
301 | ], | |
300 | "raw_id": "commit-id", |
|
302 | "raw_id": "commit-id", | |
301 | "revision": <revision number>, |
|
303 | "revision": <revision number>, | |
302 | "short_id": "short id" |
|
304 | "short_id": "short id" | |
303 | }, |
|
305 | }, | |
304 | "lock_reason": null, |
|
306 | "lock_reason": null, | |
305 | "locked_by": null, |
|
307 | "locked_by": null, | |
306 | "locked_date": null, |
|
308 | "locked_date": null, | |
307 | "members": [ |
|
309 | "members": [ | |
308 | { |
|
310 | { | |
309 | "name": "super-admin-name", |
|
311 | "name": "super-admin-name", | |
310 | "origin": "super-admin", |
|
312 | "origin": "super-admin", | |
311 | "permission": "repository.admin", |
|
313 | "permission": "repository.admin", | |
312 | "type": "user" |
|
314 | "type": "user" | |
313 | }, |
|
315 | }, | |
314 | { |
|
316 | { | |
315 | "name": "owner-name", |
|
317 | "name": "owner-name", | |
316 | "origin": "owner", |
|
318 | "origin": "owner", | |
317 | "permission": "repository.admin", |
|
319 | "permission": "repository.admin", | |
318 | "type": "user" |
|
320 | "type": "user" | |
319 | }, |
|
321 | }, | |
320 | { |
|
322 | { | |
321 | "name": "user-group-name", |
|
323 | "name": "user-group-name", | |
322 | "origin": "permission", |
|
324 | "origin": "permission", | |
323 | "permission": "repository.write", |
|
325 | "permission": "repository.write", | |
324 | "type": "user_group" |
|
326 | "type": "user_group" | |
325 | } |
|
327 | } | |
326 | ], |
|
328 | ], | |
327 | "owner": "owner-name", |
|
329 | "owner": "owner-name", | |
328 | "permissions": [ |
|
330 | "permissions": [ | |
329 | { |
|
331 | { | |
330 | "name": "super-admin-name", |
|
332 | "name": "super-admin-name", | |
331 | "origin": "super-admin", |
|
333 | "origin": "super-admin", | |
332 | "permission": "repository.admin", |
|
334 | "permission": "repository.admin", | |
333 | "type": "user" |
|
335 | "type": "user" | |
334 | }, |
|
336 | }, | |
335 | { |
|
337 | { | |
336 | "name": "owner-name", |
|
338 | "name": "owner-name", | |
337 | "origin": "owner", |
|
339 | "origin": "owner", | |
338 | "permission": "repository.admin", |
|
340 | "permission": "repository.admin", | |
339 | "type": "user" |
|
341 | "type": "user" | |
340 | }, |
|
342 | }, | |
341 | { |
|
343 | { | |
342 | "name": "user-group-name", |
|
344 | "name": "user-group-name", | |
343 | "origin": "permission", |
|
345 | "origin": "permission", | |
344 | "permission": "repository.write", |
|
346 | "permission": "repository.write", | |
345 | "type": "user_group" |
|
347 | "type": "user_group" | |
346 | } |
|
348 | } | |
347 | ], |
|
349 | ], | |
348 | "private": true, |
|
350 | "private": true, | |
349 | "repo_id": 676, |
|
351 | "repo_id": 676, | |
350 | "repo_name": "user-group/repo-name", |
|
352 | "repo_name": "user-group/repo-name", | |
351 | "repo_type": "hg" |
|
353 | "repo_type": "hg" | |
352 | } |
|
354 | } | |
353 | } |
|
355 | } | |
354 |
|
356 | |||
355 |
|
357 | |||
356 | get_repo_changeset |
|
358 | get_repo_changeset | |
357 | ------------------ |
|
359 | ------------------ | |
358 |
|
360 | |||
359 | .. py:function:: get_repo_changeset(apiuser, repoid, revision, details=<Optional:'basic'>) |
|
361 | .. py:function:: get_repo_changeset(apiuser, repoid, revision, details=<Optional:'basic'>) | |
360 |
|
362 | |||
361 | Returns information about a changeset. |
|
363 | Returns information about a changeset. | |
362 |
|
364 | |||
363 | Additionally parameters define the amount of details returned by |
|
365 | Additionally parameters define the amount of details returned by | |
364 | this function. |
|
366 | this function. | |
365 |
|
367 | |||
366 | This command can only be run using an |authtoken| with admin rights, |
|
368 | This command can only be run using an |authtoken| with admin rights, | |
367 | or users with at least read rights to the |repo|. |
|
369 | or users with at least read rights to the |repo|. | |
368 |
|
370 | |||
369 | :param apiuser: This is filled automatically from the |authtoken|. |
|
371 | :param apiuser: This is filled automatically from the |authtoken|. | |
370 | :type apiuser: AuthUser |
|
372 | :type apiuser: AuthUser | |
371 | :param repoid: The repository name or repository id |
|
373 | :param repoid: The repository name or repository id | |
372 | :type repoid: str or int |
|
374 | :type repoid: str or int | |
373 | :param revision: revision for which listing should be done |
|
375 | :param revision: revision for which listing should be done | |
374 | :type revision: str |
|
376 | :type revision: str | |
375 | :param details: details can be 'basic|extended|full' full gives diff |
|
377 | :param details: details can be 'basic|extended|full' full gives diff | |
376 | info details like the diff itself, and number of changed files etc. |
|
378 | info details like the diff itself, and number of changed files etc. | |
377 | :type details: Optional(str) |
|
379 | :type details: Optional(str) | |
378 |
|
380 | |||
379 |
|
381 | |||
380 | get_repo_changesets |
|
382 | get_repo_changesets | |
381 | ------------------- |
|
383 | ------------------- | |
382 |
|
384 | |||
383 | .. py:function:: get_repo_changesets(apiuser, repoid, start_rev, limit, details=<Optional:'basic'>) |
|
385 | .. py:function:: get_repo_changesets(apiuser, repoid, start_rev, limit, details=<Optional:'basic'>) | |
384 |
|
386 | |||
385 | Returns a set of commits limited by the number starting |
|
387 | Returns a set of commits limited by the number starting | |
386 | from the `start_rev` option. |
|
388 | from the `start_rev` option. | |
387 |
|
389 | |||
388 | Additional parameters define the amount of details returned by this |
|
390 | Additional parameters define the amount of details returned by this | |
389 | function. |
|
391 | function. | |
390 |
|
392 | |||
391 | This command can only be run using an |authtoken| with admin rights, |
|
393 | This command can only be run using an |authtoken| with admin rights, | |
392 | or users with at least read rights to |repos|. |
|
394 | or users with at least read rights to |repos|. | |
393 |
|
395 | |||
394 | :param apiuser: This is filled automatically from the |authtoken|. |
|
396 | :param apiuser: This is filled automatically from the |authtoken|. | |
395 | :type apiuser: AuthUser |
|
397 | :type apiuser: AuthUser | |
396 | :param repoid: The repository name or repository ID. |
|
398 | :param repoid: The repository name or repository ID. | |
397 | :type repoid: str or int |
|
399 | :type repoid: str or int | |
398 | :param start_rev: The starting revision from where to get changesets. |
|
400 | :param start_rev: The starting revision from where to get changesets. | |
399 | :type start_rev: str |
|
401 | :type start_rev: str | |
400 | :param limit: Limit the number of commits to this amount |
|
402 | :param limit: Limit the number of commits to this amount | |
401 | :type limit: str or int |
|
403 | :type limit: str or int | |
402 | :param details: Set the level of detail returned. Valid option are: |
|
404 | :param details: Set the level of detail returned. Valid option are: | |
403 | ``basic``, ``extended`` and ``full``. |
|
405 | ``basic``, ``extended`` and ``full``. | |
404 | :type details: Optional(str) |
|
406 | :type details: Optional(str) | |
405 |
|
407 | |||
406 | .. note:: |
|
408 | .. note:: | |
407 |
|
409 | |||
408 | Setting the parameter `details` to the value ``full`` is extensive |
|
410 | Setting the parameter `details` to the value ``full`` is extensive | |
409 | and returns details like the diff itself, and the number |
|
411 | and returns details like the diff itself, and the number | |
410 | of changed files. |
|
412 | of changed files. | |
411 |
|
413 | |||
412 |
|
414 | |||
413 | get_repo_nodes |
|
415 | get_repo_nodes | |
414 | -------------- |
|
416 | -------------- | |
415 |
|
417 | |||
416 | .. py:function:: get_repo_nodes(apiuser, repoid, revision, root_path, ret_type=<Optional:'all'>, details=<Optional:'basic'>, max_file_bytes=<Optional:None>) |
|
418 | .. py:function:: get_repo_nodes(apiuser, repoid, revision, root_path, ret_type=<Optional:'all'>, details=<Optional:'basic'>, max_file_bytes=<Optional:None>) | |
417 |
|
419 | |||
418 | Returns a list of nodes and children in a flat list for a given |
|
420 | Returns a list of nodes and children in a flat list for a given | |
419 | path at given revision. |
|
421 | path at given revision. | |
420 |
|
422 | |||
421 | It's possible to specify ret_type to show only `files` or `dirs`. |
|
423 | It's possible to specify ret_type to show only `files` or `dirs`. | |
422 |
|
424 | |||
423 | This command can only be run using an |authtoken| with admin rights, |
|
425 | This command can only be run using an |authtoken| with admin rights, | |
424 | or users with at least read rights to |repos|. |
|
426 | or users with at least read rights to |repos|. | |
425 |
|
427 | |||
426 | :param apiuser: This is filled automatically from the |authtoken|. |
|
428 | :param apiuser: This is filled automatically from the |authtoken|. | |
427 | :type apiuser: AuthUser |
|
429 | :type apiuser: AuthUser | |
428 | :param repoid: The repository name or repository ID. |
|
430 | :param repoid: The repository name or repository ID. | |
429 | :type repoid: str or int |
|
431 | :type repoid: str or int | |
430 | :param revision: The revision for which listing should be done. |
|
432 | :param revision: The revision for which listing should be done. | |
431 | :type revision: str |
|
433 | :type revision: str | |
432 | :param root_path: The path from which to start displaying. |
|
434 | :param root_path: The path from which to start displaying. | |
433 | :type root_path: str |
|
435 | :type root_path: str | |
434 | :param ret_type: Set the return type. Valid options are |
|
436 | :param ret_type: Set the return type. Valid options are | |
435 | ``all`` (default), ``files`` and ``dirs``. |
|
437 | ``all`` (default), ``files`` and ``dirs``. | |
436 | :type ret_type: Optional(str) |
|
438 | :type ret_type: Optional(str) | |
437 | :param details: Returns extended information about nodes, such as |
|
439 | :param details: Returns extended information about nodes, such as | |
438 | md5, binary, and or content. The valid options are ``basic`` and |
|
440 | md5, binary, and or content. The valid options are ``basic`` and | |
439 | ``full``. |
|
441 | ``full``. | |
440 | :type details: Optional(str) |
|
442 | :type details: Optional(str) | |
441 | :param max_file_bytes: Only return file content under this file size bytes |
|
443 | :param max_file_bytes: Only return file content under this file size bytes | |
442 | :type details: Optional(int) |
|
444 | :type details: Optional(int) | |
443 |
|
445 | |||
444 | Example output: |
|
446 | Example output: | |
445 |
|
447 | |||
446 | .. code-block:: bash |
|
448 | .. code-block:: bash | |
447 |
|
449 | |||
448 | id : <id_given_in_input> |
|
450 | id : <id_given_in_input> | |
449 | result: [ |
|
451 | result: [ | |
450 | { |
|
452 | { | |
451 | "name" : "<name>" |
|
453 | "name" : "<name>" | |
452 | "type" : "<type>", |
|
454 | "type" : "<type>", | |
453 | "binary": "<true|false>" (only in extended mode) |
|
455 | "binary": "<true|false>" (only in extended mode) | |
454 | "md5" : "<md5 of file content>" (only in extended mode) |
|
456 | "md5" : "<md5 of file content>" (only in extended mode) | |
455 | }, |
|
457 | }, | |
456 | ... |
|
458 | ... | |
457 | ] |
|
459 | ] | |
458 | error: null |
|
460 | error: null | |
459 |
|
461 | |||
460 |
|
462 | |||
461 | get_repo_refs |
|
463 | get_repo_refs | |
462 | ------------- |
|
464 | ------------- | |
463 |
|
465 | |||
464 | .. py:function:: get_repo_refs(apiuser, repoid) |
|
466 | .. py:function:: get_repo_refs(apiuser, repoid) | |
465 |
|
467 | |||
466 | Returns a dictionary of current references. It returns |
|
468 | Returns a dictionary of current references. It returns | |
467 | bookmarks, branches, closed_branches, and tags for given repository |
|
469 | bookmarks, branches, closed_branches, and tags for given repository | |
468 |
|
470 | |||
469 | It's possible to specify ret_type to show only `files` or `dirs`. |
|
471 | It's possible to specify ret_type to show only `files` or `dirs`. | |
470 |
|
472 | |||
471 | This command can only be run using an |authtoken| with admin rights, |
|
473 | This command can only be run using an |authtoken| with admin rights, | |
472 | or users with at least read rights to |repos|. |
|
474 | or users with at least read rights to |repos|. | |
473 |
|
475 | |||
474 | :param apiuser: This is filled automatically from the |authtoken|. |
|
476 | :param apiuser: This is filled automatically from the |authtoken|. | |
475 | :type apiuser: AuthUser |
|
477 | :type apiuser: AuthUser | |
476 | :param repoid: The repository name or repository ID. |
|
478 | :param repoid: The repository name or repository ID. | |
477 | :type repoid: str or int |
|
479 | :type repoid: str or int | |
478 |
|
480 | |||
479 | Example output: |
|
481 | Example output: | |
480 |
|
482 | |||
481 | .. code-block:: bash |
|
483 | .. code-block:: bash | |
482 |
|
484 | |||
483 | id : <id_given_in_input> |
|
485 | id : <id_given_in_input> | |
484 | "result": { |
|
486 | "result": { | |
485 | "bookmarks": { |
|
487 | "bookmarks": { | |
486 | "dev": "5611d30200f4040ba2ab4f3d64e5b06408a02188", |
|
488 | "dev": "5611d30200f4040ba2ab4f3d64e5b06408a02188", | |
487 | "master": "367f590445081d8ec8c2ea0456e73ae1f1c3d6cf" |
|
489 | "master": "367f590445081d8ec8c2ea0456e73ae1f1c3d6cf" | |
488 | }, |
|
490 | }, | |
489 | "branches": { |
|
491 | "branches": { | |
490 | "default": "5611d30200f4040ba2ab4f3d64e5b06408a02188", |
|
492 | "default": "5611d30200f4040ba2ab4f3d64e5b06408a02188", | |
491 | "stable": "367f590445081d8ec8c2ea0456e73ae1f1c3d6cf" |
|
493 | "stable": "367f590445081d8ec8c2ea0456e73ae1f1c3d6cf" | |
492 | }, |
|
494 | }, | |
493 | "branches_closed": {}, |
|
495 | "branches_closed": {}, | |
494 | "tags": { |
|
496 | "tags": { | |
495 | "tip": "5611d30200f4040ba2ab4f3d64e5b06408a02188", |
|
497 | "tip": "5611d30200f4040ba2ab4f3d64e5b06408a02188", | |
496 | "v4.4.0": "1232313f9e6adac5ce5399c2a891dc1e72b79022", |
|
498 | "v4.4.0": "1232313f9e6adac5ce5399c2a891dc1e72b79022", | |
497 | "v4.4.1": "cbb9f1d329ae5768379cdec55a62ebdd546c4e27", |
|
499 | "v4.4.1": "cbb9f1d329ae5768379cdec55a62ebdd546c4e27", | |
498 | "v4.4.2": "24ffe44a27fcd1c5b6936144e176b9f6dd2f3a17", |
|
500 | "v4.4.2": "24ffe44a27fcd1c5b6936144e176b9f6dd2f3a17", | |
499 | } |
|
501 | } | |
500 | } |
|
502 | } | |
501 | error: null |
|
503 | error: null | |
502 |
|
504 | |||
503 |
|
505 | |||
504 | get_repo_settings |
|
506 | get_repo_settings | |
505 | ----------------- |
|
507 | ----------------- | |
506 |
|
508 | |||
507 | .. py:function:: get_repo_settings(apiuser, repoid, key=<Optional:None>) |
|
509 | .. py:function:: get_repo_settings(apiuser, repoid, key=<Optional:None>) | |
508 |
|
510 | |||
509 | Returns all settings for a repository. If key is given it only returns the |
|
511 | Returns all settings for a repository. If key is given it only returns the | |
510 | setting identified by the key or null. |
|
512 | setting identified by the key or null. | |
511 |
|
513 | |||
512 | :param apiuser: This is filled automatically from the |authtoken|. |
|
514 | :param apiuser: This is filled automatically from the |authtoken|. | |
513 | :type apiuser: AuthUser |
|
515 | :type apiuser: AuthUser | |
514 | :param repoid: The repository name or repository id. |
|
516 | :param repoid: The repository name or repository id. | |
515 | :type repoid: str or int |
|
517 | :type repoid: str or int | |
516 | :param key: Key of the setting to return. |
|
518 | :param key: Key of the setting to return. | |
517 | :type: key: Optional(str) |
|
519 | :type: key: Optional(str) | |
518 |
|
520 | |||
519 | Example output: |
|
521 | Example output: | |
520 |
|
522 | |||
521 | .. code-block:: bash |
|
523 | .. code-block:: bash | |
522 |
|
524 | |||
523 | { |
|
525 | { | |
524 | "error": null, |
|
526 | "error": null, | |
525 | "id": 237, |
|
527 | "id": 237, | |
526 | "result": { |
|
528 | "result": { | |
527 | "extensions_largefiles": true, |
|
529 | "extensions_largefiles": true, | |
528 | "hooks_changegroup_push_logger": true, |
|
530 | "hooks_changegroup_push_logger": true, | |
529 | "hooks_changegroup_repo_size": false, |
|
531 | "hooks_changegroup_repo_size": false, | |
530 | "hooks_outgoing_pull_logger": true, |
|
532 | "hooks_outgoing_pull_logger": true, | |
531 | "phases_publish": "True", |
|
533 | "phases_publish": "True", | |
532 | "rhodecode_hg_use_rebase_for_merging": true, |
|
534 | "rhodecode_hg_use_rebase_for_merging": true, | |
533 | "rhodecode_pr_merge_enabled": true, |
|
535 | "rhodecode_pr_merge_enabled": true, | |
534 | "rhodecode_use_outdated_comments": true |
|
536 | "rhodecode_use_outdated_comments": true | |
535 | } |
|
537 | } | |
536 | } |
|
538 | } | |
537 |
|
539 | |||
538 |
|
540 | |||
539 | get_repos |
|
541 | get_repos | |
540 | --------- |
|
542 | --------- | |
541 |
|
543 | |||
542 | .. py:function:: get_repos(apiuser) |
|
544 | .. py:function:: get_repos(apiuser, root=<Optional:None>, traverse=<Optional:True>) | |
543 |
|
545 | |||
544 | Lists all existing repositories. |
|
546 | Lists all existing repositories. | |
545 |
|
547 | |||
546 | This command can only be run using an |authtoken| with admin rights, |
|
548 | This command can only be run using an |authtoken| with admin rights, | |
547 | or users with at least read rights to |repos|. |
|
549 | or users with at least read rights to |repos|. | |
548 |
|
550 | |||
549 | :param apiuser: This is filled automatically from the |authtoken|. |
|
551 | :param apiuser: This is filled automatically from the |authtoken|. | |
550 | :type apiuser: AuthUser |
|
552 | :type apiuser: AuthUser | |
|
553 | :param root: specify root repository group to fetch repositories. | |||
|
554 | filters the returned repositories to be members of given root group. | |||
|
555 | :type root: Optional(None) | |||
|
556 | :param traverse: traverse given root into subrepositories. With this flag | |||
|
557 | set to False, it will only return top-level repositories from `root`. | |||
|
558 | if root is empty it will return just top-level repositories. | |||
|
559 | :type traverse: Optional(True) | |||
|
560 | ||||
551 |
|
561 | |||
552 | Example output: |
|
562 | Example output: | |
553 |
|
563 | |||
554 | .. code-block:: bash |
|
564 | .. code-block:: bash | |
555 |
|
565 | |||
556 | id : <id_given_in_input> |
|
566 | id : <id_given_in_input> | |
557 | result: [ |
|
567 | result: [ | |
558 | { |
|
568 | { | |
559 | "repo_id" : "<repo_id>", |
|
569 | "repo_id" : "<repo_id>", | |
560 | "repo_name" : "<reponame>" |
|
570 | "repo_name" : "<reponame>" | |
561 | "repo_type" : "<repo_type>", |
|
571 | "repo_type" : "<repo_type>", | |
562 | "clone_uri" : "<clone_uri>", |
|
572 | "clone_uri" : "<clone_uri>", | |
563 | "private": : "<bool>", |
|
573 | "private": : "<bool>", | |
564 | "created_on" : "<datetimecreated>", |
|
574 | "created_on" : "<datetimecreated>", | |
565 | "description" : "<description>", |
|
575 | "description" : "<description>", | |
566 | "landing_rev": "<landing_rev>", |
|
576 | "landing_rev": "<landing_rev>", | |
567 | "owner": "<repo_owner>", |
|
577 | "owner": "<repo_owner>", | |
568 | "fork_of": "<name_of_fork_parent>", |
|
578 | "fork_of": "<name_of_fork_parent>", | |
569 | "enable_downloads": "<bool>", |
|
579 | "enable_downloads": "<bool>", | |
570 | "enable_locking": "<bool>", |
|
580 | "enable_locking": "<bool>", | |
571 | "enable_statistics": "<bool>", |
|
581 | "enable_statistics": "<bool>", | |
572 | }, |
|
582 | }, | |
573 | ... |
|
583 | ... | |
574 | ] |
|
584 | ] | |
575 | error: null |
|
585 | error: null | |
576 |
|
586 | |||
577 |
|
587 | |||
578 | grant_user_group_permission |
|
588 | grant_user_group_permission | |
579 | --------------------------- |
|
589 | --------------------------- | |
580 |
|
590 | |||
581 | .. py:function:: grant_user_group_permission(apiuser, repoid, usergroupid, perm) |
|
591 | .. py:function:: grant_user_group_permission(apiuser, repoid, usergroupid, perm) | |
582 |
|
592 | |||
583 | Grant permission for a user group on the specified repository, |
|
593 | Grant permission for a user group on the specified repository, | |
584 | or update existing permissions. |
|
594 | or update existing permissions. | |
585 |
|
595 | |||
586 | This command can only be run using an |authtoken| with admin |
|
596 | This command can only be run using an |authtoken| with admin | |
587 | permissions on the |repo|. |
|
597 | permissions on the |repo|. | |
588 |
|
598 | |||
589 | :param apiuser: This is filled automatically from the |authtoken|. |
|
599 | :param apiuser: This is filled automatically from the |authtoken|. | |
590 | :type apiuser: AuthUser |
|
600 | :type apiuser: AuthUser | |
591 | :param repoid: Set the repository name or repository ID. |
|
601 | :param repoid: Set the repository name or repository ID. | |
592 | :type repoid: str or int |
|
602 | :type repoid: str or int | |
593 | :param usergroupid: Specify the ID of the user group. |
|
603 | :param usergroupid: Specify the ID of the user group. | |
594 | :type usergroupid: str or int |
|
604 | :type usergroupid: str or int | |
595 | :param perm: Set the user group permissions using the following |
|
605 | :param perm: Set the user group permissions using the following | |
596 | format: (repository.(none|read|write|admin)) |
|
606 | format: (repository.(none|read|write|admin)) | |
597 | :type perm: str |
|
607 | :type perm: str | |
598 |
|
608 | |||
599 | Example output: |
|
609 | Example output: | |
600 |
|
610 | |||
601 | .. code-block:: bash |
|
611 | .. code-block:: bash | |
602 |
|
612 | |||
603 | id : <id_given_in_input> |
|
613 | id : <id_given_in_input> | |
604 | result : { |
|
614 | result : { | |
605 | "msg" : "Granted perm: `<perm>` for group: `<usersgroupname>` in repo: `<reponame>`", |
|
615 | "msg" : "Granted perm: `<perm>` for group: `<usersgroupname>` in repo: `<reponame>`", | |
606 | "success": true |
|
616 | "success": true | |
607 |
|
617 | |||
608 | } |
|
618 | } | |
609 | error : null |
|
619 | error : null | |
610 |
|
620 | |||
611 | Example error output: |
|
621 | Example error output: | |
612 |
|
622 | |||
613 | .. code-block:: bash |
|
623 | .. code-block:: bash | |
614 |
|
624 | |||
615 | id : <id_given_in_input> |
|
625 | id : <id_given_in_input> | |
616 | result : null |
|
626 | result : null | |
617 | error : { |
|
627 | error : { | |
618 | "failed to edit permission for user group: `<usergroup>` in repo `<repo>`' |
|
628 | "failed to edit permission for user group: `<usergroup>` in repo `<repo>`' | |
619 | } |
|
629 | } | |
620 |
|
630 | |||
621 |
|
631 | |||
622 | grant_user_permission |
|
632 | grant_user_permission | |
623 | --------------------- |
|
633 | --------------------- | |
624 |
|
634 | |||
625 | .. py:function:: grant_user_permission(apiuser, repoid, userid, perm) |
|
635 | .. py:function:: grant_user_permission(apiuser, repoid, userid, perm) | |
626 |
|
636 | |||
627 | Grant permissions for the specified user on the given repository, |
|
637 | Grant permissions for the specified user on the given repository, | |
628 | or update existing permissions if found. |
|
638 | or update existing permissions if found. | |
629 |
|
639 | |||
630 | This command can only be run using an |authtoken| with admin |
|
640 | This command can only be run using an |authtoken| with admin | |
631 | permissions on the |repo|. |
|
641 | permissions on the |repo|. | |
632 |
|
642 | |||
633 | :param apiuser: This is filled automatically from the |authtoken|. |
|
643 | :param apiuser: This is filled automatically from the |authtoken|. | |
634 | :type apiuser: AuthUser |
|
644 | :type apiuser: AuthUser | |
635 | :param repoid: Set the repository name or repository ID. |
|
645 | :param repoid: Set the repository name or repository ID. | |
636 | :type repoid: str or int |
|
646 | :type repoid: str or int | |
637 | :param userid: Set the user name. |
|
647 | :param userid: Set the user name. | |
638 | :type userid: str |
|
648 | :type userid: str | |
639 | :param perm: Set the user permissions, using the following format |
|
649 | :param perm: Set the user permissions, using the following format | |
640 | ``(repository.(none|read|write|admin))`` |
|
650 | ``(repository.(none|read|write|admin))`` | |
641 | :type perm: str |
|
651 | :type perm: str | |
642 |
|
652 | |||
643 | Example output: |
|
653 | Example output: | |
644 |
|
654 | |||
645 | .. code-block:: bash |
|
655 | .. code-block:: bash | |
646 |
|
656 | |||
647 | id : <id_given_in_input> |
|
657 | id : <id_given_in_input> | |
648 | result: { |
|
658 | result: { | |
649 | "msg" : "Granted perm: `<perm>` for user: `<username>` in repo: `<reponame>`", |
|
659 | "msg" : "Granted perm: `<perm>` for user: `<username>` in repo: `<reponame>`", | |
650 | "success": true |
|
660 | "success": true | |
651 | } |
|
661 | } | |
652 | error: null |
|
662 | error: null | |
653 |
|
663 | |||
654 |
|
664 | |||
655 | invalidate_cache |
|
665 | invalidate_cache | |
656 | ---------------- |
|
666 | ---------------- | |
657 |
|
667 | |||
658 | .. py:function:: invalidate_cache(apiuser, repoid, delete_keys=<Optional:False>) |
|
668 | .. py:function:: invalidate_cache(apiuser, repoid, delete_keys=<Optional:False>) | |
659 |
|
669 | |||
660 | Invalidates the cache for the specified repository. |
|
670 | Invalidates the cache for the specified repository. | |
661 |
|
671 | |||
662 | This command can only be run using an |authtoken| with admin rights to |
|
672 | This command can only be run using an |authtoken| with admin rights to | |
663 | the specified repository. |
|
673 | the specified repository. | |
664 |
|
674 | |||
665 | This command takes the following options: |
|
675 | This command takes the following options: | |
666 |
|
676 | |||
667 | :param apiuser: This is filled automatically from |authtoken|. |
|
677 | :param apiuser: This is filled automatically from |authtoken|. | |
668 | :type apiuser: AuthUser |
|
678 | :type apiuser: AuthUser | |
669 | :param repoid: Sets the repository name or repository ID. |
|
679 | :param repoid: Sets the repository name or repository ID. | |
670 | :type repoid: str or int |
|
680 | :type repoid: str or int | |
671 | :param delete_keys: This deletes the invalidated keys instead of |
|
681 | :param delete_keys: This deletes the invalidated keys instead of | |
672 | just flagging them. |
|
682 | just flagging them. | |
673 | :type delete_keys: Optional(``True`` | ``False``) |
|
683 | :type delete_keys: Optional(``True`` | ``False``) | |
674 |
|
684 | |||
675 | Example output: |
|
685 | Example output: | |
676 |
|
686 | |||
677 | .. code-block:: bash |
|
687 | .. code-block:: bash | |
678 |
|
688 | |||
679 | id : <id_given_in_input> |
|
689 | id : <id_given_in_input> | |
680 | result : { |
|
690 | result : { | |
681 | 'msg': Cache for repository `<repository name>` was invalidated, |
|
691 | 'msg': Cache for repository `<repository name>` was invalidated, | |
682 | 'repository': <repository name> |
|
692 | 'repository': <repository name> | |
683 | } |
|
693 | } | |
684 | error : null |
|
694 | error : null | |
685 |
|
695 | |||
686 | Example error output: |
|
696 | Example error output: | |
687 |
|
697 | |||
688 | .. code-block:: bash |
|
698 | .. code-block:: bash | |
689 |
|
699 | |||
690 | id : <id_given_in_input> |
|
700 | id : <id_given_in_input> | |
691 | result : null |
|
701 | result : null | |
692 | error : { |
|
702 | error : { | |
693 | 'Error occurred during cache invalidation action' |
|
703 | 'Error occurred during cache invalidation action' | |
694 | } |
|
704 | } | |
695 |
|
705 | |||
696 |
|
706 | |||
697 | lock |
|
707 | lock | |
698 | ---- |
|
708 | ---- | |
699 |
|
709 | |||
700 | .. py:function:: lock(apiuser, repoid, locked=<Optional:None>, userid=<Optional:<OptionalAttr:apiuser>>) |
|
710 | .. py:function:: lock(apiuser, repoid, locked=<Optional:None>, userid=<Optional:<OptionalAttr:apiuser>>) | |
701 |
|
711 | |||
702 | Sets the lock state of the specified |repo| by the given user. |
|
712 | Sets the lock state of the specified |repo| by the given user. | |
703 | From more information, see :ref:`repo-locking`. |
|
713 | From more information, see :ref:`repo-locking`. | |
704 |
|
714 | |||
705 | * If the ``userid`` option is not set, the repository is locked to the |
|
715 | * If the ``userid`` option is not set, the repository is locked to the | |
706 | user who called the method. |
|
716 | user who called the method. | |
707 | * If the ``locked`` parameter is not set, the current lock state of the |
|
717 | * If the ``locked`` parameter is not set, the current lock state of the | |
708 | repository is displayed. |
|
718 | repository is displayed. | |
709 |
|
719 | |||
710 | This command can only be run using an |authtoken| with admin rights to |
|
720 | This command can only be run using an |authtoken| with admin rights to | |
711 | the specified repository. |
|
721 | the specified repository. | |
712 |
|
722 | |||
713 | This command takes the following options: |
|
723 | This command takes the following options: | |
714 |
|
724 | |||
715 | :param apiuser: This is filled automatically from the |authtoken|. |
|
725 | :param apiuser: This is filled automatically from the |authtoken|. | |
716 | :type apiuser: AuthUser |
|
726 | :type apiuser: AuthUser | |
717 | :param repoid: Sets the repository name or repository ID. |
|
727 | :param repoid: Sets the repository name or repository ID. | |
718 | :type repoid: str or int |
|
728 | :type repoid: str or int | |
719 | :param locked: Sets the lock state. |
|
729 | :param locked: Sets the lock state. | |
720 | :type locked: Optional(``True`` | ``False``) |
|
730 | :type locked: Optional(``True`` | ``False``) | |
721 | :param userid: Set the repository lock to this user. |
|
731 | :param userid: Set the repository lock to this user. | |
722 | :type userid: Optional(str or int) |
|
732 | :type userid: Optional(str or int) | |
723 |
|
733 | |||
724 | Example error output: |
|
734 | Example error output: | |
725 |
|
735 | |||
726 | .. code-block:: bash |
|
736 | .. code-block:: bash | |
727 |
|
737 | |||
728 | id : <id_given_in_input> |
|
738 | id : <id_given_in_input> | |
729 | result : { |
|
739 | result : { | |
730 | 'repo': '<reponame>', |
|
740 | 'repo': '<reponame>', | |
731 | 'locked': <bool: lock state>, |
|
741 | 'locked': <bool: lock state>, | |
732 | 'locked_since': <int: lock timestamp>, |
|
742 | 'locked_since': <int: lock timestamp>, | |
733 | 'locked_by': <username of person who made the lock>, |
|
743 | 'locked_by': <username of person who made the lock>, | |
734 | 'lock_reason': <str: reason for locking>, |
|
744 | 'lock_reason': <str: reason for locking>, | |
735 | 'lock_state_changed': <bool: True if lock state has been changed in this request>, |
|
745 | 'lock_state_changed': <bool: True if lock state has been changed in this request>, | |
736 | 'msg': 'Repo `<reponame>` locked by `<username>` on <timestamp>.' |
|
746 | 'msg': 'Repo `<reponame>` locked by `<username>` on <timestamp>.' | |
737 | or |
|
747 | or | |
738 | 'msg': 'Repo `<repository name>` not locked.' |
|
748 | 'msg': 'Repo `<repository name>` not locked.' | |
739 | or |
|
749 | or | |
740 | 'msg': 'User `<user name>` set lock state for repo `<repository name>` to `<new lock state>`' |
|
750 | 'msg': 'User `<user name>` set lock state for repo `<repository name>` to `<new lock state>`' | |
741 | } |
|
751 | } | |
742 | error : null |
|
752 | error : null | |
743 |
|
753 | |||
744 | Example error output: |
|
754 | Example error output: | |
745 |
|
755 | |||
746 | .. code-block:: bash |
|
756 | .. code-block:: bash | |
747 |
|
757 | |||
748 | id : <id_given_in_input> |
|
758 | id : <id_given_in_input> | |
749 | result : null |
|
759 | result : null | |
750 | error : { |
|
760 | error : { | |
751 | 'Error occurred locking repository `<reponame>`' |
|
761 | 'Error occurred locking repository `<reponame>`' | |
752 | } |
|
762 | } | |
753 |
|
763 | |||
754 |
|
764 | |||
755 | pull |
|
765 | pull | |
756 | ---- |
|
766 | ---- | |
757 |
|
767 | |||
758 | .. py:function:: pull(apiuser, repoid) |
|
768 | .. py:function:: pull(apiuser, repoid) | |
759 |
|
769 | |||
760 | Triggers a pull on the given repository from a remote location. You |
|
770 | Triggers a pull on the given repository from a remote location. You | |
761 | can use this to keep remote repositories up-to-date. |
|
771 | can use this to keep remote repositories up-to-date. | |
762 |
|
772 | |||
763 | This command can only be run using an |authtoken| with admin |
|
773 | This command can only be run using an |authtoken| with admin | |
764 | rights to the specified repository. For more information, |
|
774 | rights to the specified repository. For more information, | |
765 | see :ref:`config-token-ref`. |
|
775 | see :ref:`config-token-ref`. | |
766 |
|
776 | |||
767 | This command takes the following options: |
|
777 | This command takes the following options: | |
768 |
|
778 | |||
769 | :param apiuser: This is filled automatically from the |authtoken|. |
|
779 | :param apiuser: This is filled automatically from the |authtoken|. | |
770 | :type apiuser: AuthUser |
|
780 | :type apiuser: AuthUser | |
771 | :param repoid: The repository name or repository ID. |
|
781 | :param repoid: The repository name or repository ID. | |
772 | :type repoid: str or int |
|
782 | :type repoid: str or int | |
773 |
|
783 | |||
774 | Example output: |
|
784 | Example output: | |
775 |
|
785 | |||
776 | .. code-block:: bash |
|
786 | .. code-block:: bash | |
777 |
|
787 | |||
778 | id : <id_given_in_input> |
|
788 | id : <id_given_in_input> | |
779 | result : { |
|
789 | result : { | |
780 | "msg": "Pulled from `<repository name>`" |
|
790 | "msg": "Pulled from `<repository name>`" | |
781 | "repository": "<repository name>" |
|
791 | "repository": "<repository name>" | |
782 | } |
|
792 | } | |
783 | error : null |
|
793 | error : null | |
784 |
|
794 | |||
785 | Example error output: |
|
795 | Example error output: | |
786 |
|
796 | |||
787 | .. code-block:: bash |
|
797 | .. code-block:: bash | |
788 |
|
798 | |||
789 | id : <id_given_in_input> |
|
799 | id : <id_given_in_input> | |
790 | result : null |
|
800 | result : null | |
791 | error : { |
|
801 | error : { | |
792 | "Unable to pull changes from `<reponame>`" |
|
802 | "Unable to pull changes from `<reponame>`" | |
793 | } |
|
803 | } | |
794 |
|
804 | |||
795 |
|
805 | |||
796 | remove_field_from_repo |
|
806 | remove_field_from_repo | |
797 | ---------------------- |
|
807 | ---------------------- | |
798 |
|
808 | |||
799 | .. py:function:: remove_field_from_repo(apiuser, repoid, key) |
|
809 | .. py:function:: remove_field_from_repo(apiuser, repoid, key) | |
800 |
|
810 | |||
801 | Removes an extra field from a repository. |
|
811 | Removes an extra field from a repository. | |
802 |
|
812 | |||
803 | This command can only be run using an |authtoken| with at least |
|
813 | This command can only be run using an |authtoken| with at least | |
804 | write permissions to the |repo|. |
|
814 | write permissions to the |repo|. | |
805 |
|
815 | |||
806 | :param apiuser: This is filled automatically from the |authtoken|. |
|
816 | :param apiuser: This is filled automatically from the |authtoken|. | |
807 | :type apiuser: AuthUser |
|
817 | :type apiuser: AuthUser | |
808 | :param repoid: Set the repository name or repository ID. |
|
818 | :param repoid: Set the repository name or repository ID. | |
809 | :type repoid: str or int |
|
819 | :type repoid: str or int | |
810 | :param key: Set the unique field key for this repository. |
|
820 | :param key: Set the unique field key for this repository. | |
811 | :type key: str |
|
821 | :type key: str | |
812 |
|
822 | |||
813 |
|
823 | |||
814 | revoke_user_group_permission |
|
824 | revoke_user_group_permission | |
815 | ---------------------------- |
|
825 | ---------------------------- | |
816 |
|
826 | |||
817 | .. py:function:: revoke_user_group_permission(apiuser, repoid, usergroupid) |
|
827 | .. py:function:: revoke_user_group_permission(apiuser, repoid, usergroupid) | |
818 |
|
828 | |||
819 | Revoke the permissions of a user group on a given repository. |
|
829 | Revoke the permissions of a user group on a given repository. | |
820 |
|
830 | |||
821 | This command can only be run using an |authtoken| with admin |
|
831 | This command can only be run using an |authtoken| with admin | |
822 | permissions on the |repo|. |
|
832 | permissions on the |repo|. | |
823 |
|
833 | |||
824 | :param apiuser: This is filled automatically from the |authtoken|. |
|
834 | :param apiuser: This is filled automatically from the |authtoken|. | |
825 | :type apiuser: AuthUser |
|
835 | :type apiuser: AuthUser | |
826 | :param repoid: Set the repository name or repository ID. |
|
836 | :param repoid: Set the repository name or repository ID. | |
827 | :type repoid: str or int |
|
837 | :type repoid: str or int | |
828 | :param usergroupid: Specify the user group ID. |
|
838 | :param usergroupid: Specify the user group ID. | |
829 | :type usergroupid: str or int |
|
839 | :type usergroupid: str or int | |
830 |
|
840 | |||
831 | Example output: |
|
841 | Example output: | |
832 |
|
842 | |||
833 | .. code-block:: bash |
|
843 | .. code-block:: bash | |
834 |
|
844 | |||
835 | id : <id_given_in_input> |
|
845 | id : <id_given_in_input> | |
836 | result: { |
|
846 | result: { | |
837 | "msg" : "Revoked perm for group: `<usersgroupname>` in repo: `<reponame>`", |
|
847 | "msg" : "Revoked perm for group: `<usersgroupname>` in repo: `<reponame>`", | |
838 | "success": true |
|
848 | "success": true | |
839 | } |
|
849 | } | |
840 | error: null |
|
850 | error: null | |
841 |
|
851 | |||
842 |
|
852 | |||
843 | revoke_user_permission |
|
853 | revoke_user_permission | |
844 | ---------------------- |
|
854 | ---------------------- | |
845 |
|
855 | |||
846 | .. py:function:: revoke_user_permission(apiuser, repoid, userid) |
|
856 | .. py:function:: revoke_user_permission(apiuser, repoid, userid) | |
847 |
|
857 | |||
848 | Revoke permission for a user on the specified repository. |
|
858 | Revoke permission for a user on the specified repository. | |
849 |
|
859 | |||
850 | This command can only be run using an |authtoken| with admin |
|
860 | This command can only be run using an |authtoken| with admin | |
851 | permissions on the |repo|. |
|
861 | permissions on the |repo|. | |
852 |
|
862 | |||
853 | :param apiuser: This is filled automatically from the |authtoken|. |
|
863 | :param apiuser: This is filled automatically from the |authtoken|. | |
854 | :type apiuser: AuthUser |
|
864 | :type apiuser: AuthUser | |
855 | :param repoid: Set the repository name or repository ID. |
|
865 | :param repoid: Set the repository name or repository ID. | |
856 | :type repoid: str or int |
|
866 | :type repoid: str or int | |
857 | :param userid: Set the user name of revoked user. |
|
867 | :param userid: Set the user name of revoked user. | |
858 | :type userid: str or int |
|
868 | :type userid: str or int | |
859 |
|
869 | |||
860 | Example error output: |
|
870 | Example error output: | |
861 |
|
871 | |||
862 | .. code-block:: bash |
|
872 | .. code-block:: bash | |
863 |
|
873 | |||
864 | id : <id_given_in_input> |
|
874 | id : <id_given_in_input> | |
865 | result: { |
|
875 | result: { | |
866 | "msg" : "Revoked perm for user: `<username>` in repo: `<reponame>`", |
|
876 | "msg" : "Revoked perm for user: `<username>` in repo: `<reponame>`", | |
867 | "success": true |
|
877 | "success": true | |
868 | } |
|
878 | } | |
869 | error: null |
|
879 | error: null | |
870 |
|
880 | |||
871 |
|
881 | |||
872 | set_repo_settings |
|
882 | set_repo_settings | |
873 | ----------------- |
|
883 | ----------------- | |
874 |
|
884 | |||
875 | .. py:function:: set_repo_settings(apiuser, repoid, settings) |
|
885 | .. py:function:: set_repo_settings(apiuser, repoid, settings) | |
876 |
|
886 | |||
877 | Update repository settings. Returns true on success. |
|
887 | Update repository settings. Returns true on success. | |
878 |
|
888 | |||
879 | :param apiuser: This is filled automatically from the |authtoken|. |
|
889 | :param apiuser: This is filled automatically from the |authtoken|. | |
880 | :type apiuser: AuthUser |
|
890 | :type apiuser: AuthUser | |
881 | :param repoid: The repository name or repository id. |
|
891 | :param repoid: The repository name or repository id. | |
882 | :type repoid: str or int |
|
892 | :type repoid: str or int | |
883 | :param settings: The new settings for the repository. |
|
893 | :param settings: The new settings for the repository. | |
884 | :type: settings: dict |
|
894 | :type: settings: dict | |
885 |
|
895 | |||
886 | Example output: |
|
896 | Example output: | |
887 |
|
897 | |||
888 | .. code-block:: bash |
|
898 | .. code-block:: bash | |
889 |
|
899 | |||
890 | { |
|
900 | { | |
891 | "error": null, |
|
901 | "error": null, | |
892 | "id": 237, |
|
902 | "id": 237, | |
893 | "result": true |
|
903 | "result": true | |
894 | } |
|
904 | } | |
895 |
|
905 | |||
896 |
|
906 | |||
897 | strip |
|
907 | strip | |
898 | ----- |
|
908 | ----- | |
899 |
|
909 | |||
900 | .. py:function:: strip(apiuser, repoid, revision, branch) |
|
910 | .. py:function:: strip(apiuser, repoid, revision, branch) | |
901 |
|
911 | |||
902 | Strips the given revision from the specified repository. |
|
912 | Strips the given revision from the specified repository. | |
903 |
|
913 | |||
904 | * This will remove the revision and all of its decendants. |
|
914 | * This will remove the revision and all of its decendants. | |
905 |
|
915 | |||
906 | This command can only be run using an |authtoken| with admin rights to |
|
916 | This command can only be run using an |authtoken| with admin rights to | |
907 | the specified repository. |
|
917 | the specified repository. | |
908 |
|
918 | |||
909 | This command takes the following options: |
|
919 | This command takes the following options: | |
910 |
|
920 | |||
911 | :param apiuser: This is filled automatically from the |authtoken|. |
|
921 | :param apiuser: This is filled automatically from the |authtoken|. | |
912 | :type apiuser: AuthUser |
|
922 | :type apiuser: AuthUser | |
913 | :param repoid: The repository name or repository ID. |
|
923 | :param repoid: The repository name or repository ID. | |
914 | :type repoid: str or int |
|
924 | :type repoid: str or int | |
915 | :param revision: The revision you wish to strip. |
|
925 | :param revision: The revision you wish to strip. | |
916 | :type revision: str |
|
926 | :type revision: str | |
917 | :param branch: The branch from which to strip the revision. |
|
927 | :param branch: The branch from which to strip the revision. | |
918 | :type branch: str |
|
928 | :type branch: str | |
919 |
|
929 | |||
920 | Example output: |
|
930 | Example output: | |
921 |
|
931 | |||
922 | .. code-block:: bash |
|
932 | .. code-block:: bash | |
923 |
|
933 | |||
924 | id : <id_given_in_input> |
|
934 | id : <id_given_in_input> | |
925 | result : { |
|
935 | result : { | |
926 | "msg": "'Stripped commit <commit_hash> from repo `<repository name>`'" |
|
936 | "msg": "'Stripped commit <commit_hash> from repo `<repository name>`'" | |
927 | "repository": "<repository name>" |
|
937 | "repository": "<repository name>" | |
928 | } |
|
938 | } | |
929 | error : null |
|
939 | error : null | |
930 |
|
940 | |||
931 | Example error output: |
|
941 | Example error output: | |
932 |
|
942 | |||
933 | .. code-block:: bash |
|
943 | .. code-block:: bash | |
934 |
|
944 | |||
935 | id : <id_given_in_input> |
|
945 | id : <id_given_in_input> | |
936 | result : null |
|
946 | result : null | |
937 | error : { |
|
947 | error : { | |
938 | "Unable to strip commit <commit_hash> from repo `<repository name>`" |
|
948 | "Unable to strip commit <commit_hash> from repo `<repository name>`" | |
939 | } |
|
949 | } | |
940 |
|
950 | |||
941 |
|
951 | |||
942 | update_repo |
|
952 | update_repo | |
943 | ----------- |
|
953 | ----------- | |
944 |
|
954 | |||
945 | .. py:function:: update_repo(apiuser, repoid, repo_name=<Optional:None>, owner=<Optional:<OptionalAttr:apiuser>>, description=<Optional:''>, private=<Optional:False>, clone_uri=<Optional:None>, landing_rev=<Optional:'rev:tip'>, fork_of=<Optional:None>, enable_statistics=<Optional:False>, enable_locking=<Optional:False>, enable_downloads=<Optional:False>, fields=<Optional:''>) |
|
955 | .. py:function:: update_repo(apiuser, repoid, repo_name=<Optional:None>, owner=<Optional:<OptionalAttr:apiuser>>, description=<Optional:''>, private=<Optional:False>, clone_uri=<Optional:None>, landing_rev=<Optional:'rev:tip'>, fork_of=<Optional:None>, enable_statistics=<Optional:False>, enable_locking=<Optional:False>, enable_downloads=<Optional:False>, fields=<Optional:''>) | |
946 |
|
956 | |||
947 | Updates a repository with the given information. |
|
957 | Updates a repository with the given information. | |
948 |
|
958 | |||
949 | This command can only be run using an |authtoken| with at least |
|
959 | This command can only be run using an |authtoken| with at least | |
950 | admin permissions to the |repo|. |
|
960 | admin permissions to the |repo|. | |
951 |
|
961 | |||
952 | * If the repository name contains "/", repository will be updated |
|
962 | * If the repository name contains "/", repository will be updated | |
953 | accordingly with a repository group or nested repository groups |
|
963 | accordingly with a repository group or nested repository groups | |
954 |
|
964 | |||
955 | For example repoid=repo-test name="foo/bar/repo-test" will update |repo| |
|
965 | For example repoid=repo-test name="foo/bar/repo-test" will update |repo| | |
956 | called "repo-test" and place it inside group "foo/bar". |
|
966 | called "repo-test" and place it inside group "foo/bar". | |
957 | You have to have permissions to access and write to the last repository |
|
967 | You have to have permissions to access and write to the last repository | |
958 | group ("bar" in this example) |
|
968 | group ("bar" in this example) | |
959 |
|
969 | |||
960 | :param apiuser: This is filled automatically from the |authtoken|. |
|
970 | :param apiuser: This is filled automatically from the |authtoken|. | |
961 | :type apiuser: AuthUser |
|
971 | :type apiuser: AuthUser | |
962 | :param repoid: repository name or repository ID. |
|
972 | :param repoid: repository name or repository ID. | |
963 | :type repoid: str or int |
|
973 | :type repoid: str or int | |
964 | :param repo_name: Update the |repo| name, including the |
|
974 | :param repo_name: Update the |repo| name, including the | |
965 | repository group it's in. |
|
975 | repository group it's in. | |
966 | :type repo_name: str |
|
976 | :type repo_name: str | |
967 | :param owner: Set the |repo| owner. |
|
977 | :param owner: Set the |repo| owner. | |
968 | :type owner: str |
|
978 | :type owner: str | |
969 | :param fork_of: Set the |repo| as fork of another |repo|. |
|
979 | :param fork_of: Set the |repo| as fork of another |repo|. | |
970 | :type fork_of: str |
|
980 | :type fork_of: str | |
971 | :param description: Update the |repo| description. |
|
981 | :param description: Update the |repo| description. | |
972 | :type description: str |
|
982 | :type description: str | |
973 | :param private: Set the |repo| as private. (True | False) |
|
983 | :param private: Set the |repo| as private. (True | False) | |
974 | :type private: bool |
|
984 | :type private: bool | |
975 | :param clone_uri: Update the |repo| clone URI. |
|
985 | :param clone_uri: Update the |repo| clone URI. | |
976 | :type clone_uri: str |
|
986 | :type clone_uri: str | |
977 | :param landing_rev: Set the |repo| landing revision. Default is ``rev:tip``. |
|
987 | :param landing_rev: Set the |repo| landing revision. Default is ``rev:tip``. | |
978 | :type landing_rev: str |
|
988 | :type landing_rev: str | |
979 | :param enable_statistics: Enable statistics on the |repo|, (True | False). |
|
989 | :param enable_statistics: Enable statistics on the |repo|, (True | False). | |
980 | :type enable_statistics: bool |
|
990 | :type enable_statistics: bool | |
981 | :param enable_locking: Enable |repo| locking. |
|
991 | :param enable_locking: Enable |repo| locking. | |
982 | :type enable_locking: bool |
|
992 | :type enable_locking: bool | |
983 | :param enable_downloads: Enable downloads from the |repo|, (True | False). |
|
993 | :param enable_downloads: Enable downloads from the |repo|, (True | False). | |
984 | :type enable_downloads: bool |
|
994 | :type enable_downloads: bool | |
985 | :param fields: Add extra fields to the |repo|. Use the following |
|
995 | :param fields: Add extra fields to the |repo|. Use the following | |
986 | example format: ``field_key=field_val,field_key2=fieldval2``. |
|
996 | example format: ``field_key=field_val,field_key2=fieldval2``. | |
987 | Escape ', ' with \, |
|
997 | Escape ', ' with \, | |
988 | :type fields: str |
|
998 | :type fields: str | |
989 |
|
999 | |||
990 |
|
1000 |
@@ -1,115 +1,158 b'' | |||||
1 | .. _server-methods-ref: |
|
1 | .. _server-methods-ref: | |
2 |
|
2 | |||
3 | server methods |
|
3 | server methods | |
4 | ============== |
|
4 | ============== | |
5 |
|
5 | |||
|
6 | cleanup_sessions | |||
|
7 | ---------------- | |||
|
8 | ||||
|
9 | .. py:function:: cleanup_sessions(apiuser, older_then=<Optional:60>) | |||
|
10 | ||||
|
11 | Triggers a session cleanup action. | |||
|
12 | ||||
|
13 | If the ``older_then`` option is set, only sessions that hasn't been | |||
|
14 | accessed in the given number of days will be removed. | |||
|
15 | ||||
|
16 | This command can only be run using an |authtoken| with admin rights to | |||
|
17 | the specified repository. | |||
|
18 | ||||
|
19 | This command takes the following options: | |||
|
20 | ||||
|
21 | :param apiuser: This is filled automatically from the |authtoken|. | |||
|
22 | :type apiuser: AuthUser | |||
|
23 | :param older_then: Deletes session that hasn't been accessed | |||
|
24 | in given number of days. | |||
|
25 | :type older_then: Optional(int) | |||
|
26 | ||||
|
27 | Example output: | |||
|
28 | ||||
|
29 | .. code-block:: bash | |||
|
30 | ||||
|
31 | id : <id_given_in_input> | |||
|
32 | result: { | |||
|
33 | "backend": "<type of backend>", | |||
|
34 | "sessions_removed": <number_of_removed_sessions> | |||
|
35 | } | |||
|
36 | error : null | |||
|
37 | ||||
|
38 | Example error output: | |||
|
39 | ||||
|
40 | .. code-block:: bash | |||
|
41 | ||||
|
42 | id : <id_given_in_input> | |||
|
43 | result : null | |||
|
44 | error : { | |||
|
45 | 'Error occurred during session cleanup' | |||
|
46 | } | |||
|
47 | ||||
|
48 | ||||
6 | get_ip |
|
49 | get_ip | |
7 | ------ |
|
50 | ------ | |
8 |
|
51 | |||
9 | .. py:function:: get_ip(apiuser, userid=<Optional:<OptionalAttr:apiuser>>) |
|
52 | .. py:function:: get_ip(apiuser, userid=<Optional:<OptionalAttr:apiuser>>) | |
10 |
|
53 | |||
11 | Displays the IP Address as seen from the |RCE| server. |
|
54 | Displays the IP Address as seen from the |RCE| server. | |
12 |
|
55 | |||
13 | * This command displays the IP Address, as well as all the defined IP |
|
56 | * This command displays the IP Address, as well as all the defined IP | |
14 | addresses for the specified user. If the ``userid`` is not set, the |
|
57 | addresses for the specified user. If the ``userid`` is not set, the | |
15 | data returned is for the user calling the method. |
|
58 | data returned is for the user calling the method. | |
16 |
|
59 | |||
17 | This command can only be run using an |authtoken| with admin rights to |
|
60 | This command can only be run using an |authtoken| with admin rights to | |
18 | the specified repository. |
|
61 | the specified repository. | |
19 |
|
62 | |||
20 | This command takes the following options: |
|
63 | This command takes the following options: | |
21 |
|
64 | |||
22 | :param apiuser: This is filled automatically from |authtoken|. |
|
65 | :param apiuser: This is filled automatically from |authtoken|. | |
23 | :type apiuser: AuthUser |
|
66 | :type apiuser: AuthUser | |
24 | :param userid: Sets the userid for which associated IP Address data |
|
67 | :param userid: Sets the userid for which associated IP Address data | |
25 | is returned. |
|
68 | is returned. | |
26 | :type userid: Optional(str or int) |
|
69 | :type userid: Optional(str or int) | |
27 |
|
70 | |||
28 | Example output: |
|
71 | Example output: | |
29 |
|
72 | |||
30 | .. code-block:: bash |
|
73 | .. code-block:: bash | |
31 |
|
74 | |||
32 | id : <id_given_in_input> |
|
75 | id : <id_given_in_input> | |
33 | result : { |
|
76 | result : { | |
34 | "server_ip_addr": "<ip_from_clien>", |
|
77 | "server_ip_addr": "<ip_from_clien>", | |
35 | "user_ips": [ |
|
78 | "user_ips": [ | |
36 | { |
|
79 | { | |
37 | "ip_addr": "<ip_with_mask>", |
|
80 | "ip_addr": "<ip_with_mask>", | |
38 | "ip_range": ["<start_ip>", "<end_ip>"], |
|
81 | "ip_range": ["<start_ip>", "<end_ip>"], | |
39 | }, |
|
82 | }, | |
40 | ... |
|
83 | ... | |
41 | ] |
|
84 | ] | |
42 | } |
|
85 | } | |
43 |
|
86 | |||
44 |
|
87 | |||
45 | get_server_info |
|
88 | get_server_info | |
46 | --------------- |
|
89 | --------------- | |
47 |
|
90 | |||
48 | .. py:function:: get_server_info(apiuser) |
|
91 | .. py:function:: get_server_info(apiuser) | |
49 |
|
92 | |||
50 | Returns the |RCE| server information. |
|
93 | Returns the |RCE| server information. | |
51 |
|
94 | |||
52 | This includes the running version of |RCE| and all installed |
|
95 | This includes the running version of |RCE| and all installed | |
53 | packages. This command takes the following options: |
|
96 | packages. This command takes the following options: | |
54 |
|
97 | |||
55 | :param apiuser: This is filled automatically from the |authtoken|. |
|
98 | :param apiuser: This is filled automatically from the |authtoken|. | |
56 | :type apiuser: AuthUser |
|
99 | :type apiuser: AuthUser | |
57 |
|
100 | |||
58 | Example output: |
|
101 | Example output: | |
59 |
|
102 | |||
60 | .. code-block:: bash |
|
103 | .. code-block:: bash | |
61 |
|
104 | |||
62 | id : <id_given_in_input> |
|
105 | id : <id_given_in_input> | |
63 | result : { |
|
106 | result : { | |
64 | 'modules': [<module name>,...] |
|
107 | 'modules': [<module name>,...] | |
65 | 'py_version': <python version>, |
|
108 | 'py_version': <python version>, | |
66 | 'platform': <platform type>, |
|
109 | 'platform': <platform type>, | |
67 | 'rhodecode_version': <rhodecode version> |
|
110 | 'rhodecode_version': <rhodecode version> | |
68 | } |
|
111 | } | |
69 | error : null |
|
112 | error : null | |
70 |
|
113 | |||
71 |
|
114 | |||
72 | rescan_repos |
|
115 | rescan_repos | |
73 | ------------ |
|
116 | ------------ | |
74 |
|
117 | |||
75 | .. py:function:: rescan_repos(apiuser, remove_obsolete=<Optional:False>) |
|
118 | .. py:function:: rescan_repos(apiuser, remove_obsolete=<Optional:False>) | |
76 |
|
119 | |||
77 | Triggers a rescan of the specified repositories. |
|
120 | Triggers a rescan of the specified repositories. | |
78 |
|
121 | |||
79 | * If the ``remove_obsolete`` option is set, it also deletes repositories |
|
122 | * If the ``remove_obsolete`` option is set, it also deletes repositories | |
80 | that are found in the database but not on the file system, so called |
|
123 | that are found in the database but not on the file system, so called | |
81 | "clean zombies". |
|
124 | "clean zombies". | |
82 |
|
125 | |||
83 | This command can only be run using an |authtoken| with admin rights to |
|
126 | This command can only be run using an |authtoken| with admin rights to | |
84 | the specified repository. |
|
127 | the specified repository. | |
85 |
|
128 | |||
86 | This command takes the following options: |
|
129 | This command takes the following options: | |
87 |
|
130 | |||
88 | :param apiuser: This is filled automatically from the |authtoken|. |
|
131 | :param apiuser: This is filled automatically from the |authtoken|. | |
89 | :type apiuser: AuthUser |
|
132 | :type apiuser: AuthUser | |
90 | :param remove_obsolete: Deletes repositories from the database that |
|
133 | :param remove_obsolete: Deletes repositories from the database that | |
91 | are not found on the filesystem. |
|
134 | are not found on the filesystem. | |
92 | :type remove_obsolete: Optional(``True`` | ``False``) |
|
135 | :type remove_obsolete: Optional(``True`` | ``False``) | |
93 |
|
136 | |||
94 | Example output: |
|
137 | Example output: | |
95 |
|
138 | |||
96 | .. code-block:: bash |
|
139 | .. code-block:: bash | |
97 |
|
140 | |||
98 | id : <id_given_in_input> |
|
141 | id : <id_given_in_input> | |
99 | result : { |
|
142 | result : { | |
100 | 'added': [<added repository name>,...] |
|
143 | 'added': [<added repository name>,...] | |
101 | 'removed': [<removed repository name>,...] |
|
144 | 'removed': [<removed repository name>,...] | |
102 | } |
|
145 | } | |
103 | error : null |
|
146 | error : null | |
104 |
|
147 | |||
105 | Example error output: |
|
148 | Example error output: | |
106 |
|
149 | |||
107 | .. code-block:: bash |
|
150 | .. code-block:: bash | |
108 |
|
151 | |||
109 | id : <id_given_in_input> |
|
152 | id : <id_given_in_input> | |
110 | result : null |
|
153 | result : null | |
111 | error : { |
|
154 | error : { | |
112 | 'Error occurred during rescan repositories action' |
|
155 | 'Error occurred during rescan repositories action' | |
113 | } |
|
156 | } | |
114 |
|
157 | |||
115 |
|
158 |
General Comments 0
You need to be logged in to leave comments.
Login now