##// END OF EJS Templates
release: updated API docs
marcink -
r4174:f7b5cdab default
parent child Browse files
Show More
@@ -39,7 +39,7 b' close_pull_request'
39 39 comment_pull_request
40 40 --------------------
41 41
42 .. py:function:: comment_pull_request(apiuser, pullrequestid, repoid=<Optional:None>, message=<Optional:None>, commit_id=<Optional:None>, status=<Optional:None>, comment_type=<Optional:u'note'>, resolves_comment_id=<Optional:None>, userid=<Optional:<OptionalAttr:apiuser>>)
42 .. py:function:: comment_pull_request(apiuser, pullrequestid, repoid=<Optional:None>, message=<Optional:None>, commit_id=<Optional:None>, status=<Optional:None>, comment_type=<Optional:u'note'>, resolves_comment_id=<Optional:None>, extra_recipients=<Optional:[]>, userid=<Optional:<OptionalAttr:apiuser>>)
43 43
44 44 Comment on the pull request specified with the `pullrequestid`,
45 45 in the |repo| specified by the `repoid`, and optionally change the
@@ -63,6 +63,11 b' comment_pull_request'
63 63 :type status: str
64 64 :param comment_type: Comment type, one of: 'note', 'todo'
65 65 :type comment_type: Optional(str), default: 'note'
66 :param resolves_comment_id: id of comment which this one will resolve
67 :type resolves_comment_id: Optional(int)
68 :param extra_recipients: list of user ids or usernames to add
69 notifications for this comment. Acts like a CC for notification
70 :type extra_recipients: Optional(list)
66 71 :param userid: Comment on the pull request as this user
67 72 :type userid: Optional(str or int)
68 73
@@ -126,7 +131,7 b' create_pull_request'
126 131 get_pull_request
127 132 ----------------
128 133
129 .. py:function:: get_pull_request(apiuser, pullrequestid, repoid=<Optional:None>)
134 .. py:function:: get_pull_request(apiuser, pullrequestid, repoid=<Optional:None>, merge_state=<Optional:False>)
130 135
131 136 Get a pull request based on the given ID.
132 137
@@ -137,6 +142,9 b' get_pull_request'
137 142 :type repoid: str or int
138 143 :param pullrequestid: ID of the requested pull request.
139 144 :type pullrequestid: int
145 :param merge_state: Optional calculate merge state for each repository.
146 This could result in longer time to fetch the data
147 :type merge_state: bool
140 148
141 149 Example output:
142 150
@@ -250,7 +258,7 b' get_pull_request_comments'
250 258 get_pull_requests
251 259 -----------------
252 260
253 .. py:function:: get_pull_requests(apiuser, repoid, status=<Optional:'new'>, merge_state=<Optional:True>)
261 .. py:function:: get_pull_requests(apiuser, repoid, status=<Optional:'new'>, merge_state=<Optional:False>)
254 262
255 263 Get all pull requests from the repository specified in `repoid`.
256 264
@@ -28,7 +28,7 b' add_field_to_repo'
28 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>, extra_recipients=<Optional:[]>, userid=<Optional:<OptionalAttr:apiuser>>)
32 32
33 33 Set a commit comment, and optionally change the status of the commit.
34 34
@@ -45,6 +45,11 b' comment_commit'
45 45 :type status: str
46 46 :param comment_type: Comment type, one of: 'note', 'todo'
47 47 :type comment_type: Optional(str), default: 'note'
48 :param resolves_comment_id: id of comment which this one will resolve
49 :type resolves_comment_id: Optional(int)
50 :param extra_recipients: list of user ids or usernames to add
51 notifications for this comment. Acts like a CC for notification
52 :type extra_recipients: Optional(list)
48 53 :param userid: Set the user name of the comment creator.
49 54 :type userid: Optional(str or int)
50 55
@@ -66,7 +71,7 b' comment_commit'
66 71 create_repo
67 72 -----------
68 73
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>)
74 .. 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:None>, enable_statistics=<Optional:False>, enable_locking=<Optional:False>, enable_downloads=<Optional:False>, copy_permissions=<Optional:False>)
70 75
71 76 Creates a repository.
72 77
@@ -97,7 +102,7 b' create_repo'
97 102 :type clone_uri: str
98 103 :param push_uri: set push_uri
99 104 :type push_uri: str
100 :param landing_rev: <rev_type>:<rev>
105 :param landing_rev: <rev_type>:<rev>, e.g branch:default, book:dev, rev:abcd
101 106 :type landing_rev: str
102 107 :param enable_locking:
103 108 :type enable_locking: bool
@@ -169,7 +174,7 b' delete_repo'
169 174 fork_repo
170 175 ---------
171 176
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>)
177 .. py:function:: fork_repo(apiuser, repoid, fork_name, owner=<Optional:<OptionalAttr:apiuser>>, description=<Optional:''>, private=<Optional:False>, clone_uri=<Optional:None>, landing_rev=<Optional:None>, copy_permissions=<Optional:False>)
173 178
174 179 Creates a fork of the specified |repo|.
175 180
@@ -198,7 +203,7 b' fork_repo'
198 203 :type copy_permissions: bool
199 204 :param private: Make the fork private. The default is False.
200 205 :type private: bool
201 :param landing_rev: Set the landing revision. The default is tip.
206 :param landing_rev: Set the landing revision. E.g branch:default, book:dev, rev:abcd
202 207
203 208 Example output:
204 209
@@ -1085,7 +1090,7 b' strip'
1085 1090 update_repo
1086 1091 -----------
1087 1092
1088 .. 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:''>)
1093 .. 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:None>, fork_of=<Optional:None>, enable_statistics=<Optional:False>, enable_locking=<Optional:False>, enable_downloads=<Optional:False>, fields=<Optional:''>)
1089 1094
1090 1095 Updates a repository with the given information.
1091 1096
@@ -1117,7 +1122,7 b' update_repo'
1117 1122 :type private: bool
1118 1123 :param clone_uri: Update the |repo| clone URI.
1119 1124 :type clone_uri: str
1120 :param landing_rev: Set the |repo| landing revision. Default is ``rev:tip``.
1125 :param landing_rev: Set the |repo| landing revision. e.g branch:default, book:dev, rev:abcd
1121 1126 :type landing_rev: str
1122 1127 :param enable_statistics: Enable statistics on the |repo|, (True | False).
1123 1128 :type enable_statistics: bool
@@ -6,7 +6,7 b' search methods'
6 6 search
7 7 ------
8 8
9 .. py:function:: search(apiuser, search_query, search_type, page_limit=<Optional:10>, page=<Optional:1>, search_sort=<Optional:'newfirst'>, repo_name=<Optional:None>, repo_group_name=<Optional:None>)
9 .. py:function:: search(apiuser, search_query, search_type, page_limit=<Optional:10>, page=<Optional:1>, search_sort=<Optional:'desc:date'>, repo_name=<Optional:None>, repo_group_name=<Optional:None>)
10 10
11 11 Fetch Full Text Search results using API.
12 12
@@ -23,9 +23,15 b' search'
23 23 :type page_limit: Optional(int)
24 24 :param page: Page number. Default first page.
25 25 :type page: Optional(int)
26 :param search_sort: Search sort order. Default newfirst. The following are valid options:
27 * newfirst
28 * oldfirst
26 :param search_sort: Search sort order.Must start with asc: or desc: Default desc:date.
27 The following are valid options:
28 * asc|desc:message.raw
29 * asc|desc:date
30 * asc|desc:author.email.raw
31 * asc|desc:message.raw
32 * newfirst (old legacy equal to desc:date)
33 * oldfirst (old legacy equal to asc:date)
34
29 35 :type search_sort: Optional(str)
30 36 :param repo_name: Filter by one repo. Default is all.
31 37 :type repo_name: Optional(str)
@@ -6,7 +6,7 b' store methods'
6 6 file_store_add (EE only)
7 7 ------------------------
8 8
9 .. py:function:: file_store_add(apiuser, filename, content)
9 .. py:function:: file_store_add(apiuser, filename, content, description=<Optional:''>)
10 10
11 11 Upload API for the file_store
12 12
@@ -19,6 +19,8 b' file_store_add (EE only)'
19 19 :type apiuser: AuthUser
20 20 :param filename: name of the file uploaded
21 21 :type filename: str
22 :param description: Optional description for added file
23 :type description: str
22 24 :param content: base64 encoded content of the uploaded file
23 25 :type content: str
24 26
@@ -35,3 +37,148 b' file_store_add (EE only)'
35 37 error : null
36 38
37 39
40 file_store_add_with_acl (EE only)
41 ---------------------------------
42
43 .. py:function:: file_store_add_with_acl(apiuser, filename, content, description=<Optional:''>, scope_user_id=<Optional:None>, scope_repo_id=<Optional:None>, scope_repo_group_id=<Optional:None>)
44
45 Upload API for the file_store
46
47 Example usage from CLI::
48 rhodecode-api --instance-name=enterprise-1 upload_file "{"content": "$(cat image.jpg | base64)", "filename":"image.jpg", "scope_repo_id":101}"
49
50 This command takes the following options:
51
52 :param apiuser: This is filled automatically from the |authtoken|.
53 :type apiuser: AuthUser
54 :param filename: name of the file uploaded
55 :type filename: str
56 :param description: Optional description for added file
57 :type description: str
58 :param content: base64 encoded content of the uploaded file
59 :type content: str
60
61 :param scope_user_id: Optionally bind this file to user.
62 This will check ACL in such way only this user can access the file.
63 :type scope_user_id: int
64 :param scope_repo_id: Optionally bind this file to repository.
65 This will check ACL in such way only user with proper access to such
66 repository can access the file.
67 :type scope_repo_id: int
68 :param scope_repo_group_id: Optionally bind this file to repository group.
69 This will check ACL in such way only user with proper access to such
70 repository group can access the file.
71 :type scope_repo_group_id: int
72
73 Example output:
74
75 .. code-block:: bash
76
77 id : <id_given_in_input>
78 result: {
79 "access_path": "/_file_store/download/84d156f7-8323-4ad3-9fce-4a8e88e1deaf-0.jpg",
80 "access_path_fqn": "http://server.domain.com/_file_store/download/84d156f7-8323-4ad3-9fce-4a8e88e1deaf-0.jpg",
81 "store_fid": "84d156f7-8323-4ad3-9fce-4a8e88e1deaf-0.jpg"
82 }
83 error : null
84
85
86 file_store_get_info (EE only)
87 -----------------------------
88
89 .. py:function:: file_store_get_info(apiuser, store_fid)
90
91 Get artifact data.
92
93 Example output:
94
95 .. code-block:: bash
96
97 id : <id_given_in_input>
98 result: {
99 "artifact": {
100 "access_path_fqn": "https://rhodecode.example.com/_file_store/download/0-031c2aa0-0d56-49a7-9ba3-b570bdd342ab.jpg",
101 "created_on": "2019-10-15T16:25:35.491",
102 "description": "my upload",
103 "downloaded_times": 1,
104 "file_uid": "0-031c2aa0-0d56-49a7-9ba3-b570bdd342ab.jpg",
105 "filename": "example.jpg",
106 "filename_org": "0-031c2aa0-0d56-49a7-9ba3-b570bdd342ab.jpg",
107 "hidden": false,
108 "metadata": [
109 {
110 "artifact": "0-031c2aa0-0d56-49a7-9ba3-b570bdd342ab.jpg",
111 "key": "yellow",
112 "section": "tags",
113 "value": "bar"
114 }
115 ],
116 "sha256": "818dff0f44574dfb6814d38e6bf3c60c5943d1d13653398ecddaedf2f6a5b04d",
117 "size": 18599,
118 "uploaded_by": {
119 "email": "admin@rhodecode.com",
120 "emails": [
121 "admin@rhodecode.com"
122 ],
123 "firstname": "Admin",
124 "lastname": "LastName",
125 "user_id": 2,
126 "username": "admin"
127 }
128 }
129 }
130 error : null
131
132
133 file_store_add_metadata (EE only)
134 ---------------------------------
135
136 .. py:function:: file_store_add_metadata(apiuser, store_fid, section, key, value, value_type=<Optional:'unicode'>)
137
138 Add metadata into artifact. The metadata consist of section, key, value. eg.
139 section='tags', 'key'='tag_name', value='1'
140
141 :param apiuser: This is filled automatically from the |authtoken|.
142 :type apiuser: AuthUser
143
144 :param store_fid: file uid, e.g 0-d054cb71-91ab-44e2-9e4b-23fe14b4d74a.mp4
145 :type store_fid: str
146
147 :param section: Section name to add metadata
148 :type section: str
149
150 :param key: Key to add as metadata
151 :type key: str
152
153 :param value: Value to add as metadata
154 :type value: str
155
156 :param value_type: Optional type, default is 'unicode' other types are:
157 int, list, bool, unicode, str
158
159 :type value_type: str
160
161 Example output:
162
163 .. code-block:: bash
164
165 id : <id_given_in_input>
166 result: {
167 "metadata": [
168 {
169 "artifact": "0-d054cb71-91ab-44e2-9e4b-23fe14b4d74a.mp4",
170 "key": "secret",
171 "section": "tags",
172 "value": "1"
173 },
174 {
175 "artifact": "0-d054cb71-91ab-44e2-9e4b-23fe14b4d74a.mp4",
176 "key": "video",
177 "section": "tags",
178 "value": "1"
179 }
180 ]
181 }
182 error : null
183
184
@@ -72,7 +72,9 b' create_user_group'
72 72 :param active: Set this group as active.
73 73 :type active: Optional(``True`` | ``False``)
74 74 :param sync: Set enabled or disabled the automatically sync from
75 external authentication types like ldap.
75 external authentication types like ldap. If User Group will be named like
76 one from e.g ldap and sync flag is enabled members will be synced automatically.
77 Sync type when enabled via API is set to `manual_api`
76 78 :type sync: Optional(``True`` | ``False``)
77 79
78 80 Example output:
@@ -391,7 +393,9 b' update_user_group'
391 393 :param active: Set the group as active.
392 394 :type active: Optional(``True`` | ``False``)
393 395 :param sync: Set enabled or disabled the automatically sync from
394 external authentication types like ldap.
396 external authentication types like ldap. If User Group will be named like
397 one from e.g ldap and sync flag is enabled members will be synced automatically.
398 Sync type when enabled via API is set to `manual_api`
395 399 :type sync: Optional(``True`` | ``False``)
396 400
397 401 Example output:
@@ -6,7 +6,7 b' user methods'
6 6 create_user
7 7 -----------
8 8
9 .. py:function:: create_user(apiuser, username, email, password=<Optional:''>, firstname=<Optional:''>, lastname=<Optional:''>, active=<Optional:True>, admin=<Optional:False>, extern_name=<Optional:'rhodecode'>, extern_type=<Optional:'rhodecode'>, force_password_change=<Optional:False>, create_personal_repo_group=<Optional:None>)
9 .. py:function:: create_user(apiuser, username, email, password=<Optional:''>, firstname=<Optional:''>, lastname=<Optional:''>, description=<Optional:''>, active=<Optional:True>, admin=<Optional:False>, extern_name=<Optional:'rhodecode'>, extern_type=<Optional:'rhodecode'>, force_password_change=<Optional:False>, create_personal_repo_group=<Optional:None>)
10 10
11 11 Creates a new user and returns the new user object.
12 12
@@ -27,6 +27,8 b' create_user'
27 27 :type firstname: Optional(str)
28 28 :param lastname: Set the new user surname.
29 29 :type lastname: Optional(str)
30 :param description: Set user description, or short bio. Metatags are allowed.
31 :type description: Optional(str)
30 32 :param active: Set the user as active.
31 33 :type active: Optional(``True`` | ``False``)
32 34 :param admin: Give the new user admin rights.
@@ -155,6 +157,7 b' get_user'
155 157 "extern_name": "rhodecode",
156 158 "extern_type": "rhodecode",
157 159 "firstname": "username",
160 "description": "user description",
158 161 "ip_addresses": [],
159 162 "language": null,
160 163 "last_login": "Timestamp",
@@ -268,7 +271,7 b' get_users'
268 271 update_user
269 272 -----------
270 273
271 .. py:function:: update_user(apiuser, userid, username=<Optional:None>, email=<Optional:None>, password=<Optional:None>, firstname=<Optional:None>, lastname=<Optional:None>, active=<Optional:None>, admin=<Optional:None>, extern_type=<Optional:None>, extern_name=<Optional:None>)
274 .. py:function:: update_user(apiuser, userid, username=<Optional:None>, email=<Optional:None>, password=<Optional:None>, firstname=<Optional:None>, lastname=<Optional:None>, description=<Optional:None>, active=<Optional:None>, admin=<Optional:None>, extern_type=<Optional:None>, extern_name=<Optional:None>)
272 275
273 276 Updates the details for the specified user, if that user exists.
274 277
@@ -291,6 +294,8 b' update_user'
291 294 :type firstname: Optional(str)
292 295 :param lastname: Set the new surname.
293 296 :type lastname: Optional(str)
297 :param description: Set user description, or short bio. Metatags are allowed.
298 :type description: Optional(str)
294 299 :param active: Set the new user as active.
295 300 :type active: Optional(``True`` | ``False``)
296 301 :param admin: Give the user admin rights.
General Comments 0
You need to be logged in to leave comments. Login now