Show More
@@ -1,210 +1,234 b'' | |||
|
1 | 1 | .. _server-methods-ref: |
|
2 | 2 | |
|
3 | 3 | server methods |
|
4 | 4 | ============== |
|
5 | 5 | |
|
6 | 6 | cleanup_sessions |
|
7 | 7 | ---------------- |
|
8 | 8 | |
|
9 | 9 | .. py:function:: cleanup_sessions(apiuser, older_then=<Optional:60>) |
|
10 | 10 | |
|
11 | 11 | Triggers a session cleanup action. |
|
12 | 12 | |
|
13 | 13 | If the ``older_then`` option is set, only sessions that hasn't been |
|
14 | 14 | accessed in the given number of days will be removed. |
|
15 | 15 | |
|
16 | 16 | This command can only be run using an |authtoken| with admin rights to |
|
17 | 17 | the specified repository. |
|
18 | 18 | |
|
19 | 19 | This command takes the following options: |
|
20 | 20 | |
|
21 | 21 | :param apiuser: This is filled automatically from the |authtoken|. |
|
22 | 22 | :type apiuser: AuthUser |
|
23 | 23 | :param older_then: Deletes session that hasn't been accessed |
|
24 | 24 | in given number of days. |
|
25 | 25 | :type older_then: Optional(int) |
|
26 | 26 | |
|
27 | 27 | Example output: |
|
28 | 28 | |
|
29 | 29 | .. code-block:: bash |
|
30 | 30 | |
|
31 | 31 | id : <id_given_in_input> |
|
32 | 32 | result: { |
|
33 | 33 | "backend": "<type of backend>", |
|
34 | 34 | "sessions_removed": <number_of_removed_sessions> |
|
35 | 35 | } |
|
36 | 36 | error : null |
|
37 | 37 | |
|
38 | 38 | Example error output: |
|
39 | 39 | |
|
40 | 40 | .. code-block:: bash |
|
41 | 41 | |
|
42 | 42 | id : <id_given_in_input> |
|
43 | 43 | result : null |
|
44 | 44 | error : { |
|
45 | 45 | 'Error occurred during session cleanup' |
|
46 | 46 | } |
|
47 | 47 | |
|
48 | 48 | |
|
49 | 49 | get_ip |
|
50 | 50 | ------ |
|
51 | 51 | |
|
52 | 52 | .. py:function:: get_ip(apiuser, userid=<Optional:<OptionalAttr:apiuser>>) |
|
53 | 53 | |
|
54 | 54 | Displays the IP Address as seen from the |RCE| server. |
|
55 | 55 | |
|
56 | 56 | * This command displays the IP Address, as well as all the defined IP |
|
57 | 57 | addresses for the specified user. If the ``userid`` is not set, the |
|
58 | 58 | data returned is for the user calling the method. |
|
59 | 59 | |
|
60 | 60 | This command can only be run using an |authtoken| with admin rights to |
|
61 | 61 | the specified repository. |
|
62 | 62 | |
|
63 | 63 | This command takes the following options: |
|
64 | 64 | |
|
65 | 65 | :param apiuser: This is filled automatically from |authtoken|. |
|
66 | 66 | :type apiuser: AuthUser |
|
67 | 67 | :param userid: Sets the userid for which associated IP Address data |
|
68 | 68 | is returned. |
|
69 | 69 | :type userid: Optional(str or int) |
|
70 | 70 | |
|
71 | 71 | Example output: |
|
72 | 72 | |
|
73 | 73 | .. code-block:: bash |
|
74 | 74 | |
|
75 | 75 | id : <id_given_in_input> |
|
76 | 76 | result : { |
|
77 | 77 | "server_ip_addr": "<ip_from_clien>", |
|
78 | 78 | "user_ips": [ |
|
79 | 79 | { |
|
80 | 80 | "ip_addr": "<ip_with_mask>", |
|
81 | 81 | "ip_range": ["<start_ip>", "<end_ip>"], |
|
82 | 82 | }, |
|
83 | 83 | ... |
|
84 | 84 | ] |
|
85 | 85 | } |
|
86 | 86 | |
|
87 | 87 | |
|
88 | 88 | get_method |
|
89 | 89 | ---------- |
|
90 | 90 | |
|
91 | 91 | .. py:function:: get_method(apiuser, pattern=<Optional:'*'>) |
|
92 | 92 | |
|
93 | 93 | Returns list of all available API methods. By default match pattern |
|
94 | 94 | os "*" but any other pattern can be specified. eg *comment* will return |
|
95 | 95 | all methods with comment inside them. If just single method is matched |
|
96 | 96 | returned data will also include method specification |
|
97 | 97 | |
|
98 | 98 | This command can only be run using an |authtoken| with admin rights to |
|
99 | 99 | the specified repository. |
|
100 | 100 | |
|
101 | 101 | This command takes the following options: |
|
102 | 102 | |
|
103 | 103 | :param apiuser: This is filled automatically from the |authtoken|. |
|
104 | 104 | :type apiuser: AuthUser |
|
105 | 105 | :param pattern: pattern to match method names against |
|
106 | 106 | :type older_then: Optional("*") |
|
107 | 107 | |
|
108 | 108 | Example output: |
|
109 | 109 | |
|
110 | 110 | .. code-block:: bash |
|
111 | 111 | |
|
112 | 112 | id : <id_given_in_input> |
|
113 | 113 | "result": [ |
|
114 | 114 | "changeset_comment", |
|
115 | 115 | "comment_pull_request", |
|
116 | 116 | "comment_commit" |
|
117 | 117 | ] |
|
118 | 118 | error : null |
|
119 | 119 | |
|
120 | 120 | .. code-block:: bash |
|
121 | 121 | |
|
122 | 122 | id : <id_given_in_input> |
|
123 | 123 | "result": [ |
|
124 | 124 | "comment_commit", |
|
125 | 125 | { |
|
126 | 126 | "apiuser": "<RequiredType>", |
|
127 | 127 | "comment_type": "<Optional:u'note'>", |
|
128 | 128 | "commit_id": "<RequiredType>", |
|
129 | 129 | "message": "<RequiredType>", |
|
130 | 130 | "repoid": "<RequiredType>", |
|
131 | 131 | "request": "<RequiredType>", |
|
132 | 132 | "resolves_comment_id": "<Optional:None>", |
|
133 | 133 | "status": "<Optional:None>", |
|
134 | 134 | "userid": "<Optional:<OptionalAttr:apiuser>>" |
|
135 | 135 | } |
|
136 | 136 | ] |
|
137 | 137 | error : null |
|
138 | 138 | |
|
139 | 139 | |
|
140 | get_repo_store | |
|
141 | -------------- | |
|
142 | ||
|
143 | .. py:function:: get_repo_store(apiuser) | |
|
144 | ||
|
145 | Returns the |RCE| repository storage information. | |
|
146 | ||
|
147 | :param apiuser: This is filled automatically from the |authtoken|. | |
|
148 | :type apiuser: AuthUser | |
|
149 | ||
|
150 | Example output: | |
|
151 | ||
|
152 | .. code-block:: bash | |
|
153 | ||
|
154 | id : <id_given_in_input> | |
|
155 | result : { | |
|
156 | 'modules': [<module name>,...] | |
|
157 | 'py_version': <python version>, | |
|
158 | 'platform': <platform type>, | |
|
159 | 'rhodecode_version': <rhodecode version> | |
|
160 | } | |
|
161 | error : null | |
|
162 | ||
|
163 | ||
|
140 | 164 | get_server_info |
|
141 | 165 | --------------- |
|
142 | 166 | |
|
143 | 167 | .. py:function:: get_server_info(apiuser) |
|
144 | 168 | |
|
145 | 169 | Returns the |RCE| server information. |
|
146 | 170 | |
|
147 | 171 | This includes the running version of |RCE| and all installed |
|
148 | 172 | packages. This command takes the following options: |
|
149 | 173 | |
|
150 | 174 | :param apiuser: This is filled automatically from the |authtoken|. |
|
151 | 175 | :type apiuser: AuthUser |
|
152 | 176 | |
|
153 | 177 | Example output: |
|
154 | 178 | |
|
155 | 179 | .. code-block:: bash |
|
156 | 180 | |
|
157 | 181 | id : <id_given_in_input> |
|
158 | 182 | result : { |
|
159 | 183 | 'modules': [<module name>,...] |
|
160 | 184 | 'py_version': <python version>, |
|
161 | 185 | 'platform': <platform type>, |
|
162 | 186 | 'rhodecode_version': <rhodecode version> |
|
163 | 187 | } |
|
164 | 188 | error : null |
|
165 | 189 | |
|
166 | 190 | |
|
167 | 191 | rescan_repos |
|
168 | 192 | ------------ |
|
169 | 193 | |
|
170 | 194 | .. py:function:: rescan_repos(apiuser, remove_obsolete=<Optional:False>) |
|
171 | 195 | |
|
172 | 196 | Triggers a rescan of the specified repositories. |
|
173 | 197 | |
|
174 | 198 | * If the ``remove_obsolete`` option is set, it also deletes repositories |
|
175 | 199 | that are found in the database but not on the file system, so called |
|
176 | 200 | "clean zombies". |
|
177 | 201 | |
|
178 | 202 | This command can only be run using an |authtoken| with admin rights to |
|
179 | 203 | the specified repository. |
|
180 | 204 | |
|
181 | 205 | This command takes the following options: |
|
182 | 206 | |
|
183 | 207 | :param apiuser: This is filled automatically from the |authtoken|. |
|
184 | 208 | :type apiuser: AuthUser |
|
185 | 209 | :param remove_obsolete: Deletes repositories from the database that |
|
186 | 210 | are not found on the filesystem. |
|
187 | 211 | :type remove_obsolete: Optional(``True`` | ``False``) |
|
188 | 212 | |
|
189 | 213 | Example output: |
|
190 | 214 | |
|
191 | 215 | .. code-block:: bash |
|
192 | 216 | |
|
193 | 217 | id : <id_given_in_input> |
|
194 | 218 | result : { |
|
195 | 219 | 'added': [<added repository name>,...] |
|
196 | 220 | 'removed': [<removed repository name>,...] |
|
197 | 221 | } |
|
198 | 222 | error : null |
|
199 | 223 | |
|
200 | 224 | Example error output: |
|
201 | 225 | |
|
202 | 226 | .. code-block:: bash |
|
203 | 227 | |
|
204 | 228 | id : <id_given_in_input> |
|
205 | 229 | result : null |
|
206 | 230 | error : { |
|
207 | 231 | 'Error occurred during rescan repositories action' |
|
208 | 232 | } |
|
209 | 233 | |
|
210 | 234 |
General Comments 0
You need to be logged in to leave comments.
Login now