Show More
@@ -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:: javascript | |
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,102 +1,102 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | # Copyright (C) 2011-2018 RhodeCode GmbH |
|
3 | # Copyright (C) 2011-2018 RhodeCode GmbH | |
4 | # |
|
4 | # | |
5 | # This program is free software: you can redistribute it and/or modify |
|
5 | # This program is free software: you can redistribute it and/or modify | |
6 | # it under the terms of the GNU Affero General Public License, version 3 |
|
6 | # it under the terms of the GNU Affero General Public License, version 3 | |
7 | # (only), as published by the Free Software Foundation. |
|
7 | # (only), as published by the Free Software Foundation. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU Affero General Public License |
|
14 | # You should have received a copy of the GNU Affero General Public License | |
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | # |
|
16 | # | |
17 | # This program is dual-licensed. If you wish to learn more about the |
|
17 | # This program is dual-licensed. If you wish to learn more about the | |
18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
18 | # RhodeCode Enterprise Edition, including its added features, Support services, | |
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ | |
20 |
|
20 | |||
21 |
|
21 | |||
22 | """ |
|
22 | """ | |
23 | NOTE: |
|
23 | NOTE: | |
24 | Place for deprecated APIs here, if a call needs to be deprecated, please |
|
24 | Place for deprecated APIs here, if a call needs to be deprecated, please | |
25 | put it here, and point to a new version |
|
25 | put it here, and point to a new version | |
26 | """ |
|
26 | """ | |
27 | import logging |
|
27 | import logging | |
28 |
|
28 | |||
29 | from rhodecode.api import jsonrpc_method, jsonrpc_deprecated_method |
|
29 | from rhodecode.api import jsonrpc_method, jsonrpc_deprecated_method | |
30 | from rhodecode.api.utils import Optional, OAttr |
|
30 | from rhodecode.api.utils import Optional, OAttr | |
31 |
|
31 | |||
32 |
|
32 | |||
33 | log = logging.getLogger(__name__) |
|
33 | log = logging.getLogger(__name__) | |
34 |
|
34 | |||
35 |
|
35 | |||
36 | # permission check inside |
|
36 | # permission check inside | |
37 | @jsonrpc_method() |
|
37 | @jsonrpc_method() | |
38 | @jsonrpc_deprecated_method( |
|
38 | @jsonrpc_deprecated_method( | |
39 | use_method='comment_commit', deprecated_at_version='3.4.0') |
|
39 | use_method='comment_commit', deprecated_at_version='3.4.0') | |
40 | def changeset_comment(request, apiuser, repoid, revision, message, |
|
40 | def changeset_comment(request, apiuser, repoid, revision, message, | |
41 | userid=Optional(OAttr('apiuser')), |
|
41 | userid=Optional(OAttr('apiuser')), | |
42 | status=Optional(None)): |
|
42 | status=Optional(None)): | |
43 | """ |
|
43 | """ | |
44 | Set a changeset comment, and optionally change the status of the |
|
44 | Set a changeset comment, and optionally change the status of the | |
45 | changeset. |
|
45 | changeset. | |
46 |
|
46 | |||
47 | This command can only be run using an |authtoken| with admin |
|
47 | This command can only be run using an |authtoken| with admin | |
48 | permissions on the |repo|. |
|
48 | permissions on the |repo|. | |
49 |
|
49 | |||
50 | :param apiuser: This is filled automatically from the |authtoken|. |
|
50 | :param apiuser: This is filled automatically from the |authtoken|. | |
51 | :type apiuser: AuthUser |
|
51 | :type apiuser: AuthUser | |
52 | :param repoid: Set the repository name or repository ID. |
|
52 | :param repoid: Set the repository name or repository ID. | |
53 | :type repoid: str or int |
|
53 | :type repoid: str or int | |
54 | :param revision: Specify the revision for which to set a comment. |
|
54 | :param revision: Specify the revision for which to set a comment. | |
55 | :type revision: str |
|
55 | :type revision: str | |
56 | :param message: The comment text. |
|
56 | :param message: The comment text. | |
57 | :type message: str |
|
57 | :type message: str | |
58 | :param userid: Set the user name of the comment creator. |
|
58 | :param userid: Set the user name of the comment creator. | |
59 | :type userid: Optional(str or int) |
|
59 | :type userid: Optional(str or int) | |
60 | :param status: Set the comment status. The following are valid options: |
|
60 | :param status: Set the comment status. The following are valid options: | |
61 | * not_reviewed |
|
61 | * not_reviewed | |
62 | * approved |
|
62 | * approved | |
63 | * rejected |
|
63 | * rejected | |
64 | * under_review |
|
64 | * under_review | |
65 | :type status: str |
|
65 | :type status: str | |
66 |
|
66 | |||
67 | Example error output: |
|
67 | Example error output: | |
68 |
|
68 | |||
69 |
.. code-block:: j |
|
69 | .. code-block:: javascript | |
70 |
|
70 | |||
71 | { |
|
71 | { | |
72 | "id" : <id_given_in_input>, |
|
72 | "id" : <id_given_in_input>, | |
73 | "result" : { |
|
73 | "result" : { | |
74 | "msg": "Commented on commit `<revision>` for repository `<repoid>`", |
|
74 | "msg": "Commented on commit `<revision>` for repository `<repoid>`", | |
75 | "status_change": null or <status>, |
|
75 | "status_change": null or <status>, | |
76 | "success": true |
|
76 | "success": true | |
77 | }, |
|
77 | }, | |
78 | "error" : null |
|
78 | "error" : null | |
79 | } |
|
79 | } | |
80 |
|
80 | |||
81 | """ |
|
81 | """ | |
82 | from .repo_api import comment_commit |
|
82 | from .repo_api import comment_commit | |
83 |
|
83 | |||
84 | return comment_commit(request=request, |
|
84 | return comment_commit(request=request, | |
85 | apiuser=apiuser, repoid=repoid, commit_id=revision, |
|
85 | apiuser=apiuser, repoid=repoid, commit_id=revision, | |
86 | message=message, userid=userid, status=status) |
|
86 | message=message, userid=userid, status=status) | |
87 |
|
87 | |||
88 |
|
88 | |||
89 | @jsonrpc_method() |
|
89 | @jsonrpc_method() | |
90 | @jsonrpc_deprecated_method( |
|
90 | @jsonrpc_deprecated_method( | |
91 | use_method='get_ip', deprecated_at_version='4.0.0') |
|
91 | use_method='get_ip', deprecated_at_version='4.0.0') | |
92 | def show_ip(request, apiuser, userid=Optional(OAttr('apiuser'))): |
|
92 | def show_ip(request, apiuser, userid=Optional(OAttr('apiuser'))): | |
93 | from .server_api import get_ip |
|
93 | from .server_api import get_ip | |
94 | return get_ip(request=request, apiuser=apiuser, userid=userid) |
|
94 | return get_ip(request=request, apiuser=apiuser, userid=userid) | |
95 |
|
95 | |||
96 |
|
96 | |||
97 | @jsonrpc_method() |
|
97 | @jsonrpc_method() | |
98 | @jsonrpc_deprecated_method( |
|
98 | @jsonrpc_deprecated_method( | |
99 | use_method='get_user_locks', deprecated_at_version='4.0.0') |
|
99 | use_method='get_user_locks', deprecated_at_version='4.0.0') | |
100 | def get_locks(request, apiuser, userid=Optional(OAttr('apiuser'))): |
|
100 | def get_locks(request, apiuser, userid=Optional(OAttr('apiuser'))): | |
101 | from .user_api import get_user_locks |
|
101 | from .user_api import get_user_locks | |
102 | return get_user_locks(request=request, apiuser=apiuser, userid=userid) No newline at end of file |
|
102 | return get_user_locks(request=request, apiuser=apiuser, userid=userid) |
General Comments 0
You need to be logged in to leave comments.
Login now