Show More
@@ -0,0 +1,48 b'' | |||||
|
1 | .. _views-ref: | |||
|
2 | ||||
|
3 | views | |||
|
4 | ===== | |||
|
5 | ||||
|
6 | push (EE only) | |||
|
7 | -------------- | |||
|
8 | ||||
|
9 | .. py:function:: push(apiuser, repoid, remote_uri=<Optional:None>) | |||
|
10 | ||||
|
11 | Triggers a push on the given repository from a remote location. You | |||
|
12 | can use this to keep remote repositories up-to-date. | |||
|
13 | ||||
|
14 | This command can only be run using an |authtoken| with admin | |||
|
15 | rights to the specified repository. For more information, | |||
|
16 | see :ref:`config-token-ref`. | |||
|
17 | ||||
|
18 | This command takes the following options: | |||
|
19 | ||||
|
20 | :param apiuser: This is filled automatically from the |authtoken|. | |||
|
21 | :type apiuser: AuthUser | |||
|
22 | :param repoid: The repository name or repository ID. | |||
|
23 | :type repoid: str or int | |||
|
24 | :param remote_uri: Optional remote URI to pass in for push | |||
|
25 | :type remote_uri: str | |||
|
26 | ||||
|
27 | Example output: | |||
|
28 | ||||
|
29 | .. code-block:: bash | |||
|
30 | ||||
|
31 | id : <id_given_in_input> | |||
|
32 | result : { | |||
|
33 | "msg": "Pushed to url `<remote_url>` on repo `<repository name>`" | |||
|
34 | "repository": "<repository name>" | |||
|
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 | "Unable to push changes to `<remote_url>`" | |||
|
46 | } | |||
|
47 | ||||
|
48 |
@@ -1,207 +1,208 b'' | |||||
1 | .. _api: |
|
1 | .. _api: | |
2 |
|
2 | |||
3 | API Documentation |
|
3 | API Documentation | |
4 | ================= |
|
4 | ================= | |
5 |
|
5 | |||
6 | The |RCE| API uses a single scheme for calling all API methods. The API is |
|
6 | The |RCE| API uses a single scheme for calling all API methods. The API is | |
7 | implemented with JSON protocol in both directions. To send API requests to |
|
7 | implemented with JSON protocol in both directions. To send API requests to | |
8 | your instance of |RCE|, use the following URL format |
|
8 | your instance of |RCE|, use the following URL format | |
9 | ``<your_server>/_admin`` |
|
9 | ``<your_server>/_admin`` | |
10 |
|
10 | |||
11 | .. note:: |
|
11 | .. note:: | |
12 |
|
12 | |||
13 | To use the API, you should configure the :file:`~/.rhoderc` file with |
|
13 | To use the API, you should configure the :file:`~/.rhoderc` file with | |
14 | access details per instance. For more information, see |
|
14 | access details per instance. For more information, see | |
15 | :ref:`config-rhoderc`. |
|
15 | :ref:`config-rhoderc`. | |
16 |
|
16 | |||
17 |
|
17 | |||
18 | API ACCESS FOR WEB VIEWS |
|
18 | API ACCESS FOR WEB VIEWS | |
19 | ------------------------ |
|
19 | ------------------------ | |
20 |
|
20 | |||
21 | API access can also be turned on for each web view in |RCE| that is |
|
21 | API access can also be turned on for each web view in |RCE| that is | |
22 | decorated with a `@LoginRequired` decorator. To enable API access, change |
|
22 | decorated with a `@LoginRequired` decorator. To enable API access, change | |
23 | the standard login decorator to `@LoginRequired(api_access=True)`. |
|
23 | the standard login decorator to `@LoginRequired(api_access=True)`. | |
24 |
|
24 | |||
25 | From |RCM| version 1.7.0 you can configure a white list |
|
25 | From |RCM| version 1.7.0 you can configure a white list | |
26 | of views that have API access enabled by default. To enable these, |
|
26 | of views that have API access enabled by default. To enable these, | |
27 | edit the |RCM| configuration ``.ini`` file. The default location is: |
|
27 | edit the |RCM| configuration ``.ini`` file. The default location is: | |
28 |
|
28 | |||
29 | * |RCM| Pre-2.2.7 :file:`root/rhodecode/data/production.ini` |
|
29 | * |RCM| Pre-2.2.7 :file:`root/rhodecode/data/production.ini` | |
30 | * |RCM| 3.0 :file:`/home/{user}/.rccontrol/{instance-id}/rhodecode.ini` |
|
30 | * |RCM| 3.0 :file:`/home/{user}/.rccontrol/{instance-id}/rhodecode.ini` | |
31 |
|
31 | |||
32 | To configure the white list, edit this section of the file. In this |
|
32 | To configure the white list, edit this section of the file. In this | |
33 | configuration example, API access is granted to the patch/diff raw file and |
|
33 | configuration example, API access is granted to the patch/diff raw file and | |
34 | archive. |
|
34 | archive. | |
35 |
|
35 | |||
36 | .. code-block:: ini |
|
36 | .. code-block:: ini | |
37 |
|
37 | |||
38 | ## List of controllers (using glob syntax) that AUTH TOKENS could be used for access. |
|
38 | ## List of controllers (using glob syntax) that AUTH TOKENS could be used for access. | |
39 | ## Adding ?auth_token = <token> to the url authenticates this request as if it |
|
39 | ## Adding ?auth_token = <token> to the url authenticates this request as if it | |
40 | ## came from the the logged in user who own this authentication token. |
|
40 | ## came from the the logged in user who own this authentication token. | |
41 | ## |
|
41 | ## | |
42 | ## Syntax is <ControllerClass>:<function_pattern>. |
|
42 | ## Syntax is <ControllerClass>:<function_pattern>. | |
43 | ## The list should be "," separated and on a single line. |
|
43 | ## The list should be "," separated and on a single line. | |
44 | ## |
|
44 | ## | |
45 | api_access_controllers_whitelist = RepoCommitsView:repo_commit_raw,RepoCommitsView:repo_commit_patch,RepoCommitsView:repo_commit_download |
|
45 | api_access_controllers_whitelist = RepoCommitsView:repo_commit_raw,RepoCommitsView:repo_commit_patch,RepoCommitsView:repo_commit_download | |
46 |
|
46 | |||
47 | After this change, a |RCE| view can be accessed without login by adding a |
|
47 | After this change, a |RCE| view can be accessed without login by adding a | |
48 | GET parameter ``?auth_token=<auth_token>`` to a url. For example to |
|
48 | GET parameter ``?auth_token=<auth_token>`` to a url. For example to | |
49 | access the raw diff. |
|
49 | access the raw diff. | |
50 |
|
50 | |||
51 | .. code-block:: html |
|
51 | .. code-block:: html | |
52 |
|
52 | |||
53 | http://<server>/<repo>/changeset-diff/<sha>?auth_token=<auth_token> |
|
53 | http://<server>/<repo>/changeset-diff/<sha>?auth_token=<auth_token> | |
54 |
|
54 | |||
55 | By default this is only enabled on RSS/ATOM feed views. Exposing raw diffs is a |
|
55 | By default this is only enabled on RSS/ATOM feed views. Exposing raw diffs is a | |
56 | good way to integrate with 3rd party services like code review, or build farms |
|
56 | good way to integrate with 3rd party services like code review, or build farms | |
57 | that could download archives. |
|
57 | that could download archives. | |
58 |
|
58 | |||
59 | API ACCESS |
|
59 | API ACCESS | |
60 | ---------- |
|
60 | ---------- | |
61 |
|
61 | |||
62 | All clients are required to send JSON-RPC spec JSON data. |
|
62 | All clients are required to send JSON-RPC spec JSON data. | |
63 |
|
63 | |||
64 | .. code-block:: bash |
|
64 | .. code-block:: bash | |
65 |
|
65 | |||
66 | { |
|
66 | { | |
67 | "id:"<id>", |
|
67 | "id:"<id>", | |
68 | "auth_token":"<auth_token>", |
|
68 | "auth_token":"<auth_token>", | |
69 | "method":"<method_name>", |
|
69 | "method":"<method_name>", | |
70 | "args":{"<arg_key>":"<arg_val>"} |
|
70 | "args":{"<arg_key>":"<arg_val>"} | |
71 | } |
|
71 | } | |
72 |
|
72 | |||
73 | Example call for auto pulling from remote repositories using curl: |
|
73 | Example call for auto pulling from remote repositories using curl: | |
74 |
|
74 | |||
75 | .. code-block:: bash |
|
75 | .. code-block:: bash | |
76 |
|
76 | |||
77 | curl https://server.com/_admin/api -X POST -H 'content-type:text/plain' --data-binary '{"id":1, |
|
77 | curl https://server.com/_admin/api -X POST -H 'content-type:text/plain' --data-binary '{"id":1, | |
78 | "auth_token":"xe7cdb2v278e4evbdf5vs04v832v0efvcbcve4a3","method":"pull", "args":{"repoid":"CPython"}}' |
|
78 | "auth_token":"xe7cdb2v278e4evbdf5vs04v832v0efvcbcve4a3","method":"pull", "args":{"repoid":"CPython"}}' | |
79 |
|
79 | |||
80 | Provide those parameters: |
|
80 | Provide those parameters: | |
81 | - **id** A value of any type, which is used to match the response with the |
|
81 | - **id** A value of any type, which is used to match the response with the | |
82 | request that it is replying to. |
|
82 | request that it is replying to. | |
83 | - **auth_token** for access and permission validation. |
|
83 | - **auth_token** for access and permission validation. | |
84 | - **method** is name of method to call |
|
84 | - **method** is name of method to call | |
85 | - **args** is an ``key:value`` list of arguments to pass to method |
|
85 | - **args** is an ``key:value`` list of arguments to pass to method | |
86 |
|
86 | |||
87 | .. note:: |
|
87 | .. note:: | |
88 |
|
88 | |||
89 | To get your |authtoken|, from the |RCE| interface, |
|
89 | To get your |authtoken|, from the |RCE| interface, | |
90 | go to: |
|
90 | go to: | |
91 | :menuselection:`username --> My account --> Auth tokens` |
|
91 | :menuselection:`username --> My account --> Auth tokens` | |
92 |
|
92 | |||
93 | For security reasons you should always create a dedicated |authtoken| for |
|
93 | For security reasons you should always create a dedicated |authtoken| for | |
94 | API use only. |
|
94 | API use only. | |
95 |
|
95 | |||
96 |
|
96 | |||
97 | The |RCE| API will always return a JSON-RPC response: |
|
97 | The |RCE| API will always return a JSON-RPC response: | |
98 |
|
98 | |||
99 | .. code-block:: bash |
|
99 | .. code-block:: bash | |
100 |
|
100 | |||
101 | { |
|
101 | { | |
102 | "id": <id>, # matching id sent by request |
|
102 | "id": <id>, # matching id sent by request | |
103 | "result": "<result>"|null, # JSON formatted result, null if any errors |
|
103 | "result": "<result>"|null, # JSON formatted result, null if any errors | |
104 | "error": "null"|<error_message> # JSON formatted error (if any) |
|
104 | "error": "null"|<error_message> # JSON formatted error (if any) | |
105 | } |
|
105 | } | |
106 |
|
106 | |||
107 | All responses from API will be with `HTTP/1.0 200 OK` status code. |
|
107 | All responses from API will be with `HTTP/1.0 200 OK` status code. | |
108 | If there is an error when calling the API, the *error* key will contain a |
|
108 | If there is an error when calling the API, the *error* key will contain a | |
109 | failure description and the *result* will be `null`. |
|
109 | failure description and the *result* will be `null`. | |
110 |
|
110 | |||
111 | API CLIENT |
|
111 | API CLIENT | |
112 | ---------- |
|
112 | ---------- | |
113 |
|
113 | |||
114 | To install the |RCE| API, see :ref:`install-tools`. To configure the API per |
|
114 | To install the |RCE| API, see :ref:`install-tools`. To configure the API per | |
115 | instance, see the :ref:`rc-tools` section as you need to configure a |
|
115 | instance, see the :ref:`rc-tools` section as you need to configure a | |
116 | :file:`~/.rhoderc` file with your |authtokens|. |
|
116 | :file:`~/.rhoderc` file with your |authtokens|. | |
117 |
|
117 | |||
118 | Once you have set up your instance API access, use the following examples to |
|
118 | Once you have set up your instance API access, use the following examples to | |
119 | get started. |
|
119 | get started. | |
120 |
|
120 | |||
121 | .. code-block:: bash |
|
121 | .. code-block:: bash | |
122 |
|
122 | |||
123 | # Getting the 'rhodecode' repository |
|
123 | # Getting the 'rhodecode' repository | |
124 | # from a RhodeCode Enterprise instance |
|
124 | # from a RhodeCode Enterprise instance | |
125 | rhodecode-api --instance-name=enterprise-1 get_repo repoid:rhodecode |
|
125 | rhodecode-api --instance-name=enterprise-1 get_repo repoid:rhodecode | |
126 |
|
126 | |||
127 | Calling method get_repo => http://127.0.0.1:5000 |
|
127 | Calling method get_repo => http://127.0.0.1:5000 | |
128 | Server response |
|
128 | Server response | |
129 | { |
|
129 | { | |
130 | <json data> |
|
130 | <json data> | |
131 | } |
|
131 | } | |
132 |
|
132 | |||
133 | # Creating a new mercurial repository called 'brand-new' |
|
133 | # Creating a new mercurial repository called 'brand-new' | |
134 | # with a description 'Repo-description' |
|
134 | # with a description 'Repo-description' | |
135 | rhodecode-api --instance-name=enterprise-1 create_repo repo_name:brand-new repo_type:hg description:Repo-description |
|
135 | rhodecode-api --instance-name=enterprise-1 create_repo repo_name:brand-new repo_type:hg description:Repo-description | |
136 | { |
|
136 | { | |
137 | "error": null, |
|
137 | "error": null, | |
138 | "id": 1110, |
|
138 | "id": 1110, | |
139 | "result": { |
|
139 | "result": { | |
140 | "msg": "Created new repository `brand-new`", |
|
140 | "msg": "Created new repository `brand-new`", | |
141 | "success": true, |
|
141 | "success": true, | |
142 | "task": null |
|
142 | "task": null | |
143 | } |
|
143 | } | |
144 | } |
|
144 | } | |
145 |
|
145 | |||
146 | A broken example, what not to do. |
|
146 | A broken example, what not to do. | |
147 |
|
147 | |||
148 | .. code-block:: bash |
|
148 | .. code-block:: bash | |
149 |
|
149 | |||
150 | # A call missing the required arguments |
|
150 | # A call missing the required arguments | |
151 | # and not specifying the instance |
|
151 | # and not specifying the instance | |
152 | rhodecode-api get_repo |
|
152 | rhodecode-api get_repo | |
153 |
|
153 | |||
154 | Calling method get_repo => http://127.0.0.1:5000 |
|
154 | Calling method get_repo => http://127.0.0.1:5000 | |
155 | Server response |
|
155 | Server response | |
156 | "Missing non optional `repoid` arg in JSON DATA" |
|
156 | "Missing non optional `repoid` arg in JSON DATA" | |
157 |
|
157 | |||
158 | You can specify pure JSON using the ``--format`` parameter. |
|
158 | You can specify pure JSON using the ``--format`` parameter. | |
159 |
|
159 | |||
160 | .. code-block:: bash |
|
160 | .. code-block:: bash | |
161 |
|
161 | |||
162 | rhodecode-api --format=json get_repo repoid:rhodecode |
|
162 | rhodecode-api --format=json get_repo repoid:rhodecode | |
163 |
|
163 | |||
164 | In such case only output that this function shows is pure JSON, we can use that |
|
164 | In such case only output that this function shows is pure JSON, we can use that | |
165 | and pipe output to some json formatter. |
|
165 | and pipe output to some json formatter. | |
166 |
|
166 | |||
167 | If output is in pure JSON format, you can pipe output to a JSON formatter. |
|
167 | If output is in pure JSON format, you can pipe output to a JSON formatter. | |
168 |
|
168 | |||
169 | .. code-block:: bash |
|
169 | .. code-block:: bash | |
170 |
|
170 | |||
171 | rhodecode-api --instance-name=enterprise-1 --format=json get_repo repoid:rhodecode | python -m json.tool |
|
171 | rhodecode-api --instance-name=enterprise-1 --format=json get_repo repoid:rhodecode | python -m json.tool | |
172 |
|
172 | |||
173 | API METHODS |
|
173 | API METHODS | |
174 | ----------- |
|
174 | ----------- | |
175 |
|
175 | |||
176 | Each method by default required following arguments. |
|
176 | Each method by default required following arguments. | |
177 |
|
177 | |||
178 | .. code-block:: bash |
|
178 | .. code-block:: bash | |
179 |
|
179 | |||
180 | id : "<id_for_response>" |
|
180 | id : "<id_for_response>" | |
181 | auth_token : "<auth_token>" |
|
181 | auth_token : "<auth_token>" | |
182 | method : "<method name>" |
|
182 | method : "<method name>" | |
183 | args : {} |
|
183 | args : {} | |
184 |
|
184 | |||
185 | Use each **param** from docs and put it in args, Optional parameters |
|
185 | Use each **param** from docs and put it in args, Optional parameters | |
186 | are not required in args. |
|
186 | are not required in args. | |
187 |
|
187 | |||
188 | .. code-block:: bash |
|
188 | .. code-block:: bash | |
189 |
|
189 | |||
190 | args: {"repoid": "rhodecode"} |
|
190 | args: {"repoid": "rhodecode"} | |
191 |
|
191 | |||
192 | .. Note: From this point on things are generated by the script in |
|
192 | .. Note: From this point on things are generated by the script in | |
193 | `scripts/fabfile.py`. To change things below, update the docstrings in the |
|
193 | `scripts/fabfile.py`. To change things below, update the docstrings in the | |
194 | ApiController. |
|
194 | ApiController. | |
195 |
|
195 | |||
196 | .. --- API DEFS MARKER --- |
|
196 | .. --- API DEFS MARKER --- | |
197 | .. toctree:: |
|
197 | .. toctree:: | |
198 |
|
198 | |||
|
199 | methods/views | |||
199 | methods/license-methods |
|
200 | methods/license-methods | |
200 | methods/deprecated-methods |
|
201 | methods/deprecated-methods | |
201 | methods/gist-methods |
|
202 | methods/gist-methods | |
202 | methods/pull-request-methods |
|
203 | methods/pull-request-methods | |
203 | methods/repo-methods |
|
204 | methods/repo-methods | |
204 | methods/repo-group-methods |
|
205 | methods/repo-group-methods | |
205 | methods/server-methods |
|
206 | methods/server-methods | |
206 | methods/user-methods |
|
207 | methods/user-methods | |
207 | methods/user-group-methods |
|
208 | methods/user-group-methods |
@@ -1,77 +1,77 b'' | |||||
1 | .. _deprecated-methods-ref: |
|
1 | .. _deprecated-methods-ref: | |
2 |
|
2 | |||
3 | deprecated methods |
|
3 | deprecated methods | |
4 | ================== |
|
4 | ================== | |
5 |
|
5 | |||
6 | changeset_comment |
|
6 | changeset_comment | |
7 | ----------------- |
|
7 | ----------------- | |
8 |
|
8 | |||
9 | .. py:function:: changeset_comment(apiuser, repoid, revision, message, userid=<Optional:<OptionalAttr:apiuser>>, status=<Optional:None>) |
|
9 | .. py:function:: changeset_comment(apiuser, repoid, revision, message, userid=<Optional:<OptionalAttr:apiuser>>, status=<Optional:None>) | |
10 |
|
10 | |||
11 | .. deprecated:: 3.4.0 |
|
11 | .. deprecated:: 3.4.0 | |
12 |
|
12 | |||
13 | Please use method `comment_commit` instead. |
|
13 | Please use method `comment_commit` instead. | |
14 |
|
14 | |||
15 |
|
15 | |||
16 | Set a changeset comment, and optionally change the status of the |
|
16 | Set a changeset comment, and optionally change the status of the | |
17 | changeset. |
|
17 | changeset. | |
18 |
|
18 | |||
19 | This command can only be run using an |authtoken| with admin |
|
19 | This command can only be run using an |authtoken| with admin | |
20 | permissions on the |repo|. |
|
20 | permissions on the |repo|. | |
21 |
|
21 | |||
22 | :param apiuser: This is filled automatically from the |authtoken|. |
|
22 | :param apiuser: This is filled automatically from the |authtoken|. | |
23 | :type apiuser: AuthUser |
|
23 | :type apiuser: AuthUser | |
24 | :param repoid: Set the repository name or repository ID. |
|
24 | :param repoid: Set the repository name or repository ID. | |
25 | :type repoid: str or int |
|
25 | :type repoid: str or int | |
26 | :param revision: Specify the revision for which to set a comment. |
|
26 | :param revision: Specify the revision for which to set a comment. | |
27 | :type revision: str |
|
27 | :type revision: str | |
28 | :param message: The comment text. |
|
28 | :param message: The comment text. | |
29 | :type message: str |
|
29 | :type message: str | |
30 | :param userid: Set the user name of the comment creator. |
|
30 | :param userid: Set the user name of the comment creator. | |
31 | :type userid: Optional(str or int) |
|
31 | :type userid: Optional(str or int) | |
32 | :param status: Set the comment status. The following are valid options: |
|
32 | :param status: Set the comment status. The following are valid options: | |
33 | * not_reviewed |
|
33 | * not_reviewed | |
34 | * approved |
|
34 | * approved | |
35 | * rejected |
|
35 | * rejected | |
36 | * under_review |
|
36 | * under_review | |
37 | :type status: str |
|
37 | :type status: str | |
38 |
|
38 | |||
39 | Example error output: |
|
39 | Example error output: | |
40 |
|
40 | |||
41 |
.. code-block:: j |
|
41 | .. code-block:: json | |
42 |
|
42 | |||
43 | { |
|
43 | { | |
44 | "id" : <id_given_in_input>, |
|
44 | "id" : <id_given_in_input>, | |
45 | "result" : { |
|
45 | "result" : { | |
46 | "msg": "Commented on commit `<revision>` for repository `<repoid>`", |
|
46 | "msg": "Commented on commit `<revision>` for repository `<repoid>`", | |
47 | "status_change": null or <status>, |
|
47 | "status_change": null or <status>, | |
48 | "success": true |
|
48 | "success": true | |
49 | }, |
|
49 | }, | |
50 | "error" : null |
|
50 | "error" : null | |
51 | } |
|
51 | } | |
52 |
|
52 | |||
53 |
|
53 | |||
54 | get_locks |
|
54 | get_locks | |
55 | --------- |
|
55 | --------- | |
56 |
|
56 | |||
57 | .. py:function:: get_locks(apiuser, userid=<Optional:<OptionalAttr:apiuser>>) |
|
57 | .. py:function:: get_locks(apiuser, userid=<Optional:<OptionalAttr:apiuser>>) | |
58 |
|
58 | |||
59 | .. deprecated:: 4.0.0 |
|
59 | .. deprecated:: 4.0.0 | |
60 |
|
60 | |||
61 | Please use method `get_user_locks` instead. |
|
61 | Please use method `get_user_locks` instead. | |
62 |
|
62 | |||
63 | None |
|
63 | None | |
64 |
|
64 | |||
65 |
|
65 | |||
66 | show_ip |
|
66 | show_ip | |
67 | ------- |
|
67 | ------- | |
68 |
|
68 | |||
69 | .. py:function:: show_ip(apiuser, userid=<Optional:<OptionalAttr:apiuser>>) |
|
69 | .. py:function:: show_ip(apiuser, userid=<Optional:<OptionalAttr:apiuser>>) | |
70 |
|
70 | |||
71 | .. deprecated:: 4.0.0 |
|
71 | .. deprecated:: 4.0.0 | |
72 |
|
72 | |||
73 | Please use method `get_ip` instead. |
|
73 | Please use method `get_ip` instead. | |
74 |
|
74 | |||
75 | None |
|
75 | None | |
76 |
|
76 | |||
77 |
|
77 |
@@ -1,1024 +1,1028 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, status=<Optional:None>, comment_type=<Optional:u'note'>, resolves_comment_id=<Optional:None>, 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', |
|
43 | :param status: (**Optional**) status of commit, one of: 'not_reviewed', | |
44 | 'approved', 'rejected', 'under_review' |
|
44 | 'approved', 'rejected', 'under_review' | |
45 | :type status: str |
|
45 | :type status: str | |
46 | :param comment_type: Comment type, one of: 'note', 'todo' |
|
46 | :param comment_type: Comment type, one of: 'note', 'todo' | |
47 | :type comment_type: Optional(str), default: 'note' |
|
47 | :type comment_type: Optional(str), default: 'note' | |
48 | :param userid: Set the user name of the comment creator. |
|
48 | :param userid: Set the user name of the comment creator. | |
49 | :type userid: Optional(str or int) |
|
49 | :type userid: Optional(str or int) | |
50 |
|
50 | |||
51 | Example error output: |
|
51 | Example error output: | |
52 |
|
52 | |||
53 | .. code-block:: bash |
|
53 | .. code-block:: bash | |
54 |
|
54 | |||
55 | { |
|
55 | { | |
56 | "id" : <id_given_in_input>, |
|
56 | "id" : <id_given_in_input>, | |
57 | "result" : { |
|
57 | "result" : { | |
58 | "msg": "Commented on commit `<commit_id>` for repository `<repoid>`", |
|
58 | "msg": "Commented on commit `<commit_id>` for repository `<repoid>`", | |
59 | "status_change": null or <status>, |
|
59 | "status_change": null or <status>, | |
60 | "success": true |
|
60 | "success": true | |
61 | }, |
|
61 | }, | |
62 | "error" : null |
|
62 | "error" : null | |
63 | } |
|
63 | } | |
64 |
|
64 | |||
65 |
|
65 | |||
66 | create_repo |
|
66 | create_repo | |
67 | ----------- |
|
67 | ----------- | |
68 |
|
68 | |||
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>) |
|
69 | .. py:function:: create_repo(apiuser, repo_name, repo_type, owner=<Optional:<OptionalAttr:apiuser>>, description=<Optional:''>, private=<Optional:False>, clone_uri=<Optional:None>, push_uri=<Optional:None>, landing_rev=<Optional:'rev:tip'>, enable_statistics=<Optional:False>, enable_locking=<Optional:False>, enable_downloads=<Optional:False>, copy_permissions=<Optional:False>) | |
70 |
|
70 | |||
71 | Creates a repository. |
|
71 | Creates a repository. | |
72 |
|
72 | |||
73 | * If the repository name contains "/", repository will be created inside |
|
73 | * If the repository name contains "/", repository will be created inside | |
74 | a repository group or nested repository groups |
|
74 | a repository group or nested repository groups | |
75 |
|
75 | |||
76 | For example "foo/bar/repo1" will create |repo| called "repo1" inside |
|
76 | For example "foo/bar/repo1" will create |repo| called "repo1" inside | |
77 | 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 | |
78 | the last repository group ("bar" in this example) |
|
78 | the last repository group ("bar" in this example) | |
79 |
|
79 | |||
80 | 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 | |
81 | permissions to create repositories, or write permissions to |
|
81 | permissions to create repositories, or write permissions to | |
82 | parent repository groups. |
|
82 | parent repository groups. | |
83 |
|
83 | |||
84 | :param apiuser: This is filled automatically from the |authtoken|. |
|
84 | :param apiuser: This is filled automatically from the |authtoken|. | |
85 | :type apiuser: AuthUser |
|
85 | :type apiuser: AuthUser | |
86 | :param repo_name: Set the repository name. |
|
86 | :param repo_name: Set the repository name. | |
87 | :type repo_name: str |
|
87 | :type repo_name: str | |
88 | :param repo_type: Set the repository type; 'hg','git', or 'svn'. |
|
88 | :param repo_type: Set the repository type; 'hg','git', or 'svn'. | |
89 | :type repo_type: str |
|
89 | :type repo_type: str | |
90 | :param owner: user_id or username |
|
90 | :param owner: user_id or username | |
91 | :type owner: Optional(str) |
|
91 | :type owner: Optional(str) | |
92 | :param description: Set the repository description. |
|
92 | :param description: Set the repository description. | |
93 | :type description: Optional(str) |
|
93 | :type description: Optional(str) | |
94 | :param private: set repository as private |
|
94 | :param private: set repository as private | |
95 | :type private: bool |
|
95 | :type private: bool | |
96 | :param clone_uri: set clone_uri |
|
96 | :param clone_uri: set clone_uri | |
97 | :type clone_uri: str |
|
97 | :type clone_uri: str | |
|
98 | :param push_uri: set push_uri | |||
|
99 | :type push_uri: str | |||
98 | :param landing_rev: <rev_type>:<rev> |
|
100 | :param landing_rev: <rev_type>:<rev> | |
99 | :type landing_rev: str |
|
101 | :type landing_rev: str | |
100 | :param enable_locking: |
|
102 | :param enable_locking: | |
101 | :type enable_locking: bool |
|
103 | :type enable_locking: bool | |
102 | :param enable_downloads: |
|
104 | :param enable_downloads: | |
103 | :type enable_downloads: bool |
|
105 | :type enable_downloads: bool | |
104 | :param enable_statistics: |
|
106 | :param enable_statistics: | |
105 | :type enable_statistics: bool |
|
107 | :type enable_statistics: bool | |
106 | :param copy_permissions: Copy permission from group in which the |
|
108 | :param copy_permissions: Copy permission from group in which the | |
107 | repository is being created. |
|
109 | repository is being created. | |
108 | :type copy_permissions: bool |
|
110 | :type copy_permissions: bool | |
109 |
|
111 | |||
110 |
|
112 | |||
111 | Example output: |
|
113 | Example output: | |
112 |
|
114 | |||
113 | .. code-block:: bash |
|
115 | .. code-block:: bash | |
114 |
|
116 | |||
115 | id : <id_given_in_input> |
|
117 | id : <id_given_in_input> | |
116 | result: { |
|
118 | result: { | |
117 | "msg": "Created new repository `<reponame>`", |
|
119 | "msg": "Created new repository `<reponame>`", | |
118 | "success": true, |
|
120 | "success": true, | |
119 | "task": "<celery task id or None if done sync>" |
|
121 | "task": "<celery task id or None if done sync>" | |
120 | } |
|
122 | } | |
121 | error: null |
|
123 | error: null | |
122 |
|
124 | |||
123 |
|
125 | |||
124 | Example error output: |
|
126 | Example error output: | |
125 |
|
127 | |||
126 | .. code-block:: bash |
|
128 | .. code-block:: bash | |
127 |
|
129 | |||
128 | id : <id_given_in_input> |
|
130 | id : <id_given_in_input> | |
129 | result : null |
|
131 | result : null | |
130 | error : { |
|
132 | error : { | |
131 | 'failed to create repository `<repo_name>`' |
|
133 | 'failed to create repository `<repo_name>`' | |
132 | } |
|
134 | } | |
133 |
|
135 | |||
134 |
|
136 | |||
135 | delete_repo |
|
137 | delete_repo | |
136 | ----------- |
|
138 | ----------- | |
137 |
|
139 | |||
138 | .. py:function:: delete_repo(apiuser, repoid, forks=<Optional:''>) |
|
140 | .. py:function:: delete_repo(apiuser, repoid, forks=<Optional:''>) | |
139 |
|
141 | |||
140 | Deletes a repository. |
|
142 | Deletes a repository. | |
141 |
|
143 | |||
142 | * When the `forks` parameter is set it's possible to detach or delete |
|
144 | * When the `forks` parameter is set it's possible to detach or delete | |
143 | forks of deleted repository. |
|
145 | forks of deleted repository. | |
144 |
|
146 | |||
145 | This command can only be run using an |authtoken| with admin |
|
147 | This command can only be run using an |authtoken| with admin | |
146 | permissions on the |repo|. |
|
148 | permissions on the |repo|. | |
147 |
|
149 | |||
148 | :param apiuser: This is filled automatically from the |authtoken|. |
|
150 | :param apiuser: This is filled automatically from the |authtoken|. | |
149 | :type apiuser: AuthUser |
|
151 | :type apiuser: AuthUser | |
150 | :param repoid: Set the repository name or repository ID. |
|
152 | :param repoid: Set the repository name or repository ID. | |
151 | :type repoid: str or int |
|
153 | :type repoid: str or int | |
152 | :param forks: Set to `detach` or `delete` forks from the |repo|. |
|
154 | :param forks: Set to `detach` or `delete` forks from the |repo|. | |
153 | :type forks: Optional(str) |
|
155 | :type forks: Optional(str) | |
154 |
|
156 | |||
155 | Example error output: |
|
157 | Example error output: | |
156 |
|
158 | |||
157 | .. code-block:: bash |
|
159 | .. code-block:: bash | |
158 |
|
160 | |||
159 | id : <id_given_in_input> |
|
161 | id : <id_given_in_input> | |
160 | result: { |
|
162 | result: { | |
161 | "msg": "Deleted repository `<reponame>`", |
|
163 | "msg": "Deleted repository `<reponame>`", | |
162 | "success": true |
|
164 | "success": true | |
163 | } |
|
165 | } | |
164 | error: null |
|
166 | error: null | |
165 |
|
167 | |||
166 |
|
168 | |||
167 | fork_repo |
|
169 | fork_repo | |
168 | --------- |
|
170 | --------- | |
169 |
|
171 | |||
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>) |
|
172 | .. 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>) | |
171 |
|
173 | |||
172 | Creates a fork of the specified |repo|. |
|
174 | Creates a fork of the specified |repo|. | |
173 |
|
175 | |||
174 | * If the fork_name contains "/", fork will be created inside |
|
176 | * If the fork_name contains "/", fork will be created inside | |
175 | a repository group or nested repository groups |
|
177 | a repository group or nested repository groups | |
176 |
|
178 | |||
177 | For example "foo/bar/fork-repo" will create fork called "fork-repo" |
|
179 | For example "foo/bar/fork-repo" will create fork called "fork-repo" | |
178 | inside group "foo/bar". You have to have permissions to access and |
|
180 | inside group "foo/bar". You have to have permissions to access and | |
179 | write to the last repository group ("bar" in this example) |
|
181 | write to the last repository group ("bar" in this example) | |
180 |
|
182 | |||
181 | This command can only be run using an |authtoken| with minimum |
|
183 | This command can only be run using an |authtoken| with minimum | |
182 | read permissions of the forked repo, create fork permissions for an user. |
|
184 | read permissions of the forked repo, create fork permissions for an user. | |
183 |
|
185 | |||
184 | :param apiuser: This is filled automatically from the |authtoken|. |
|
186 | :param apiuser: This is filled automatically from the |authtoken|. | |
185 | :type apiuser: AuthUser |
|
187 | :type apiuser: AuthUser | |
186 | :param repoid: Set repository name or repository ID. |
|
188 | :param repoid: Set repository name or repository ID. | |
187 | :type repoid: str or int |
|
189 | :type repoid: str or int | |
188 | :param fork_name: Set the fork name, including it's repository group membership. |
|
190 | :param fork_name: Set the fork name, including it's repository group membership. | |
189 | :type fork_name: str |
|
191 | :type fork_name: str | |
190 | :param owner: Set the fork owner. |
|
192 | :param owner: Set the fork owner. | |
191 | :type owner: str |
|
193 | :type owner: str | |
192 | :param description: Set the fork description. |
|
194 | :param description: Set the fork description. | |
193 | :type description: str |
|
195 | :type description: str | |
194 | :param copy_permissions: Copy permissions from parent |repo|. The |
|
196 | :param copy_permissions: Copy permissions from parent |repo|. The | |
195 | default is False. |
|
197 | default is False. | |
196 | :type copy_permissions: bool |
|
198 | :type copy_permissions: bool | |
197 | :param private: Make the fork private. The default is False. |
|
199 | :param private: Make the fork private. The default is False. | |
198 | :type private: bool |
|
200 | :type private: bool | |
199 | :param landing_rev: Set the landing revision. The default is tip. |
|
201 | :param landing_rev: Set the landing revision. The default is tip. | |
200 |
|
202 | |||
201 | Example output: |
|
203 | Example output: | |
202 |
|
204 | |||
203 | .. code-block:: bash |
|
205 | .. code-block:: bash | |
204 |
|
206 | |||
205 | id : <id_for_response> |
|
207 | id : <id_for_response> | |
206 | api_key : "<api_key>" |
|
208 | api_key : "<api_key>" | |
207 | args: { |
|
209 | args: { | |
208 | "repoid" : "<reponame or repo_id>", |
|
210 | "repoid" : "<reponame or repo_id>", | |
209 | "fork_name": "<forkname>", |
|
211 | "fork_name": "<forkname>", | |
210 | "owner": "<username or user_id = Optional(=apiuser)>", |
|
212 | "owner": "<username or user_id = Optional(=apiuser)>", | |
211 | "description": "<description>", |
|
213 | "description": "<description>", | |
212 | "copy_permissions": "<bool>", |
|
214 | "copy_permissions": "<bool>", | |
213 | "private": "<bool>", |
|
215 | "private": "<bool>", | |
214 | "landing_rev": "<landing_rev>" |
|
216 | "landing_rev": "<landing_rev>" | |
215 | } |
|
217 | } | |
216 |
|
218 | |||
217 | Example error output: |
|
219 | Example error output: | |
218 |
|
220 | |||
219 | .. code-block:: bash |
|
221 | .. code-block:: bash | |
220 |
|
222 | |||
221 | id : <id_given_in_input> |
|
223 | id : <id_given_in_input> | |
222 | result: { |
|
224 | result: { | |
223 | "msg": "Created fork of `<reponame>` as `<forkname>`", |
|
225 | "msg": "Created fork of `<reponame>` as `<forkname>`", | |
224 | "success": true, |
|
226 | "success": true, | |
225 | "task": "<celery task id or None if done sync>" |
|
227 | "task": "<celery task id or None if done sync>" | |
226 | } |
|
228 | } | |
227 | error: null |
|
229 | error: null | |
228 |
|
230 | |||
229 |
|
231 | |||
230 | get_repo |
|
232 | get_repo | |
231 | -------- |
|
233 | -------- | |
232 |
|
234 | |||
233 | .. py:function:: get_repo(apiuser, repoid, cache=<Optional:True>) |
|
235 | .. py:function:: get_repo(apiuser, repoid, cache=<Optional:True>) | |
234 |
|
236 | |||
235 | Gets an existing repository by its name or repository_id. |
|
237 | Gets an existing repository by its name or repository_id. | |
236 |
|
238 | |||
237 | The members section so the output returns users groups or users |
|
239 | The members section so the output returns users groups or users | |
238 | associated with that repository. |
|
240 | associated with that repository. | |
239 |
|
241 | |||
240 | This command can only be run using an |authtoken| with admin rights, |
|
242 | This command can only be run using an |authtoken| with admin rights, | |
241 | or users with at least read rights to the |repo|. |
|
243 | or users with at least read rights to the |repo|. | |
242 |
|
244 | |||
243 | :param apiuser: This is filled automatically from the |authtoken|. |
|
245 | :param apiuser: This is filled automatically from the |authtoken|. | |
244 | :type apiuser: AuthUser |
|
246 | :type apiuser: AuthUser | |
245 | :param repoid: The repository name or repository id. |
|
247 | :param repoid: The repository name or repository id. | |
246 | :type repoid: str or int |
|
248 | :type repoid: str or int | |
247 | :param cache: use the cached value for last changeset |
|
249 | :param cache: use the cached value for last changeset | |
248 | :type: cache: Optional(bool) |
|
250 | :type: cache: Optional(bool) | |
249 |
|
251 | |||
250 | Example output: |
|
252 | Example output: | |
251 |
|
253 | |||
252 | .. code-block:: bash |
|
254 | .. code-block:: bash | |
253 |
|
255 | |||
254 | { |
|
256 | { | |
255 | "error": null, |
|
257 | "error": null, | |
256 | "id": <repo_id>, |
|
258 | "id": <repo_id>, | |
257 | "result": { |
|
259 | "result": { | |
258 | "clone_uri": null, |
|
260 | "clone_uri": null, | |
259 | "created_on": "timestamp", |
|
261 | "created_on": "timestamp", | |
260 | "description": "repo description", |
|
262 | "description": "repo description", | |
261 | "enable_downloads": false, |
|
263 | "enable_downloads": false, | |
262 | "enable_locking": false, |
|
264 | "enable_locking": false, | |
263 | "enable_statistics": false, |
|
265 | "enable_statistics": false, | |
264 | "followers": [ |
|
266 | "followers": [ | |
265 | { |
|
267 | { | |
266 | "active": true, |
|
268 | "active": true, | |
267 | "admin": false, |
|
269 | "admin": false, | |
268 | "api_key": "****************************************", |
|
270 | "api_key": "****************************************", | |
269 | "api_keys": [ |
|
271 | "api_keys": [ | |
270 | "****************************************" |
|
272 | "****************************************" | |
271 | ], |
|
273 | ], | |
272 | "email": "user@example.com", |
|
274 | "email": "user@example.com", | |
273 | "emails": [ |
|
275 | "emails": [ | |
274 | "user@example.com" |
|
276 | "user@example.com" | |
275 | ], |
|
277 | ], | |
276 | "extern_name": "rhodecode", |
|
278 | "extern_name": "rhodecode", | |
277 | "extern_type": "rhodecode", |
|
279 | "extern_type": "rhodecode", | |
278 | "firstname": "username", |
|
280 | "firstname": "username", | |
279 | "ip_addresses": [], |
|
281 | "ip_addresses": [], | |
280 | "language": null, |
|
282 | "language": null, | |
281 | "last_login": "2015-09-16T17:16:35.854", |
|
283 | "last_login": "2015-09-16T17:16:35.854", | |
282 | "lastname": "surname", |
|
284 | "lastname": "surname", | |
283 | "user_id": <user_id>, |
|
285 | "user_id": <user_id>, | |
284 | "username": "name" |
|
286 | "username": "name" | |
285 | } |
|
287 | } | |
286 | ], |
|
288 | ], | |
287 | "fork_of": "parent-repo", |
|
289 | "fork_of": "parent-repo", | |
288 | "landing_rev": [ |
|
290 | "landing_rev": [ | |
289 | "rev", |
|
291 | "rev", | |
290 | "tip" |
|
292 | "tip" | |
291 | ], |
|
293 | ], | |
292 | "last_changeset": { |
|
294 | "last_changeset": { | |
293 | "author": "User <user@example.com>", |
|
295 | "author": "User <user@example.com>", | |
294 | "branch": "default", |
|
296 | "branch": "default", | |
295 | "date": "timestamp", |
|
297 | "date": "timestamp", | |
296 | "message": "last commit message", |
|
298 | "message": "last commit message", | |
297 | "parents": [ |
|
299 | "parents": [ | |
298 | { |
|
300 | { | |
299 | "raw_id": "commit-id" |
|
301 | "raw_id": "commit-id" | |
300 | } |
|
302 | } | |
301 | ], |
|
303 | ], | |
302 | "raw_id": "commit-id", |
|
304 | "raw_id": "commit-id", | |
303 | "revision": <revision number>, |
|
305 | "revision": <revision number>, | |
304 | "short_id": "short id" |
|
306 | "short_id": "short id" | |
305 | }, |
|
307 | }, | |
306 | "lock_reason": null, |
|
308 | "lock_reason": null, | |
307 | "locked_by": null, |
|
309 | "locked_by": null, | |
308 | "locked_date": null, |
|
310 | "locked_date": null, | |
309 | "owner": "owner-name", |
|
311 | "owner": "owner-name", | |
310 | "permissions": [ |
|
312 | "permissions": [ | |
311 | { |
|
313 | { | |
312 | "name": "super-admin-name", |
|
314 | "name": "super-admin-name", | |
313 | "origin": "super-admin", |
|
315 | "origin": "super-admin", | |
314 | "permission": "repository.admin", |
|
316 | "permission": "repository.admin", | |
315 | "type": "user" |
|
317 | "type": "user" | |
316 | }, |
|
318 | }, | |
317 | { |
|
319 | { | |
318 | "name": "owner-name", |
|
320 | "name": "owner-name", | |
319 | "origin": "owner", |
|
321 | "origin": "owner", | |
320 | "permission": "repository.admin", |
|
322 | "permission": "repository.admin", | |
321 | "type": "user" |
|
323 | "type": "user" | |
322 | }, |
|
324 | }, | |
323 | { |
|
325 | { | |
324 | "name": "user-group-name", |
|
326 | "name": "user-group-name", | |
325 | "origin": "permission", |
|
327 | "origin": "permission", | |
326 | "permission": "repository.write", |
|
328 | "permission": "repository.write", | |
327 | "type": "user_group" |
|
329 | "type": "user_group" | |
328 | } |
|
330 | } | |
329 | ], |
|
331 | ], | |
330 | "private": true, |
|
332 | "private": true, | |
331 | "repo_id": 676, |
|
333 | "repo_id": 676, | |
332 | "repo_name": "user-group/repo-name", |
|
334 | "repo_name": "user-group/repo-name", | |
333 | "repo_type": "hg" |
|
335 | "repo_type": "hg" | |
334 | } |
|
336 | } | |
335 | } |
|
337 | } | |
336 |
|
338 | |||
337 |
|
339 | |||
338 | get_repo_changeset |
|
340 | get_repo_changeset | |
339 | ------------------ |
|
341 | ------------------ | |
340 |
|
342 | |||
341 | .. py:function:: get_repo_changeset(apiuser, repoid, revision, details=<Optional:'basic'>) |
|
343 | .. py:function:: get_repo_changeset(apiuser, repoid, revision, details=<Optional:'basic'>) | |
342 |
|
344 | |||
343 | Returns information about a changeset. |
|
345 | Returns information about a changeset. | |
344 |
|
346 | |||
345 | Additionally parameters define the amount of details returned by |
|
347 | Additionally parameters define the amount of details returned by | |
346 | this function. |
|
348 | this function. | |
347 |
|
349 | |||
348 | This command can only be run using an |authtoken| with admin rights, |
|
350 | This command can only be run using an |authtoken| with admin rights, | |
349 | or users with at least read rights to the |repo|. |
|
351 | or users with at least read rights to the |repo|. | |
350 |
|
352 | |||
351 | :param apiuser: This is filled automatically from the |authtoken|. |
|
353 | :param apiuser: This is filled automatically from the |authtoken|. | |
352 | :type apiuser: AuthUser |
|
354 | :type apiuser: AuthUser | |
353 | :param repoid: The repository name or repository id |
|
355 | :param repoid: The repository name or repository id | |
354 | :type repoid: str or int |
|
356 | :type repoid: str or int | |
355 | :param revision: revision for which listing should be done |
|
357 | :param revision: revision for which listing should be done | |
356 | :type revision: str |
|
358 | :type revision: str | |
357 | :param details: details can be 'basic|extended|full' full gives diff |
|
359 | :param details: details can be 'basic|extended|full' full gives diff | |
358 | info details like the diff itself, and number of changed files etc. |
|
360 | info details like the diff itself, and number of changed files etc. | |
359 | :type details: Optional(str) |
|
361 | :type details: Optional(str) | |
360 |
|
362 | |||
361 |
|
363 | |||
362 | get_repo_changesets |
|
364 | get_repo_changesets | |
363 | ------------------- |
|
365 | ------------------- | |
364 |
|
366 | |||
365 | .. py:function:: get_repo_changesets(apiuser, repoid, start_rev, limit, details=<Optional:'basic'>) |
|
367 | .. py:function:: get_repo_changesets(apiuser, repoid, start_rev, limit, details=<Optional:'basic'>) | |
366 |
|
368 | |||
367 | Returns a set of commits limited by the number starting |
|
369 | Returns a set of commits limited by the number starting | |
368 | from the `start_rev` option. |
|
370 | from the `start_rev` option. | |
369 |
|
371 | |||
370 | Additional parameters define the amount of details returned by this |
|
372 | Additional parameters define the amount of details returned by this | |
371 | function. |
|
373 | function. | |
372 |
|
374 | |||
373 | This command can only be run using an |authtoken| with admin rights, |
|
375 | This command can only be run using an |authtoken| with admin rights, | |
374 | or users with at least read rights to |repos|. |
|
376 | or users with at least read rights to |repos|. | |
375 |
|
377 | |||
376 | :param apiuser: This is filled automatically from the |authtoken|. |
|
378 | :param apiuser: This is filled automatically from the |authtoken|. | |
377 | :type apiuser: AuthUser |
|
379 | :type apiuser: AuthUser | |
378 | :param repoid: The repository name or repository ID. |
|
380 | :param repoid: The repository name or repository ID. | |
379 | :type repoid: str or int |
|
381 | :type repoid: str or int | |
380 | :param start_rev: The starting revision from where to get changesets. |
|
382 | :param start_rev: The starting revision from where to get changesets. | |
381 | :type start_rev: str |
|
383 | :type start_rev: str | |
382 | :param limit: Limit the number of commits to this amount |
|
384 | :param limit: Limit the number of commits to this amount | |
383 | :type limit: str or int |
|
385 | :type limit: str or int | |
384 | :param details: Set the level of detail returned. Valid option are: |
|
386 | :param details: Set the level of detail returned. Valid option are: | |
385 | ``basic``, ``extended`` and ``full``. |
|
387 | ``basic``, ``extended`` and ``full``. | |
386 | :type details: Optional(str) |
|
388 | :type details: Optional(str) | |
387 |
|
389 | |||
388 | .. note:: |
|
390 | .. note:: | |
389 |
|
391 | |||
390 | Setting the parameter `details` to the value ``full`` is extensive |
|
392 | Setting the parameter `details` to the value ``full`` is extensive | |
391 | and returns details like the diff itself, and the number |
|
393 | and returns details like the diff itself, and the number | |
392 | of changed files. |
|
394 | of changed files. | |
393 |
|
395 | |||
394 |
|
396 | |||
395 | get_repo_nodes |
|
397 | get_repo_nodes | |
396 | -------------- |
|
398 | -------------- | |
397 |
|
399 | |||
398 | .. py:function:: get_repo_nodes(apiuser, repoid, revision, root_path, ret_type=<Optional:'all'>, details=<Optional:'basic'>, max_file_bytes=<Optional:None>) |
|
400 | .. py:function:: get_repo_nodes(apiuser, repoid, revision, root_path, ret_type=<Optional:'all'>, details=<Optional:'basic'>, max_file_bytes=<Optional:None>) | |
399 |
|
401 | |||
400 | Returns a list of nodes and children in a flat list for a given |
|
402 | Returns a list of nodes and children in a flat list for a given | |
401 | path at given revision. |
|
403 | path at given revision. | |
402 |
|
404 | |||
403 | It's possible to specify ret_type to show only `files` or `dirs`. |
|
405 | It's possible to specify ret_type to show only `files` or `dirs`. | |
404 |
|
406 | |||
405 | This command can only be run using an |authtoken| with admin rights, |
|
407 | This command can only be run using an |authtoken| with admin rights, | |
406 | or users with at least read rights to |repos|. |
|
408 | or users with at least read rights to |repos|. | |
407 |
|
409 | |||
408 | :param apiuser: This is filled automatically from the |authtoken|. |
|
410 | :param apiuser: This is filled automatically from the |authtoken|. | |
409 | :type apiuser: AuthUser |
|
411 | :type apiuser: AuthUser | |
410 | :param repoid: The repository name or repository ID. |
|
412 | :param repoid: The repository name or repository ID. | |
411 | :type repoid: str or int |
|
413 | :type repoid: str or int | |
412 | :param revision: The revision for which listing should be done. |
|
414 | :param revision: The revision for which listing should be done. | |
413 | :type revision: str |
|
415 | :type revision: str | |
414 | :param root_path: The path from which to start displaying. |
|
416 | :param root_path: The path from which to start displaying. | |
415 | :type root_path: str |
|
417 | :type root_path: str | |
416 | :param ret_type: Set the return type. Valid options are |
|
418 | :param ret_type: Set the return type. Valid options are | |
417 | ``all`` (default), ``files`` and ``dirs``. |
|
419 | ``all`` (default), ``files`` and ``dirs``. | |
418 | :type ret_type: Optional(str) |
|
420 | :type ret_type: Optional(str) | |
419 | :param details: Returns extended information about nodes, such as |
|
421 | :param details: Returns extended information about nodes, such as | |
420 | md5, binary, and or content. The valid options are ``basic`` and |
|
422 | md5, binary, and or content. The valid options are ``basic`` and | |
421 | ``full``. |
|
423 | ``full``. | |
422 | :type details: Optional(str) |
|
424 | :type details: Optional(str) | |
423 | :param max_file_bytes: Only return file content under this file size bytes |
|
425 | :param max_file_bytes: Only return file content under this file size bytes | |
424 | :type details: Optional(int) |
|
426 | :type details: Optional(int) | |
425 |
|
427 | |||
426 | Example output: |
|
428 | Example output: | |
427 |
|
429 | |||
428 | .. code-block:: bash |
|
430 | .. code-block:: bash | |
429 |
|
431 | |||
430 | id : <id_given_in_input> |
|
432 | id : <id_given_in_input> | |
431 | result: [ |
|
433 | result: [ | |
432 | { |
|
434 | { | |
433 | "name" : "<name>" |
|
435 | "name" : "<name>" | |
434 | "type" : "<type>", |
|
436 | "type" : "<type>", | |
435 | "binary": "<true|false>" (only in extended mode) |
|
437 | "binary": "<true|false>" (only in extended mode) | |
436 | "md5" : "<md5 of file content>" (only in extended mode) |
|
438 | "md5" : "<md5 of file content>" (only in extended mode) | |
437 | }, |
|
439 | }, | |
438 | ... |
|
440 | ... | |
439 | ] |
|
441 | ] | |
440 | error: null |
|
442 | error: null | |
441 |
|
443 | |||
442 |
|
444 | |||
443 | get_repo_refs |
|
445 | get_repo_refs | |
444 | ------------- |
|
446 | ------------- | |
445 |
|
447 | |||
446 | .. py:function:: get_repo_refs(apiuser, repoid) |
|
448 | .. py:function:: get_repo_refs(apiuser, repoid) | |
447 |
|
449 | |||
448 | Returns a dictionary of current references. It returns |
|
450 | Returns a dictionary of current references. It returns | |
449 | bookmarks, branches, closed_branches, and tags for given repository |
|
451 | bookmarks, branches, closed_branches, and tags for given repository | |
450 |
|
452 | |||
451 | It's possible to specify ret_type to show only `files` or `dirs`. |
|
453 | It's possible to specify ret_type to show only `files` or `dirs`. | |
452 |
|
454 | |||
453 | This command can only be run using an |authtoken| with admin rights, |
|
455 | This command can only be run using an |authtoken| with admin rights, | |
454 | or users with at least read rights to |repos|. |
|
456 | or users with at least read rights to |repos|. | |
455 |
|
457 | |||
456 | :param apiuser: This is filled automatically from the |authtoken|. |
|
458 | :param apiuser: This is filled automatically from the |authtoken|. | |
457 | :type apiuser: AuthUser |
|
459 | :type apiuser: AuthUser | |
458 | :param repoid: The repository name or repository ID. |
|
460 | :param repoid: The repository name or repository ID. | |
459 | :type repoid: str or int |
|
461 | :type repoid: str or int | |
460 |
|
462 | |||
461 | Example output: |
|
463 | Example output: | |
462 |
|
464 | |||
463 | .. code-block:: bash |
|
465 | .. code-block:: bash | |
464 |
|
466 | |||
465 | id : <id_given_in_input> |
|
467 | id : <id_given_in_input> | |
466 | "result": { |
|
468 | "result": { | |
467 | "bookmarks": { |
|
469 | "bookmarks": { | |
468 | "dev": "5611d30200f4040ba2ab4f3d64e5b06408a02188", |
|
470 | "dev": "5611d30200f4040ba2ab4f3d64e5b06408a02188", | |
469 | "master": "367f590445081d8ec8c2ea0456e73ae1f1c3d6cf" |
|
471 | "master": "367f590445081d8ec8c2ea0456e73ae1f1c3d6cf" | |
470 | }, |
|
472 | }, | |
471 | "branches": { |
|
473 | "branches": { | |
472 | "default": "5611d30200f4040ba2ab4f3d64e5b06408a02188", |
|
474 | "default": "5611d30200f4040ba2ab4f3d64e5b06408a02188", | |
473 | "stable": "367f590445081d8ec8c2ea0456e73ae1f1c3d6cf" |
|
475 | "stable": "367f590445081d8ec8c2ea0456e73ae1f1c3d6cf" | |
474 | }, |
|
476 | }, | |
475 | "branches_closed": {}, |
|
477 | "branches_closed": {}, | |
476 | "tags": { |
|
478 | "tags": { | |
477 | "tip": "5611d30200f4040ba2ab4f3d64e5b06408a02188", |
|
479 | "tip": "5611d30200f4040ba2ab4f3d64e5b06408a02188", | |
478 | "v4.4.0": "1232313f9e6adac5ce5399c2a891dc1e72b79022", |
|
480 | "v4.4.0": "1232313f9e6adac5ce5399c2a891dc1e72b79022", | |
479 | "v4.4.1": "cbb9f1d329ae5768379cdec55a62ebdd546c4e27", |
|
481 | "v4.4.1": "cbb9f1d329ae5768379cdec55a62ebdd546c4e27", | |
480 | "v4.4.2": "24ffe44a27fcd1c5b6936144e176b9f6dd2f3a17", |
|
482 | "v4.4.2": "24ffe44a27fcd1c5b6936144e176b9f6dd2f3a17", | |
481 | } |
|
483 | } | |
482 | } |
|
484 | } | |
483 | error: null |
|
485 | error: null | |
484 |
|
486 | |||
485 |
|
487 | |||
486 | get_repo_settings |
|
488 | get_repo_settings | |
487 | ----------------- |
|
489 | ----------------- | |
488 |
|
490 | |||
489 | .. py:function:: get_repo_settings(apiuser, repoid, key=<Optional:None>) |
|
491 | .. py:function:: get_repo_settings(apiuser, repoid, key=<Optional:None>) | |
490 |
|
492 | |||
491 | Returns all settings for a repository. If key is given it only returns the |
|
493 | Returns all settings for a repository. If key is given it only returns the | |
492 | setting identified by the key or null. |
|
494 | setting identified by the key or null. | |
493 |
|
495 | |||
494 | :param apiuser: This is filled automatically from the |authtoken|. |
|
496 | :param apiuser: This is filled automatically from the |authtoken|. | |
495 | :type apiuser: AuthUser |
|
497 | :type apiuser: AuthUser | |
496 | :param repoid: The repository name or repository id. |
|
498 | :param repoid: The repository name or repository id. | |
497 | :type repoid: str or int |
|
499 | :type repoid: str or int | |
498 | :param key: Key of the setting to return. |
|
500 | :param key: Key of the setting to return. | |
499 | :type: key: Optional(str) |
|
501 | :type: key: Optional(str) | |
500 |
|
502 | |||
501 | Example output: |
|
503 | Example output: | |
502 |
|
504 | |||
503 | .. code-block:: bash |
|
505 | .. code-block:: bash | |
504 |
|
506 | |||
505 | { |
|
507 | { | |
506 | "error": null, |
|
508 | "error": null, | |
507 | "id": 237, |
|
509 | "id": 237, | |
508 | "result": { |
|
510 | "result": { | |
509 | "extensions_largefiles": true, |
|
511 | "extensions_largefiles": true, | |
510 | "extensions_evolve": true, |
|
512 | "extensions_evolve": true, | |
511 | "hooks_changegroup_push_logger": true, |
|
513 | "hooks_changegroup_push_logger": true, | |
512 | "hooks_changegroup_repo_size": false, |
|
514 | "hooks_changegroup_repo_size": false, | |
513 | "hooks_outgoing_pull_logger": true, |
|
515 | "hooks_outgoing_pull_logger": true, | |
514 | "phases_publish": "True", |
|
516 | "phases_publish": "True", | |
515 | "rhodecode_hg_use_rebase_for_merging": true, |
|
517 | "rhodecode_hg_use_rebase_for_merging": true, | |
516 | "rhodecode_pr_merge_enabled": true, |
|
518 | "rhodecode_pr_merge_enabled": true, | |
517 | "rhodecode_use_outdated_comments": true |
|
519 | "rhodecode_use_outdated_comments": true | |
518 | } |
|
520 | } | |
519 | } |
|
521 | } | |
520 |
|
522 | |||
521 |
|
523 | |||
522 | get_repos |
|
524 | get_repos | |
523 | --------- |
|
525 | --------- | |
524 |
|
526 | |||
525 | .. py:function:: get_repos(apiuser, root=<Optional:None>, traverse=<Optional:True>) |
|
527 | .. py:function:: get_repos(apiuser, root=<Optional:None>, traverse=<Optional:True>) | |
526 |
|
528 | |||
527 | Lists all existing repositories. |
|
529 | Lists all existing repositories. | |
528 |
|
530 | |||
529 | This command can only be run using an |authtoken| with admin rights, |
|
531 | This command can only be run using an |authtoken| with admin rights, | |
530 | or users with at least read rights to |repos|. |
|
532 | or users with at least read rights to |repos|. | |
531 |
|
533 | |||
532 | :param apiuser: This is filled automatically from the |authtoken|. |
|
534 | :param apiuser: This is filled automatically from the |authtoken|. | |
533 | :type apiuser: AuthUser |
|
535 | :type apiuser: AuthUser | |
534 | :param root: specify root repository group to fetch repositories. |
|
536 | :param root: specify root repository group to fetch repositories. | |
535 | filters the returned repositories to be members of given root group. |
|
537 | filters the returned repositories to be members of given root group. | |
536 | :type root: Optional(None) |
|
538 | :type root: Optional(None) | |
537 | :param traverse: traverse given root into subrepositories. With this flag |
|
539 | :param traverse: traverse given root into subrepositories. With this flag | |
538 | set to False, it will only return top-level repositories from `root`. |
|
540 | set to False, it will only return top-level repositories from `root`. | |
539 | if root is empty it will return just top-level repositories. |
|
541 | if root is empty it will return just top-level repositories. | |
540 | :type traverse: Optional(True) |
|
542 | :type traverse: Optional(True) | |
541 |
|
543 | |||
542 |
|
544 | |||
543 | Example output: |
|
545 | Example output: | |
544 |
|
546 | |||
545 | .. code-block:: bash |
|
547 | .. code-block:: bash | |
546 |
|
548 | |||
547 | id : <id_given_in_input> |
|
549 | id : <id_given_in_input> | |
548 | result: [ |
|
550 | result: [ | |
549 | { |
|
551 | { | |
550 | "repo_id" : "<repo_id>", |
|
552 | "repo_id" : "<repo_id>", | |
551 | "repo_name" : "<reponame>" |
|
553 | "repo_name" : "<reponame>" | |
552 | "repo_type" : "<repo_type>", |
|
554 | "repo_type" : "<repo_type>", | |
553 | "clone_uri" : "<clone_uri>", |
|
555 | "clone_uri" : "<clone_uri>", | |
554 | "private": : "<bool>", |
|
556 | "private": : "<bool>", | |
555 | "created_on" : "<datetimecreated>", |
|
557 | "created_on" : "<datetimecreated>", | |
556 | "description" : "<description>", |
|
558 | "description" : "<description>", | |
557 | "landing_rev": "<landing_rev>", |
|
559 | "landing_rev": "<landing_rev>", | |
558 | "owner": "<repo_owner>", |
|
560 | "owner": "<repo_owner>", | |
559 | "fork_of": "<name_of_fork_parent>", |
|
561 | "fork_of": "<name_of_fork_parent>", | |
560 | "enable_downloads": "<bool>", |
|
562 | "enable_downloads": "<bool>", | |
561 | "enable_locking": "<bool>", |
|
563 | "enable_locking": "<bool>", | |
562 | "enable_statistics": "<bool>", |
|
564 | "enable_statistics": "<bool>", | |
563 | }, |
|
565 | }, | |
564 | ... |
|
566 | ... | |
565 | ] |
|
567 | ] | |
566 | error: null |
|
568 | error: null | |
567 |
|
569 | |||
568 |
|
570 | |||
569 | grant_user_group_permission |
|
571 | grant_user_group_permission | |
570 | --------------------------- |
|
572 | --------------------------- | |
571 |
|
573 | |||
572 | .. py:function:: grant_user_group_permission(apiuser, repoid, usergroupid, perm) |
|
574 | .. py:function:: grant_user_group_permission(apiuser, repoid, usergroupid, perm) | |
573 |
|
575 | |||
574 | Grant permission for a user group on the specified repository, |
|
576 | Grant permission for a user group on the specified repository, | |
575 | or update existing permissions. |
|
577 | or update existing permissions. | |
576 |
|
578 | |||
577 | This command can only be run using an |authtoken| with admin |
|
579 | This command can only be run using an |authtoken| with admin | |
578 | permissions on the |repo|. |
|
580 | permissions on the |repo|. | |
579 |
|
581 | |||
580 | :param apiuser: This is filled automatically from the |authtoken|. |
|
582 | :param apiuser: This is filled automatically from the |authtoken|. | |
581 | :type apiuser: AuthUser |
|
583 | :type apiuser: AuthUser | |
582 | :param repoid: Set the repository name or repository ID. |
|
584 | :param repoid: Set the repository name or repository ID. | |
583 | :type repoid: str or int |
|
585 | :type repoid: str or int | |
584 | :param usergroupid: Specify the ID of the user group. |
|
586 | :param usergroupid: Specify the ID of the user group. | |
585 | :type usergroupid: str or int |
|
587 | :type usergroupid: str or int | |
586 | :param perm: Set the user group permissions using the following |
|
588 | :param perm: Set the user group permissions using the following | |
587 | format: (repository.(none|read|write|admin)) |
|
589 | format: (repository.(none|read|write|admin)) | |
588 | :type perm: str |
|
590 | :type perm: str | |
589 |
|
591 | |||
590 | Example output: |
|
592 | Example output: | |
591 |
|
593 | |||
592 | .. code-block:: bash |
|
594 | .. code-block:: bash | |
593 |
|
595 | |||
594 | id : <id_given_in_input> |
|
596 | id : <id_given_in_input> | |
595 | result : { |
|
597 | result : { | |
596 | "msg" : "Granted perm: `<perm>` for group: `<usersgroupname>` in repo: `<reponame>`", |
|
598 | "msg" : "Granted perm: `<perm>` for group: `<usersgroupname>` in repo: `<reponame>`", | |
597 | "success": true |
|
599 | "success": true | |
598 |
|
600 | |||
599 | } |
|
601 | } | |
600 | error : null |
|
602 | error : null | |
601 |
|
603 | |||
602 | Example error output: |
|
604 | Example error output: | |
603 |
|
605 | |||
604 | .. code-block:: bash |
|
606 | .. code-block:: bash | |
605 |
|
607 | |||
606 | id : <id_given_in_input> |
|
608 | id : <id_given_in_input> | |
607 | result : null |
|
609 | result : null | |
608 | error : { |
|
610 | error : { | |
609 | "failed to edit permission for user group: `<usergroup>` in repo `<repo>`' |
|
611 | "failed to edit permission for user group: `<usergroup>` in repo `<repo>`' | |
610 | } |
|
612 | } | |
611 |
|
613 | |||
612 |
|
614 | |||
613 | grant_user_permission |
|
615 | grant_user_permission | |
614 | --------------------- |
|
616 | --------------------- | |
615 |
|
617 | |||
616 | .. py:function:: grant_user_permission(apiuser, repoid, userid, perm) |
|
618 | .. py:function:: grant_user_permission(apiuser, repoid, userid, perm) | |
617 |
|
619 | |||
618 | Grant permissions for the specified user on the given repository, |
|
620 | Grant permissions for the specified user on the given repository, | |
619 | or update existing permissions if found. |
|
621 | or update existing permissions if found. | |
620 |
|
622 | |||
621 | This command can only be run using an |authtoken| with admin |
|
623 | This command can only be run using an |authtoken| with admin | |
622 | permissions on the |repo|. |
|
624 | permissions on the |repo|. | |
623 |
|
625 | |||
624 | :param apiuser: This is filled automatically from the |authtoken|. |
|
626 | :param apiuser: This is filled automatically from the |authtoken|. | |
625 | :type apiuser: AuthUser |
|
627 | :type apiuser: AuthUser | |
626 | :param repoid: Set the repository name or repository ID. |
|
628 | :param repoid: Set the repository name or repository ID. | |
627 | :type repoid: str or int |
|
629 | :type repoid: str or int | |
628 | :param userid: Set the user name. |
|
630 | :param userid: Set the user name. | |
629 | :type userid: str |
|
631 | :type userid: str | |
630 | :param perm: Set the user permissions, using the following format |
|
632 | :param perm: Set the user permissions, using the following format | |
631 | ``(repository.(none|read|write|admin))`` |
|
633 | ``(repository.(none|read|write|admin))`` | |
632 | :type perm: str |
|
634 | :type perm: str | |
633 |
|
635 | |||
634 | Example output: |
|
636 | Example output: | |
635 |
|
637 | |||
636 | .. code-block:: bash |
|
638 | .. code-block:: bash | |
637 |
|
639 | |||
638 | id : <id_given_in_input> |
|
640 | id : <id_given_in_input> | |
639 | result: { |
|
641 | result: { | |
640 | "msg" : "Granted perm: `<perm>` for user: `<username>` in repo: `<reponame>`", |
|
642 | "msg" : "Granted perm: `<perm>` for user: `<username>` in repo: `<reponame>`", | |
641 | "success": true |
|
643 | "success": true | |
642 | } |
|
644 | } | |
643 | error: null |
|
645 | error: null | |
644 |
|
646 | |||
645 |
|
647 | |||
646 | invalidate_cache |
|
648 | invalidate_cache | |
647 | ---------------- |
|
649 | ---------------- | |
648 |
|
650 | |||
649 | .. py:function:: invalidate_cache(apiuser, repoid, delete_keys=<Optional:False>) |
|
651 | .. py:function:: invalidate_cache(apiuser, repoid, delete_keys=<Optional:False>) | |
650 |
|
652 | |||
651 | Invalidates the cache for the specified repository. |
|
653 | Invalidates the cache for the specified repository. | |
652 |
|
654 | |||
653 | This command can only be run using an |authtoken| with admin rights to |
|
655 | This command can only be run using an |authtoken| with admin rights to | |
654 | the specified repository. |
|
656 | the specified repository. | |
655 |
|
657 | |||
656 | This command takes the following options: |
|
658 | This command takes the following options: | |
657 |
|
659 | |||
658 | :param apiuser: This is filled automatically from |authtoken|. |
|
660 | :param apiuser: This is filled automatically from |authtoken|. | |
659 | :type apiuser: AuthUser |
|
661 | :type apiuser: AuthUser | |
660 | :param repoid: Sets the repository name or repository ID. |
|
662 | :param repoid: Sets the repository name or repository ID. | |
661 | :type repoid: str or int |
|
663 | :type repoid: str or int | |
662 | :param delete_keys: This deletes the invalidated keys instead of |
|
664 | :param delete_keys: This deletes the invalidated keys instead of | |
663 | just flagging them. |
|
665 | just flagging them. | |
664 | :type delete_keys: Optional(``True`` | ``False``) |
|
666 | :type delete_keys: Optional(``True`` | ``False``) | |
665 |
|
667 | |||
666 | Example output: |
|
668 | Example output: | |
667 |
|
669 | |||
668 | .. code-block:: bash |
|
670 | .. code-block:: bash | |
669 |
|
671 | |||
670 | id : <id_given_in_input> |
|
672 | id : <id_given_in_input> | |
671 | result : { |
|
673 | result : { | |
672 | 'msg': Cache for repository `<repository name>` was invalidated, |
|
674 | 'msg': Cache for repository `<repository name>` was invalidated, | |
673 | 'repository': <repository name> |
|
675 | 'repository': <repository name> | |
674 | } |
|
676 | } | |
675 | error : null |
|
677 | error : null | |
676 |
|
678 | |||
677 | Example error output: |
|
679 | Example error output: | |
678 |
|
680 | |||
679 | .. code-block:: bash |
|
681 | .. code-block:: bash | |
680 |
|
682 | |||
681 | id : <id_given_in_input> |
|
683 | id : <id_given_in_input> | |
682 | result : null |
|
684 | result : null | |
683 | error : { |
|
685 | error : { | |
684 | 'Error occurred during cache invalidation action' |
|
686 | 'Error occurred during cache invalidation action' | |
685 | } |
|
687 | } | |
686 |
|
688 | |||
687 |
|
689 | |||
688 | lock |
|
690 | lock | |
689 | ---- |
|
691 | ---- | |
690 |
|
692 | |||
691 | .. py:function:: lock(apiuser, repoid, locked=<Optional:None>, userid=<Optional:<OptionalAttr:apiuser>>) |
|
693 | .. py:function:: lock(apiuser, repoid, locked=<Optional:None>, userid=<Optional:<OptionalAttr:apiuser>>) | |
692 |
|
694 | |||
693 | Sets the lock state of the specified |repo| by the given user. |
|
695 | Sets the lock state of the specified |repo| by the given user. | |
694 | From more information, see :ref:`repo-locking`. |
|
696 | From more information, see :ref:`repo-locking`. | |
695 |
|
697 | |||
696 | * If the ``userid`` option is not set, the repository is locked to the |
|
698 | * If the ``userid`` option is not set, the repository is locked to the | |
697 | user who called the method. |
|
699 | user who called the method. | |
698 | * If the ``locked`` parameter is not set, the current lock state of the |
|
700 | * If the ``locked`` parameter is not set, the current lock state of the | |
699 | repository is displayed. |
|
701 | repository is displayed. | |
700 |
|
702 | |||
701 | This command can only be run using an |authtoken| with admin rights to |
|
703 | This command can only be run using an |authtoken| with admin rights to | |
702 | the specified repository. |
|
704 | the specified repository. | |
703 |
|
705 | |||
704 | This command takes the following options: |
|
706 | This command takes the following options: | |
705 |
|
707 | |||
706 | :param apiuser: This is filled automatically from the |authtoken|. |
|
708 | :param apiuser: This is filled automatically from the |authtoken|. | |
707 | :type apiuser: AuthUser |
|
709 | :type apiuser: AuthUser | |
708 | :param repoid: Sets the repository name or repository ID. |
|
710 | :param repoid: Sets the repository name or repository ID. | |
709 | :type repoid: str or int |
|
711 | :type repoid: str or int | |
710 | :param locked: Sets the lock state. |
|
712 | :param locked: Sets the lock state. | |
711 | :type locked: Optional(``True`` | ``False``) |
|
713 | :type locked: Optional(``True`` | ``False``) | |
712 | :param userid: Set the repository lock to this user. |
|
714 | :param userid: Set the repository lock to this user. | |
713 | :type userid: Optional(str or int) |
|
715 | :type userid: Optional(str or int) | |
714 |
|
716 | |||
715 | Example error output: |
|
717 | Example error output: | |
716 |
|
718 | |||
717 | .. code-block:: bash |
|
719 | .. code-block:: bash | |
718 |
|
720 | |||
719 | id : <id_given_in_input> |
|
721 | id : <id_given_in_input> | |
720 | result : { |
|
722 | result : { | |
721 | 'repo': '<reponame>', |
|
723 | 'repo': '<reponame>', | |
722 | 'locked': <bool: lock state>, |
|
724 | 'locked': <bool: lock state>, | |
723 | 'locked_since': <int: lock timestamp>, |
|
725 | 'locked_since': <int: lock timestamp>, | |
724 | 'locked_by': <username of person who made the lock>, |
|
726 | 'locked_by': <username of person who made the lock>, | |
725 | 'lock_reason': <str: reason for locking>, |
|
727 | 'lock_reason': <str: reason for locking>, | |
726 | 'lock_state_changed': <bool: True if lock state has been changed in this request>, |
|
728 | 'lock_state_changed': <bool: True if lock state has been changed in this request>, | |
727 | 'msg': 'Repo `<reponame>` locked by `<username>` on <timestamp>.' |
|
729 | 'msg': 'Repo `<reponame>` locked by `<username>` on <timestamp>.' | |
728 | or |
|
730 | or | |
729 | 'msg': 'Repo `<repository name>` not locked.' |
|
731 | 'msg': 'Repo `<repository name>` not locked.' | |
730 | or |
|
732 | or | |
731 | 'msg': 'User `<user name>` set lock state for repo `<repository name>` to `<new lock state>`' |
|
733 | 'msg': 'User `<user name>` set lock state for repo `<repository name>` to `<new lock state>`' | |
732 | } |
|
734 | } | |
733 | error : null |
|
735 | error : null | |
734 |
|
736 | |||
735 | Example error output: |
|
737 | Example error output: | |
736 |
|
738 | |||
737 | .. code-block:: bash |
|
739 | .. code-block:: bash | |
738 |
|
740 | |||
739 | id : <id_given_in_input> |
|
741 | id : <id_given_in_input> | |
740 | result : null |
|
742 | result : null | |
741 | error : { |
|
743 | error : { | |
742 | 'Error occurred locking repository `<reponame>`' |
|
744 | 'Error occurred locking repository `<reponame>`' | |
743 | } |
|
745 | } | |
744 |
|
746 | |||
745 |
|
747 | |||
746 | maintenance |
|
748 | maintenance | |
747 | ----------- |
|
749 | ----------- | |
748 |
|
750 | |||
749 | .. py:function:: maintenance(apiuser, repoid) |
|
751 | .. py:function:: maintenance(apiuser, repoid) | |
750 |
|
752 | |||
751 | Triggers a maintenance on the given repository. |
|
753 | Triggers a maintenance on the given repository. | |
752 |
|
754 | |||
753 | This command can only be run using an |authtoken| with admin |
|
755 | This command can only be run using an |authtoken| with admin | |
754 | rights to the specified repository. For more information, |
|
756 | rights to the specified repository. For more information, | |
755 | see :ref:`config-token-ref`. |
|
757 | see :ref:`config-token-ref`. | |
756 |
|
758 | |||
757 | This command takes the following options: |
|
759 | This command takes the following options: | |
758 |
|
760 | |||
759 | :param apiuser: This is filled automatically from the |authtoken|. |
|
761 | :param apiuser: This is filled automatically from the |authtoken|. | |
760 | :type apiuser: AuthUser |
|
762 | :type apiuser: AuthUser | |
761 | :param repoid: The repository name or repository ID. |
|
763 | :param repoid: The repository name or repository ID. | |
762 | :type repoid: str or int |
|
764 | :type repoid: str or int | |
763 |
|
765 | |||
764 | Example output: |
|
766 | Example output: | |
765 |
|
767 | |||
766 | .. code-block:: bash |
|
768 | .. code-block:: bash | |
767 |
|
769 | |||
768 | id : <id_given_in_input> |
|
770 | id : <id_given_in_input> | |
769 | result : { |
|
771 | result : { | |
770 | "msg": "executed maintenance command", |
|
772 | "msg": "executed maintenance command", | |
771 | "executed_actions": [ |
|
773 | "executed_actions": [ | |
772 | <action_message>, <action_message2>... |
|
774 | <action_message>, <action_message2>... | |
773 | ], |
|
775 | ], | |
774 | "repository": "<repository name>" |
|
776 | "repository": "<repository name>" | |
775 | } |
|
777 | } | |
776 | error : null |
|
778 | error : null | |
777 |
|
779 | |||
778 | Example error output: |
|
780 | Example error output: | |
779 |
|
781 | |||
780 | .. code-block:: bash |
|
782 | .. code-block:: bash | |
781 |
|
783 | |||
782 | id : <id_given_in_input> |
|
784 | id : <id_given_in_input> | |
783 | result : null |
|
785 | result : null | |
784 | error : { |
|
786 | error : { | |
785 | "Unable to execute maintenance on `<reponame>`" |
|
787 | "Unable to execute maintenance on `<reponame>`" | |
786 | } |
|
788 | } | |
787 |
|
789 | |||
788 |
|
790 | |||
789 | pull |
|
791 | pull | |
790 | ---- |
|
792 | ---- | |
791 |
|
793 | |||
792 | .. py:function:: pull(apiuser, repoid) |
|
794 | .. py:function:: pull(apiuser, repoid, remote_uri=<Optional:None>) | |
793 |
|
795 | |||
794 | Triggers a pull on the given repository from a remote location. You |
|
796 | Triggers a pull on the given repository from a remote location. You | |
795 | can use this to keep remote repositories up-to-date. |
|
797 | can use this to keep remote repositories up-to-date. | |
796 |
|
798 | |||
797 | This command can only be run using an |authtoken| with admin |
|
799 | This command can only be run using an |authtoken| with admin | |
798 | rights to the specified repository. For more information, |
|
800 | rights to the specified repository. For more information, | |
799 | see :ref:`config-token-ref`. |
|
801 | see :ref:`config-token-ref`. | |
800 |
|
802 | |||
801 | This command takes the following options: |
|
803 | This command takes the following options: | |
802 |
|
804 | |||
803 | :param apiuser: This is filled automatically from the |authtoken|. |
|
805 | :param apiuser: This is filled automatically from the |authtoken|. | |
804 | :type apiuser: AuthUser |
|
806 | :type apiuser: AuthUser | |
805 | :param repoid: The repository name or repository ID. |
|
807 | :param repoid: The repository name or repository ID. | |
806 | :type repoid: str or int |
|
808 | :type repoid: str or int | |
|
809 | :param remote_uri: Optional remote URI to pass in for pull | |||
|
810 | :type remote_uri: str | |||
807 |
|
811 | |||
808 | Example output: |
|
812 | Example output: | |
809 |
|
813 | |||
810 | .. code-block:: bash |
|
814 | .. code-block:: bash | |
811 |
|
815 | |||
812 | id : <id_given_in_input> |
|
816 | id : <id_given_in_input> | |
813 | result : { |
|
817 | result : { | |
814 | "msg": "Pulled from `<repository name>`" |
|
818 | "msg": "Pulled from url `<remote_url>` on repo `<repository name>`" | |
815 | "repository": "<repository name>" |
|
819 | "repository": "<repository name>" | |
816 | } |
|
820 | } | |
817 | error : null |
|
821 | error : null | |
818 |
|
822 | |||
819 | Example error output: |
|
823 | Example error output: | |
820 |
|
824 | |||
821 | .. code-block:: bash |
|
825 | .. code-block:: bash | |
822 |
|
826 | |||
823 | id : <id_given_in_input> |
|
827 | id : <id_given_in_input> | |
824 | result : null |
|
828 | result : null | |
825 | error : { |
|
829 | error : { | |
826 |
"Unable to pu |
|
830 | "Unable to push changes from `<remote_url>`" | |
827 | } |
|
831 | } | |
828 |
|
832 | |||
829 |
|
833 | |||
830 | remove_field_from_repo |
|
834 | remove_field_from_repo | |
831 | ---------------------- |
|
835 | ---------------------- | |
832 |
|
836 | |||
833 | .. py:function:: remove_field_from_repo(apiuser, repoid, key) |
|
837 | .. py:function:: remove_field_from_repo(apiuser, repoid, key) | |
834 |
|
838 | |||
835 | Removes an extra field from a repository. |
|
839 | Removes an extra field from a repository. | |
836 |
|
840 | |||
837 | This command can only be run using an |authtoken| with at least |
|
841 | This command can only be run using an |authtoken| with at least | |
838 | write permissions to the |repo|. |
|
842 | write permissions to the |repo|. | |
839 |
|
843 | |||
840 | :param apiuser: This is filled automatically from the |authtoken|. |
|
844 | :param apiuser: This is filled automatically from the |authtoken|. | |
841 | :type apiuser: AuthUser |
|
845 | :type apiuser: AuthUser | |
842 | :param repoid: Set the repository name or repository ID. |
|
846 | :param repoid: Set the repository name or repository ID. | |
843 | :type repoid: str or int |
|
847 | :type repoid: str or int | |
844 | :param key: Set the unique field key for this repository. |
|
848 | :param key: Set the unique field key for this repository. | |
845 | :type key: str |
|
849 | :type key: str | |
846 |
|
850 | |||
847 |
|
851 | |||
848 | revoke_user_group_permission |
|
852 | revoke_user_group_permission | |
849 | ---------------------------- |
|
853 | ---------------------------- | |
850 |
|
854 | |||
851 | .. py:function:: revoke_user_group_permission(apiuser, repoid, usergroupid) |
|
855 | .. py:function:: revoke_user_group_permission(apiuser, repoid, usergroupid) | |
852 |
|
856 | |||
853 | Revoke the permissions of a user group on a given repository. |
|
857 | Revoke the permissions of a user group on a given repository. | |
854 |
|
858 | |||
855 | This command can only be run using an |authtoken| with admin |
|
859 | This command can only be run using an |authtoken| with admin | |
856 | permissions on the |repo|. |
|
860 | permissions on the |repo|. | |
857 |
|
861 | |||
858 | :param apiuser: This is filled automatically from the |authtoken|. |
|
862 | :param apiuser: This is filled automatically from the |authtoken|. | |
859 | :type apiuser: AuthUser |
|
863 | :type apiuser: AuthUser | |
860 | :param repoid: Set the repository name or repository ID. |
|
864 | :param repoid: Set the repository name or repository ID. | |
861 | :type repoid: str or int |
|
865 | :type repoid: str or int | |
862 | :param usergroupid: Specify the user group ID. |
|
866 | :param usergroupid: Specify the user group ID. | |
863 | :type usergroupid: str or int |
|
867 | :type usergroupid: str or int | |
864 |
|
868 | |||
865 | Example output: |
|
869 | Example output: | |
866 |
|
870 | |||
867 | .. code-block:: bash |
|
871 | .. code-block:: bash | |
868 |
|
872 | |||
869 | id : <id_given_in_input> |
|
873 | id : <id_given_in_input> | |
870 | result: { |
|
874 | result: { | |
871 | "msg" : "Revoked perm for group: `<usersgroupname>` in repo: `<reponame>`", |
|
875 | "msg" : "Revoked perm for group: `<usersgroupname>` in repo: `<reponame>`", | |
872 | "success": true |
|
876 | "success": true | |
873 | } |
|
877 | } | |
874 | error: null |
|
878 | error: null | |
875 |
|
879 | |||
876 |
|
880 | |||
877 | revoke_user_permission |
|
881 | revoke_user_permission | |
878 | ---------------------- |
|
882 | ---------------------- | |
879 |
|
883 | |||
880 | .. py:function:: revoke_user_permission(apiuser, repoid, userid) |
|
884 | .. py:function:: revoke_user_permission(apiuser, repoid, userid) | |
881 |
|
885 | |||
882 | Revoke permission for a user on the specified repository. |
|
886 | Revoke permission for a user on the specified repository. | |
883 |
|
887 | |||
884 | This command can only be run using an |authtoken| with admin |
|
888 | This command can only be run using an |authtoken| with admin | |
885 | permissions on the |repo|. |
|
889 | permissions on the |repo|. | |
886 |
|
890 | |||
887 | :param apiuser: This is filled automatically from the |authtoken|. |
|
891 | :param apiuser: This is filled automatically from the |authtoken|. | |
888 | :type apiuser: AuthUser |
|
892 | :type apiuser: AuthUser | |
889 | :param repoid: Set the repository name or repository ID. |
|
893 | :param repoid: Set the repository name or repository ID. | |
890 | :type repoid: str or int |
|
894 | :type repoid: str or int | |
891 | :param userid: Set the user name of revoked user. |
|
895 | :param userid: Set the user name of revoked user. | |
892 | :type userid: str or int |
|
896 | :type userid: str or int | |
893 |
|
897 | |||
894 | Example error output: |
|
898 | Example error output: | |
895 |
|
899 | |||
896 | .. code-block:: bash |
|
900 | .. code-block:: bash | |
897 |
|
901 | |||
898 | id : <id_given_in_input> |
|
902 | id : <id_given_in_input> | |
899 | result: { |
|
903 | result: { | |
900 | "msg" : "Revoked perm for user: `<username>` in repo: `<reponame>`", |
|
904 | "msg" : "Revoked perm for user: `<username>` in repo: `<reponame>`", | |
901 | "success": true |
|
905 | "success": true | |
902 | } |
|
906 | } | |
903 | error: null |
|
907 | error: null | |
904 |
|
908 | |||
905 |
|
909 | |||
906 | set_repo_settings |
|
910 | set_repo_settings | |
907 | ----------------- |
|
911 | ----------------- | |
908 |
|
912 | |||
909 | .. py:function:: set_repo_settings(apiuser, repoid, settings) |
|
913 | .. py:function:: set_repo_settings(apiuser, repoid, settings) | |
910 |
|
914 | |||
911 | Update repository settings. Returns true on success. |
|
915 | Update repository settings. Returns true on success. | |
912 |
|
916 | |||
913 | :param apiuser: This is filled automatically from the |authtoken|. |
|
917 | :param apiuser: This is filled automatically from the |authtoken|. | |
914 | :type apiuser: AuthUser |
|
918 | :type apiuser: AuthUser | |
915 | :param repoid: The repository name or repository id. |
|
919 | :param repoid: The repository name or repository id. | |
916 | :type repoid: str or int |
|
920 | :type repoid: str or int | |
917 | :param settings: The new settings for the repository. |
|
921 | :param settings: The new settings for the repository. | |
918 | :type: settings: dict |
|
922 | :type: settings: dict | |
919 |
|
923 | |||
920 | Example output: |
|
924 | Example output: | |
921 |
|
925 | |||
922 | .. code-block:: bash |
|
926 | .. code-block:: bash | |
923 |
|
927 | |||
924 | { |
|
928 | { | |
925 | "error": null, |
|
929 | "error": null, | |
926 | "id": 237, |
|
930 | "id": 237, | |
927 | "result": true |
|
931 | "result": true | |
928 | } |
|
932 | } | |
929 |
|
933 | |||
930 |
|
934 | |||
931 | strip |
|
935 | strip | |
932 | ----- |
|
936 | ----- | |
933 |
|
937 | |||
934 | .. py:function:: strip(apiuser, repoid, revision, branch) |
|
938 | .. py:function:: strip(apiuser, repoid, revision, branch) | |
935 |
|
939 | |||
936 | Strips the given revision from the specified repository. |
|
940 | Strips the given revision from the specified repository. | |
937 |
|
941 | |||
938 | * This will remove the revision and all of its decendants. |
|
942 | * This will remove the revision and all of its decendants. | |
939 |
|
943 | |||
940 | This command can only be run using an |authtoken| with admin rights to |
|
944 | This command can only be run using an |authtoken| with admin rights to | |
941 | the specified repository. |
|
945 | the specified repository. | |
942 |
|
946 | |||
943 | This command takes the following options: |
|
947 | This command takes the following options: | |
944 |
|
948 | |||
945 | :param apiuser: This is filled automatically from the |authtoken|. |
|
949 | :param apiuser: This is filled automatically from the |authtoken|. | |
946 | :type apiuser: AuthUser |
|
950 | :type apiuser: AuthUser | |
947 | :param repoid: The repository name or repository ID. |
|
951 | :param repoid: The repository name or repository ID. | |
948 | :type repoid: str or int |
|
952 | :type repoid: str or int | |
949 | :param revision: The revision you wish to strip. |
|
953 | :param revision: The revision you wish to strip. | |
950 | :type revision: str |
|
954 | :type revision: str | |
951 | :param branch: The branch from which to strip the revision. |
|
955 | :param branch: The branch from which to strip the revision. | |
952 | :type branch: str |
|
956 | :type branch: str | |
953 |
|
957 | |||
954 | Example output: |
|
958 | Example output: | |
955 |
|
959 | |||
956 | .. code-block:: bash |
|
960 | .. code-block:: bash | |
957 |
|
961 | |||
958 | id : <id_given_in_input> |
|
962 | id : <id_given_in_input> | |
959 | result : { |
|
963 | result : { | |
960 | "msg": "'Stripped commit <commit_hash> from repo `<repository name>`'" |
|
964 | "msg": "'Stripped commit <commit_hash> from repo `<repository name>`'" | |
961 | "repository": "<repository name>" |
|
965 | "repository": "<repository name>" | |
962 | } |
|
966 | } | |
963 | error : null |
|
967 | error : null | |
964 |
|
968 | |||
965 | Example error output: |
|
969 | Example error output: | |
966 |
|
970 | |||
967 | .. code-block:: bash |
|
971 | .. code-block:: bash | |
968 |
|
972 | |||
969 | id : <id_given_in_input> |
|
973 | id : <id_given_in_input> | |
970 | result : null |
|
974 | result : null | |
971 | error : { |
|
975 | error : { | |
972 | "Unable to strip commit <commit_hash> from repo `<repository name>`" |
|
976 | "Unable to strip commit <commit_hash> from repo `<repository name>`" | |
973 | } |
|
977 | } | |
974 |
|
978 | |||
975 |
|
979 | |||
976 | update_repo |
|
980 | update_repo | |
977 | ----------- |
|
981 | ----------- | |
978 |
|
982 | |||
979 | .. 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:''>) |
|
983 | .. py:function:: update_repo(apiuser, repoid, repo_name=<Optional:None>, owner=<Optional:<OptionalAttr:apiuser>>, description=<Optional:''>, private=<Optional:False>, clone_uri=<Optional:None>, push_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:''>) | |
980 |
|
984 | |||
981 | Updates a repository with the given information. |
|
985 | Updates a repository with the given information. | |
982 |
|
986 | |||
983 | This command can only be run using an |authtoken| with at least |
|
987 | This command can only be run using an |authtoken| with at least | |
984 | admin permissions to the |repo|. |
|
988 | admin permissions to the |repo|. | |
985 |
|
989 | |||
986 | * If the repository name contains "/", repository will be updated |
|
990 | * If the repository name contains "/", repository will be updated | |
987 | accordingly with a repository group or nested repository groups |
|
991 | accordingly with a repository group or nested repository groups | |
988 |
|
992 | |||
989 | For example repoid=repo-test name="foo/bar/repo-test" will update |repo| |
|
993 | For example repoid=repo-test name="foo/bar/repo-test" will update |repo| | |
990 | called "repo-test" and place it inside group "foo/bar". |
|
994 | called "repo-test" and place it inside group "foo/bar". | |
991 | You have to have permissions to access and write to the last repository |
|
995 | You have to have permissions to access and write to the last repository | |
992 | group ("bar" in this example) |
|
996 | group ("bar" in this example) | |
993 |
|
997 | |||
994 | :param apiuser: This is filled automatically from the |authtoken|. |
|
998 | :param apiuser: This is filled automatically from the |authtoken|. | |
995 | :type apiuser: AuthUser |
|
999 | :type apiuser: AuthUser | |
996 | :param repoid: repository name or repository ID. |
|
1000 | :param repoid: repository name or repository ID. | |
997 | :type repoid: str or int |
|
1001 | :type repoid: str or int | |
998 | :param repo_name: Update the |repo| name, including the |
|
1002 | :param repo_name: Update the |repo| name, including the | |
999 | repository group it's in. |
|
1003 | repository group it's in. | |
1000 | :type repo_name: str |
|
1004 | :type repo_name: str | |
1001 | :param owner: Set the |repo| owner. |
|
1005 | :param owner: Set the |repo| owner. | |
1002 | :type owner: str |
|
1006 | :type owner: str | |
1003 | :param fork_of: Set the |repo| as fork of another |repo|. |
|
1007 | :param fork_of: Set the |repo| as fork of another |repo|. | |
1004 | :type fork_of: str |
|
1008 | :type fork_of: str | |
1005 | :param description: Update the |repo| description. |
|
1009 | :param description: Update the |repo| description. | |
1006 | :type description: str |
|
1010 | :type description: str | |
1007 | :param private: Set the |repo| as private. (True | False) |
|
1011 | :param private: Set the |repo| as private. (True | False) | |
1008 | :type private: bool |
|
1012 | :type private: bool | |
1009 | :param clone_uri: Update the |repo| clone URI. |
|
1013 | :param clone_uri: Update the |repo| clone URI. | |
1010 | :type clone_uri: str |
|
1014 | :type clone_uri: str | |
1011 | :param landing_rev: Set the |repo| landing revision. Default is ``rev:tip``. |
|
1015 | :param landing_rev: Set the |repo| landing revision. Default is ``rev:tip``. | |
1012 | :type landing_rev: str |
|
1016 | :type landing_rev: str | |
1013 | :param enable_statistics: Enable statistics on the |repo|, (True | False). |
|
1017 | :param enable_statistics: Enable statistics on the |repo|, (True | False). | |
1014 | :type enable_statistics: bool |
|
1018 | :type enable_statistics: bool | |
1015 | :param enable_locking: Enable |repo| locking. |
|
1019 | :param enable_locking: Enable |repo| locking. | |
1016 | :type enable_locking: bool |
|
1020 | :type enable_locking: bool | |
1017 | :param enable_downloads: Enable downloads from the |repo|, (True | False). |
|
1021 | :param enable_downloads: Enable downloads from the |repo|, (True | False). | |
1018 | :type enable_downloads: bool |
|
1022 | :type enable_downloads: bool | |
1019 | :param fields: Add extra fields to the |repo|. Use the following |
|
1023 | :param fields: Add extra fields to the |repo|. Use the following | |
1020 | example format: ``field_key=field_val,field_key2=fieldval2``. |
|
1024 | example format: ``field_key=field_val,field_key2=fieldval2``. | |
1021 | Escape ', ' with \, |
|
1025 | Escape ', ' with \, | |
1022 | :type fields: str |
|
1026 | :type fields: str | |
1023 |
|
1027 | |||
1024 |
|
1028 |
@@ -1,412 +1,418 b'' | |||||
1 | .. _user-group-methods-ref: |
|
1 | .. _user-group-methods-ref: | |
2 |
|
2 | |||
3 | user_group methods |
|
3 | user_group methods | |
4 | ================== |
|
4 | ================== | |
5 |
|
5 | |||
6 | add_user_to_user_group |
|
6 | add_user_to_user_group | |
7 | ---------------------- |
|
7 | ---------------------- | |
8 |
|
8 | |||
9 | .. py:function:: add_user_to_user_group(apiuser, usergroupid, userid) |
|
9 | .. py:function:: add_user_to_user_group(apiuser, usergroupid, userid) | |
10 |
|
10 | |||
11 | Adds a user to a `user group`. If the user already exists in the group |
|
11 | Adds a user to a `user group`. If the user already exists in the group | |
12 | this command will return false. |
|
12 | this command will return false. | |
13 |
|
13 | |||
14 | This command can only be run using an |authtoken| with admin rights to |
|
14 | This command can only be run using an |authtoken| with admin rights to | |
15 | the specified user group. |
|
15 | the specified user group. | |
16 |
|
16 | |||
17 | This command takes the following options: |
|
17 | This command takes the following options: | |
18 |
|
18 | |||
19 | :param apiuser: This is filled automatically from the |authtoken|. |
|
19 | :param apiuser: This is filled automatically from the |authtoken|. | |
20 | :type apiuser: AuthUser |
|
20 | :type apiuser: AuthUser | |
21 | :param usergroupid: Set the name of the `user group` to which a |
|
21 | :param usergroupid: Set the name of the `user group` to which a | |
22 | user will be added. |
|
22 | user will be added. | |
23 | :type usergroupid: int |
|
23 | :type usergroupid: int | |
24 | :param userid: Set the `user_id` of the user to add to the group. |
|
24 | :param userid: Set the `user_id` of the user to add to the group. | |
25 | :type userid: int |
|
25 | :type userid: int | |
26 |
|
26 | |||
27 | Example output: |
|
27 | Example output: | |
28 |
|
28 | |||
29 | .. code-block:: bash |
|
29 | .. code-block:: bash | |
30 |
|
30 | |||
31 | id : <id_given_in_input> |
|
31 | id : <id_given_in_input> | |
32 | result : { |
|
32 | result : { | |
33 | "success": True|False # depends on if member is in group |
|
33 | "success": True|False # depends on if member is in group | |
34 | "msg": "added member `<username>` to user group `<groupname>` | |
|
34 | "msg": "added member `<username>` to user group `<groupname>` | | |
35 | User is already in that group" |
|
35 | User is already in that group" | |
36 |
|
36 | |||
37 | } |
|
37 | } | |
38 | error : null |
|
38 | error : null | |
39 |
|
39 | |||
40 | Example error output: |
|
40 | Example error output: | |
41 |
|
41 | |||
42 | .. code-block:: bash |
|
42 | .. code-block:: bash | |
43 |
|
43 | |||
44 | id : <id_given_in_input> |
|
44 | id : <id_given_in_input> | |
45 | result : null |
|
45 | result : null | |
46 | error : { |
|
46 | error : { | |
47 | "failed to add member to user group `<user_group_name>`" |
|
47 | "failed to add member to user group `<user_group_name>`" | |
48 | } |
|
48 | } | |
49 |
|
49 | |||
50 |
|
50 | |||
51 | create_user_group |
|
51 | create_user_group | |
52 | ----------------- |
|
52 | ----------------- | |
53 |
|
53 | |||
54 | .. py:function:: create_user_group(apiuser, group_name, description=<Optional:''>, owner=<Optional:<OptionalAttr:apiuser>>, active=<Optional:True>) |
|
54 | .. py:function:: create_user_group(apiuser, group_name, description=<Optional:''>, owner=<Optional:<OptionalAttr:apiuser>>, active=<Optional:True>, sync=<Optional:None>) | |
55 |
|
55 | |||
56 | Creates a new user group. |
|
56 | Creates a new user group. | |
57 |
|
57 | |||
58 | This command can only be run using an |authtoken| with admin rights to |
|
58 | This command can only be run using an |authtoken| with admin rights to | |
59 | the specified repository. |
|
59 | the specified repository. | |
60 |
|
60 | |||
61 | This command takes the following options: |
|
61 | This command takes the following options: | |
62 |
|
62 | |||
63 | :param apiuser: This is filled automatically from the |authtoken|. |
|
63 | :param apiuser: This is filled automatically from the |authtoken|. | |
64 | :type apiuser: AuthUser |
|
64 | :type apiuser: AuthUser | |
65 | :param group_name: Set the name of the new user group. |
|
65 | :param group_name: Set the name of the new user group. | |
66 | :type group_name: str |
|
66 | :type group_name: str | |
67 | :param description: Give a description of the new user group. |
|
67 | :param description: Give a description of the new user group. | |
68 | :type description: str |
|
68 | :type description: str | |
69 | :param owner: Set the owner of the new user group. |
|
69 | :param owner: Set the owner of the new user group. | |
70 | If not set, the owner is the |authtoken| user. |
|
70 | If not set, the owner is the |authtoken| user. | |
71 | :type owner: Optional(str or int) |
|
71 | :type owner: Optional(str or int) | |
72 | :param active: Set this group as active. |
|
72 | :param active: Set this group as active. | |
73 | :type active: Optional(``True`` | ``False``) |
|
73 | :type active: Optional(``True`` | ``False``) | |
|
74 | :param sync: Set enabled or disabled the automatically sync from | |||
|
75 | external authentication types like ldap. | |||
|
76 | :type sync: Optional(``True`` | ``False``) | |||
74 |
|
77 | |||
75 | Example output: |
|
78 | Example output: | |
76 |
|
79 | |||
77 | .. code-block:: bash |
|
80 | .. code-block:: bash | |
78 |
|
81 | |||
79 | id : <id_given_in_input> |
|
82 | id : <id_given_in_input> | |
80 | result: { |
|
83 | result: { | |
81 | "msg": "created new user group `<groupname>`", |
|
84 | "msg": "created new user group `<groupname>`", | |
82 | "user_group": <user_group_object> |
|
85 | "user_group": <user_group_object> | |
83 | } |
|
86 | } | |
84 | error: null |
|
87 | error: null | |
85 |
|
88 | |||
86 | Example error output: |
|
89 | Example error output: | |
87 |
|
90 | |||
88 | .. code-block:: bash |
|
91 | .. code-block:: bash | |
89 |
|
92 | |||
90 | id : <id_given_in_input> |
|
93 | id : <id_given_in_input> | |
91 | result : null |
|
94 | result : null | |
92 | error : { |
|
95 | error : { | |
93 | "user group `<group name>` already exist" |
|
96 | "user group `<group name>` already exist" | |
94 | or |
|
97 | or | |
95 | "failed to create group `<group name>`" |
|
98 | "failed to create group `<group name>`" | |
96 | } |
|
99 | } | |
97 |
|
100 | |||
98 |
|
101 | |||
99 | delete_user_group |
|
102 | delete_user_group | |
100 | ----------------- |
|
103 | ----------------- | |
101 |
|
104 | |||
102 | .. py:function:: delete_user_group(apiuser, usergroupid) |
|
105 | .. py:function:: delete_user_group(apiuser, usergroupid) | |
103 |
|
106 | |||
104 | Deletes the specified `user group`. |
|
107 | Deletes the specified `user group`. | |
105 |
|
108 | |||
106 | This command can only be run using an |authtoken| with admin rights to |
|
109 | This command can only be run using an |authtoken| with admin rights to | |
107 | the specified repository. |
|
110 | the specified repository. | |
108 |
|
111 | |||
109 | This command takes the following options: |
|
112 | This command takes the following options: | |
110 |
|
113 | |||
111 | :param apiuser: filled automatically from apikey |
|
114 | :param apiuser: filled automatically from apikey | |
112 | :type apiuser: AuthUser |
|
115 | :type apiuser: AuthUser | |
113 | :param usergroupid: |
|
116 | :param usergroupid: | |
114 | :type usergroupid: int |
|
117 | :type usergroupid: int | |
115 |
|
118 | |||
116 | Example output: |
|
119 | Example output: | |
117 |
|
120 | |||
118 | .. code-block:: bash |
|
121 | .. code-block:: bash | |
119 |
|
122 | |||
120 | id : <id_given_in_input> |
|
123 | id : <id_given_in_input> | |
121 | result : { |
|
124 | result : { | |
122 | "msg": "deleted user group ID:<user_group_id> <user_group_name>" |
|
125 | "msg": "deleted user group ID:<user_group_id> <user_group_name>" | |
123 | } |
|
126 | } | |
124 | error : null |
|
127 | error : null | |
125 |
|
128 | |||
126 | Example error output: |
|
129 | Example error output: | |
127 |
|
130 | |||
128 | .. code-block:: bash |
|
131 | .. code-block:: bash | |
129 |
|
132 | |||
130 | id : <id_given_in_input> |
|
133 | id : <id_given_in_input> | |
131 | result : null |
|
134 | result : null | |
132 | error : { |
|
135 | error : { | |
133 | "failed to delete user group ID:<user_group_id> <user_group_name>" |
|
136 | "failed to delete user group ID:<user_group_id> <user_group_name>" | |
134 | or |
|
137 | or | |
135 | "RepoGroup assigned to <repo_groups_list>" |
|
138 | "RepoGroup assigned to <repo_groups_list>" | |
136 | } |
|
139 | } | |
137 |
|
140 | |||
138 |
|
141 | |||
139 | get_user_group |
|
142 | get_user_group | |
140 | -------------- |
|
143 | -------------- | |
141 |
|
144 | |||
142 | .. py:function:: get_user_group(apiuser, usergroupid) |
|
145 | .. py:function:: get_user_group(apiuser, usergroupid) | |
143 |
|
146 | |||
144 | Returns the data of an existing user group. |
|
147 | Returns the data of an existing user group. | |
145 |
|
148 | |||
146 | This command can only be run using an |authtoken| with admin rights to |
|
149 | This command can only be run using an |authtoken| with admin rights to | |
147 | the specified repository. |
|
150 | the specified repository. | |
148 |
|
151 | |||
149 | :param apiuser: This is filled automatically from the |authtoken|. |
|
152 | :param apiuser: This is filled automatically from the |authtoken|. | |
150 | :type apiuser: AuthUser |
|
153 | :type apiuser: AuthUser | |
151 | :param usergroupid: Set the user group from which to return data. |
|
154 | :param usergroupid: Set the user group from which to return data. | |
152 | :type usergroupid: str or int |
|
155 | :type usergroupid: str or int | |
153 |
|
156 | |||
154 | Example error output: |
|
157 | Example error output: | |
155 |
|
158 | |||
156 | .. code-block:: bash |
|
159 | .. code-block:: bash | |
157 |
|
160 | |||
158 | { |
|
161 | { | |
159 | "error": null, |
|
162 | "error": null, | |
160 | "id": <id>, |
|
163 | "id": <id>, | |
161 | "result": { |
|
164 | "result": { | |
162 | "active": true, |
|
165 | "active": true, | |
163 | "group_description": "group description", |
|
166 | "group_description": "group description", | |
164 | "group_name": "group name", |
|
167 | "group_name": "group name", | |
165 | "permissions": [ |
|
168 | "permissions": [ | |
166 | { |
|
169 | { | |
167 | "name": "owner-name", |
|
170 | "name": "owner-name", | |
168 | "origin": "owner", |
|
171 | "origin": "owner", | |
169 | "permission": "usergroup.admin", |
|
172 | "permission": "usergroup.admin", | |
170 | "type": "user" |
|
173 | "type": "user" | |
171 | }, |
|
174 | }, | |
172 | { |
|
175 | { | |
173 | { |
|
176 | { | |
174 | "name": "user name", |
|
177 | "name": "user name", | |
175 | "origin": "permission", |
|
178 | "origin": "permission", | |
176 | "permission": "usergroup.admin", |
|
179 | "permission": "usergroup.admin", | |
177 | "type": "user" |
|
180 | "type": "user" | |
178 | }, |
|
181 | }, | |
179 | { |
|
182 | { | |
180 | "name": "user group name", |
|
183 | "name": "user group name", | |
181 | "origin": "permission", |
|
184 | "origin": "permission", | |
182 | "permission": "usergroup.write", |
|
185 | "permission": "usergroup.write", | |
183 | "type": "user_group" |
|
186 | "type": "user_group" | |
184 | } |
|
187 | } | |
185 | ], |
|
188 | ], | |
186 | "permissions_summary": { |
|
189 | "permissions_summary": { | |
187 | "repositories": { |
|
190 | "repositories": { | |
188 | "aa-root-level-repo-1": "repository.admin" |
|
191 | "aa-root-level-repo-1": "repository.admin" | |
189 | }, |
|
192 | }, | |
190 | "repositories_groups": {} |
|
193 | "repositories_groups": {} | |
191 | }, |
|
194 | }, | |
192 | "owner": "owner name", |
|
195 | "owner": "owner name", | |
193 | "users": [], |
|
196 | "users": [], | |
194 | "users_group_id": 2 |
|
197 | "users_group_id": 2 | |
195 | } |
|
198 | } | |
196 | } |
|
199 | } | |
197 |
|
200 | |||
198 |
|
201 | |||
199 | get_user_groups |
|
202 | get_user_groups | |
200 | --------------- |
|
203 | --------------- | |
201 |
|
204 | |||
202 | .. py:function:: get_user_groups(apiuser) |
|
205 | .. py:function:: get_user_groups(apiuser) | |
203 |
|
206 | |||
204 | Lists all the existing user groups within RhodeCode. |
|
207 | Lists all the existing user groups within RhodeCode. | |
205 |
|
208 | |||
206 | This command can only be run using an |authtoken| with admin rights to |
|
209 | This command can only be run using an |authtoken| with admin rights to | |
207 | the specified repository. |
|
210 | the specified repository. | |
208 |
|
211 | |||
209 | This command takes the following options: |
|
212 | This command takes the following options: | |
210 |
|
213 | |||
211 | :param apiuser: This is filled automatically from the |authtoken|. |
|
214 | :param apiuser: This is filled automatically from the |authtoken|. | |
212 | :type apiuser: AuthUser |
|
215 | :type apiuser: AuthUser | |
213 |
|
216 | |||
214 | Example error output: |
|
217 | Example error output: | |
215 |
|
218 | |||
216 | .. code-block:: bash |
|
219 | .. code-block:: bash | |
217 |
|
220 | |||
218 | id : <id_given_in_input> |
|
221 | id : <id_given_in_input> | |
219 | result : [<user_group_obj>,...] |
|
222 | result : [<user_group_obj>,...] | |
220 | error : null |
|
223 | error : null | |
221 |
|
224 | |||
222 |
|
225 | |||
223 | grant_user_group_permission_to_user_group |
|
226 | grant_user_group_permission_to_user_group | |
224 | ----------------------------------------- |
|
227 | ----------------------------------------- | |
225 |
|
228 | |||
226 | .. py:function:: grant_user_group_permission_to_user_group(apiuser, usergroupid, sourceusergroupid, perm) |
|
229 | .. py:function:: grant_user_group_permission_to_user_group(apiuser, usergroupid, sourceusergroupid, perm) | |
227 |
|
230 | |||
228 | Give one user group permissions to another user group. |
|
231 | Give one user group permissions to another user group. | |
229 |
|
232 | |||
230 | :param apiuser: This is filled automatically from the |authtoken|. |
|
233 | :param apiuser: This is filled automatically from the |authtoken|. | |
231 | :type apiuser: AuthUser |
|
234 | :type apiuser: AuthUser | |
232 | :param usergroupid: Set the user group on which to edit permissions. |
|
235 | :param usergroupid: Set the user group on which to edit permissions. | |
233 | :type usergroupid: str or int |
|
236 | :type usergroupid: str or int | |
234 | :param sourceusergroupid: Set the source user group to which |
|
237 | :param sourceusergroupid: Set the source user group to which | |
235 | access/permissions will be granted. |
|
238 | access/permissions will be granted. | |
236 | :type sourceusergroupid: str or int |
|
239 | :type sourceusergroupid: str or int | |
237 | :param perm: (usergroup.(none|read|write|admin)) |
|
240 | :param perm: (usergroup.(none|read|write|admin)) | |
238 | :type perm: str |
|
241 | :type perm: str | |
239 |
|
242 | |||
240 | Example output: |
|
243 | Example output: | |
241 |
|
244 | |||
242 | .. code-block:: bash |
|
245 | .. code-block:: bash | |
243 |
|
246 | |||
244 | id : <id_given_in_input> |
|
247 | id : <id_given_in_input> | |
245 | result : { |
|
248 | result : { | |
246 | "msg": "Granted perm: `<perm_name>` for user group: `<source_user_group_name>` in user group: `<user_group_name>`", |
|
249 | "msg": "Granted perm: `<perm_name>` for user group: `<source_user_group_name>` in user group: `<user_group_name>`", | |
247 | "success": true |
|
250 | "success": true | |
248 | } |
|
251 | } | |
249 | error : null |
|
252 | error : null | |
250 |
|
253 | |||
251 |
|
254 | |||
252 | grant_user_permission_to_user_group |
|
255 | grant_user_permission_to_user_group | |
253 | ----------------------------------- |
|
256 | ----------------------------------- | |
254 |
|
257 | |||
255 | .. py:function:: grant_user_permission_to_user_group(apiuser, usergroupid, userid, perm) |
|
258 | .. py:function:: grant_user_permission_to_user_group(apiuser, usergroupid, userid, perm) | |
256 |
|
259 | |||
257 | Set permissions for a user in a user group. |
|
260 | Set permissions for a user in a user group. | |
258 |
|
261 | |||
259 | :param apiuser: This is filled automatically from the |authtoken|. |
|
262 | :param apiuser: This is filled automatically from the |authtoken|. | |
260 | :type apiuser: AuthUser |
|
263 | :type apiuser: AuthUser | |
261 | :param usergroupid: Set the user group to edit permissions on. |
|
264 | :param usergroupid: Set the user group to edit permissions on. | |
262 | :type usergroupid: str or int |
|
265 | :type usergroupid: str or int | |
263 | :param userid: Set the user from whom you wish to set permissions. |
|
266 | :param userid: Set the user from whom you wish to set permissions. | |
264 | :type userid: str |
|
267 | :type userid: str | |
265 | :param perm: (usergroup.(none|read|write|admin)) |
|
268 | :param perm: (usergroup.(none|read|write|admin)) | |
266 | :type perm: str |
|
269 | :type perm: str | |
267 |
|
270 | |||
268 | Example output: |
|
271 | Example output: | |
269 |
|
272 | |||
270 | .. code-block:: bash |
|
273 | .. code-block:: bash | |
271 |
|
274 | |||
272 | id : <id_given_in_input> |
|
275 | id : <id_given_in_input> | |
273 | result : { |
|
276 | result : { | |
274 | "msg": "Granted perm: `<perm_name>` for user: `<username>` in user group: `<user_group_name>`", |
|
277 | "msg": "Granted perm: `<perm_name>` for user: `<username>` in user group: `<user_group_name>`", | |
275 | "success": true |
|
278 | "success": true | |
276 | } |
|
279 | } | |
277 | error : null |
|
280 | error : null | |
278 |
|
281 | |||
279 |
|
282 | |||
280 | remove_user_from_user_group |
|
283 | remove_user_from_user_group | |
281 | --------------------------- |
|
284 | --------------------------- | |
282 |
|
285 | |||
283 | .. py:function:: remove_user_from_user_group(apiuser, usergroupid, userid) |
|
286 | .. py:function:: remove_user_from_user_group(apiuser, usergroupid, userid) | |
284 |
|
287 | |||
285 | Removes a user from a user group. |
|
288 | Removes a user from a user group. | |
286 |
|
289 | |||
287 | * If the specified user is not in the group, this command will return |
|
290 | * If the specified user is not in the group, this command will return | |
288 | `false`. |
|
291 | `false`. | |
289 |
|
292 | |||
290 | This command can only be run using an |authtoken| with admin rights to |
|
293 | This command can only be run using an |authtoken| with admin rights to | |
291 | the specified user group. |
|
294 | the specified user group. | |
292 |
|
295 | |||
293 | :param apiuser: This is filled automatically from the |authtoken|. |
|
296 | :param apiuser: This is filled automatically from the |authtoken|. | |
294 | :type apiuser: AuthUser |
|
297 | :type apiuser: AuthUser | |
295 | :param usergroupid: Sets the user group name. |
|
298 | :param usergroupid: Sets the user group name. | |
296 | :type usergroupid: str or int |
|
299 | :type usergroupid: str or int | |
297 | :param userid: The user you wish to remove from |RCE|. |
|
300 | :param userid: The user you wish to remove from |RCE|. | |
298 | :type userid: str or int |
|
301 | :type userid: str or int | |
299 |
|
302 | |||
300 | Example output: |
|
303 | Example output: | |
301 |
|
304 | |||
302 | .. code-block:: bash |
|
305 | .. code-block:: bash | |
303 |
|
306 | |||
304 | id : <id_given_in_input> |
|
307 | id : <id_given_in_input> | |
305 | result: { |
|
308 | result: { | |
306 | "success": True|False, # depends on if member is in group |
|
309 | "success": True|False, # depends on if member is in group | |
307 | "msg": "removed member <username> from user group <groupname> | |
|
310 | "msg": "removed member <username> from user group <groupname> | | |
308 | User wasn't in group" |
|
311 | User wasn't in group" | |
309 | } |
|
312 | } | |
310 | error: null |
|
313 | error: null | |
311 |
|
314 | |||
312 |
|
315 | |||
313 | revoke_user_group_permission_from_user_group |
|
316 | revoke_user_group_permission_from_user_group | |
314 | -------------------------------------------- |
|
317 | -------------------------------------------- | |
315 |
|
318 | |||
316 | .. py:function:: revoke_user_group_permission_from_user_group(apiuser, usergroupid, sourceusergroupid) |
|
319 | .. py:function:: revoke_user_group_permission_from_user_group(apiuser, usergroupid, sourceusergroupid) | |
317 |
|
320 | |||
318 | Revoke the permissions that one user group has to another. |
|
321 | Revoke the permissions that one user group has to another. | |
319 |
|
322 | |||
320 | :param apiuser: This is filled automatically from the |authtoken|. |
|
323 | :param apiuser: This is filled automatically from the |authtoken|. | |
321 | :type apiuser: AuthUser |
|
324 | :type apiuser: AuthUser | |
322 | :param usergroupid: Set the user group on which to edit permissions. |
|
325 | :param usergroupid: Set the user group on which to edit permissions. | |
323 | :type usergroupid: str or int |
|
326 | :type usergroupid: str or int | |
324 | :param sourceusergroupid: Set the user group from which permissions |
|
327 | :param sourceusergroupid: Set the user group from which permissions | |
325 | are revoked. |
|
328 | are revoked. | |
326 | :type sourceusergroupid: str or int |
|
329 | :type sourceusergroupid: str or int | |
327 |
|
330 | |||
328 | Example output: |
|
331 | Example output: | |
329 |
|
332 | |||
330 | .. code-block:: bash |
|
333 | .. code-block:: bash | |
331 |
|
334 | |||
332 | id : <id_given_in_input> |
|
335 | id : <id_given_in_input> | |
333 | result : { |
|
336 | result : { | |
334 | "msg": "Revoked perm for user group: `<user_group_name>` in user group: `<target_user_group_name>`", |
|
337 | "msg": "Revoked perm for user group: `<user_group_name>` in user group: `<target_user_group_name>`", | |
335 | "success": true |
|
338 | "success": true | |
336 | } |
|
339 | } | |
337 | error : null |
|
340 | error : null | |
338 |
|
341 | |||
339 |
|
342 | |||
340 | revoke_user_permission_from_user_group |
|
343 | revoke_user_permission_from_user_group | |
341 | -------------------------------------- |
|
344 | -------------------------------------- | |
342 |
|
345 | |||
343 | .. py:function:: revoke_user_permission_from_user_group(apiuser, usergroupid, userid) |
|
346 | .. py:function:: revoke_user_permission_from_user_group(apiuser, usergroupid, userid) | |
344 |
|
347 | |||
345 | Revoke a users permissions in a user group. |
|
348 | Revoke a users permissions in a user group. | |
346 |
|
349 | |||
347 | :param apiuser: This is filled automatically from the |authtoken|. |
|
350 | :param apiuser: This is filled automatically from the |authtoken|. | |
348 | :type apiuser: AuthUser |
|
351 | :type apiuser: AuthUser | |
349 | :param usergroupid: Set the user group from which to revoke the user |
|
352 | :param usergroupid: Set the user group from which to revoke the user | |
350 | permissions. |
|
353 | permissions. | |
351 | :type: usergroupid: str or int |
|
354 | :type: usergroupid: str or int | |
352 | :param userid: Set the userid of the user whose permissions will be |
|
355 | :param userid: Set the userid of the user whose permissions will be | |
353 | revoked. |
|
356 | revoked. | |
354 | :type userid: str |
|
357 | :type userid: str | |
355 |
|
358 | |||
356 | Example output: |
|
359 | Example output: | |
357 |
|
360 | |||
358 | .. code-block:: bash |
|
361 | .. code-block:: bash | |
359 |
|
362 | |||
360 | id : <id_given_in_input> |
|
363 | id : <id_given_in_input> | |
361 | result : { |
|
364 | result : { | |
362 | "msg": "Revoked perm for user: `<username>` in user group: `<user_group_name>`", |
|
365 | "msg": "Revoked perm for user: `<username>` in user group: `<user_group_name>`", | |
363 | "success": true |
|
366 | "success": true | |
364 | } |
|
367 | } | |
365 | error : null |
|
368 | error : null | |
366 |
|
369 | |||
367 |
|
370 | |||
368 | update_user_group |
|
371 | update_user_group | |
369 | ----------------- |
|
372 | ----------------- | |
370 |
|
373 | |||
371 | .. py:function:: update_user_group(apiuser, usergroupid, group_name=<Optional:''>, description=<Optional:''>, owner=<Optional:None>, active=<Optional:True>) |
|
374 | .. py:function:: update_user_group(apiuser, usergroupid, group_name=<Optional:''>, description=<Optional:''>, owner=<Optional:None>, active=<Optional:True>, sync=<Optional:None>) | |
372 |
|
375 | |||
373 | Updates the specified `user group` with the details provided. |
|
376 | Updates the specified `user group` with the details provided. | |
374 |
|
377 | |||
375 | This command can only be run using an |authtoken| with admin rights to |
|
378 | This command can only be run using an |authtoken| with admin rights to | |
376 | the specified repository. |
|
379 | the specified repository. | |
377 |
|
380 | |||
378 | :param apiuser: This is filled automatically from the |authtoken|. |
|
381 | :param apiuser: This is filled automatically from the |authtoken|. | |
379 | :type apiuser: AuthUser |
|
382 | :type apiuser: AuthUser | |
380 | :param usergroupid: Set the id of the `user group` to update. |
|
383 | :param usergroupid: Set the id of the `user group` to update. | |
381 | :type usergroupid: str or int |
|
384 | :type usergroupid: str or int | |
382 | :param group_name: Set the new name the `user group` |
|
385 | :param group_name: Set the new name the `user group` | |
383 | :type group_name: str |
|
386 | :type group_name: str | |
384 | :param description: Give a description for the `user group` |
|
387 | :param description: Give a description for the `user group` | |
385 | :type description: str |
|
388 | :type description: str | |
386 | :param owner: Set the owner of the `user group`. |
|
389 | :param owner: Set the owner of the `user group`. | |
387 | :type owner: Optional(str or int) |
|
390 | :type owner: Optional(str or int) | |
388 | :param active: Set the group as active. |
|
391 | :param active: Set the group as active. | |
389 | :type active: Optional(``True`` | ``False``) |
|
392 | :type active: Optional(``True`` | ``False``) | |
|
393 | :param sync: Set enabled or disabled the automatically sync from | |||
|
394 | external authentication types like ldap. | |||
|
395 | :type sync: Optional(``True`` | ``False``) | |||
390 |
|
396 | |||
391 | Example output: |
|
397 | Example output: | |
392 |
|
398 | |||
393 | .. code-block:: bash |
|
399 | .. code-block:: bash | |
394 |
|
400 | |||
395 | id : <id_given_in_input> |
|
401 | id : <id_given_in_input> | |
396 | result : { |
|
402 | result : { | |
397 | "msg": 'updated user group ID:<user group id> <user group name>', |
|
403 | "msg": 'updated user group ID:<user group id> <user group name>', | |
398 | "user_group": <user_group_object> |
|
404 | "user_group": <user_group_object> | |
399 | } |
|
405 | } | |
400 | error : null |
|
406 | error : null | |
401 |
|
407 | |||
402 | Example error output: |
|
408 | Example error output: | |
403 |
|
409 | |||
404 | .. code-block:: bash |
|
410 | .. code-block:: bash | |
405 |
|
411 | |||
406 | id : <id_given_in_input> |
|
412 | id : <id_given_in_input> | |
407 | result : null |
|
413 | result : null | |
408 | error : { |
|
414 | error : { | |
409 | "failed to update user group `<user group name>`" |
|
415 | "failed to update user group `<user group name>`" | |
410 | } |
|
416 | } | |
411 |
|
417 | |||
412 |
|
418 |
General Comments 0
You need to be logged in to leave comments.
Login now