@templmf/temp-solf-lmf 0.0.109 → 0.0.111
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package//347/224/237/344/272/247/347/216/257/345/242/203CK/346/211/251/345/256/271/346/255/245/351/252/244052701.docx +0 -0
- package/gitlab-foss-8-17-stable/doc/api/README.md +0 -391
- package/gitlab-foss-8-17-stable/doc/api/access_requests.md +0 -139
- package/gitlab-foss-8-17-stable/doc/api/award_emoji.md +0 -374
- package/gitlab-foss-8-17-stable/doc/api/boards.md +0 -241
- package/gitlab-foss-8-17-stable/doc/api/branches.md +0 -260
- package/gitlab-foss-8-17-stable/doc/api/broadcast_messages.md +0 -154
- package/gitlab-foss-8-17-stable/doc/api/build_triggers.md +0 -118
- package/gitlab-foss-8-17-stable/doc/api/build_variables.md +0 -128
- package/gitlab-foss-8-17-stable/doc/api/builds.md +0 -610
- package/gitlab-foss-8-17-stable/doc/api/ci/README.md +0 -24
- package/gitlab-foss-8-17-stable/doc/api/ci/builds.md +0 -147
- package/gitlab-foss-8-17-stable/doc/api/ci/lint.md +0 -49
- package/gitlab-foss-8-17-stable/doc/api/ci/runners.md +0 -59
- package/gitlab-foss-8-17-stable/doc/api/commits.md +0 -479
- package/gitlab-foss-8-17-stable/doc/api/deploy_key_multiple_projects.md +0 -29
- package/gitlab-foss-8-17-stable/doc/api/deploy_keys.md +0 -216
- package/gitlab-foss-8-17-stable/doc/api/deployments.md +0 -218
- package/gitlab-foss-8-17-stable/doc/api/enviroments.md +0 -121
- package/gitlab-foss-8-17-stable/doc/api/groups.md +0 -484
- package/gitlab-foss-8-17-stable/doc/api/issues.md +0 -856
- package/gitlab-foss-8-17-stable/doc/api/keys.md +0 -46
- package/gitlab-foss-8-17-stable/doc/api/labels.md +0 -257
- package/gitlab-foss-8-17-stable/doc/api/members.md +0 -175
- package/gitlab-foss-8-17-stable/doc/api/merge_requests.md +0 -1158
- package/gitlab-foss-8-17-stable/doc/api/milestones.md +0 -105
- package/gitlab-foss-8-17-stable/doc/api/namespaces.md +0 -70
- package/gitlab-foss-8-17-stable/doc/api/notes.md +0 -407
- package/gitlab-foss-8-17-stable/doc/api/notification_settings.md +0 -177
- package/gitlab-foss-8-17-stable/doc/api/oauth2.md +0 -137
- package/gitlab-foss-8-17-stable/doc/api/pipelines.md +0 -259
- package/gitlab-foss-8-17-stable/doc/api/project_snippets.md +0 -118
- package/gitlab-foss-8-17-stable/doc/api/projects.md +0 -1402
- package/gitlab-foss-8-17-stable/doc/api/repositories.md +0 -200
- package/gitlab-foss-8-17-stable/doc/api/repository_files.md +0 -134
- package/gitlab-foss-8-17-stable/doc/api/runners.md +0 -322
- package/gitlab-foss-8-17-stable/doc/api/services.md +0 -812
- package/gitlab-foss-8-17-stable/doc/api/session.md +0 -56
- package/gitlab-foss-8-17-stable/doc/api/settings.md +0 -126
- package/gitlab-foss-8-17-stable/doc/api/sidekiq_metrics.md +0 -152
- package/gitlab-foss-8-17-stable/doc/api/snippets.md +0 -232
- package/gitlab-foss-8-17-stable/doc/api/system_hooks.md +0 -146
- package/gitlab-foss-8-17-stable/doc/api/tags.md +0 -191
- package/gitlab-foss-8-17-stable/doc/api/templates/gitignores.md +0 -579
- package/gitlab-foss-8-17-stable/doc/api/templates/gitlab_ci_ymls.md +0 -120
- package/gitlab-foss-8-17-stable/doc/api/templates/licenses.md +0 -147
- package/gitlab-foss-8-17-stable/doc/api/todos.md +0 -296
- package/gitlab-foss-8-17-stable/doc/api/users.md +0 -835
- package/gitlab-foss-8-17-stable/doc/api/v3_to_v4.md +0 -14
- package/gitlab-foss-8-17-stable/doc/api/version.md +0 -23
package/package.json
CHANGED
|
Binary file
|
|
@@ -1,391 +0,0 @@
|
|
|
1
|
-
# GitLab API
|
|
2
|
-
|
|
3
|
-
Automate GitLab via a simple and powerful API. All definitions can be found
|
|
4
|
-
under [`/lib/api`](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/lib/api).
|
|
5
|
-
|
|
6
|
-
## Resources
|
|
7
|
-
|
|
8
|
-
Documentation for various API resources can be found separately in the
|
|
9
|
-
following locations:
|
|
10
|
-
|
|
11
|
-
- [Award Emoji](award_emoji.md)
|
|
12
|
-
- [Branches](branches.md)
|
|
13
|
-
- [Broadcast Messages](broadcast_messages.md)
|
|
14
|
-
- [Builds](builds.md)
|
|
15
|
-
- [Build Triggers](build_triggers.md)
|
|
16
|
-
- [Build Variables](build_variables.md)
|
|
17
|
-
- [Commits](commits.md)
|
|
18
|
-
- [Deployments](deployments.md)
|
|
19
|
-
- [Deploy Keys](deploy_keys.md)
|
|
20
|
-
- [Gitignores templates](templates/gitignores.md)
|
|
21
|
-
- [GitLab CI Config templates](templates/gitlab_ci_ymls.md)
|
|
22
|
-
- [Groups](groups.md)
|
|
23
|
-
- [Group Access Requests](access_requests.md)
|
|
24
|
-
- [Group Members](members.md)
|
|
25
|
-
- [Issues](issues.md)
|
|
26
|
-
- [Issue Boards](boards.md)
|
|
27
|
-
- [Keys](keys.md)
|
|
28
|
-
- [Labels](labels.md)
|
|
29
|
-
- [Merge Requests](merge_requests.md)
|
|
30
|
-
- [Milestones](milestones.md)
|
|
31
|
-
- [Open source license templates](templates/licenses.md)
|
|
32
|
-
- [Namespaces](namespaces.md)
|
|
33
|
-
- [Notes](notes.md) (comments)
|
|
34
|
-
- [Notification settings](notification_settings.md)
|
|
35
|
-
- [Pipelines](pipelines.md)
|
|
36
|
-
- [Projects](projects.md) including setting Webhooks
|
|
37
|
-
- [Project Access Requests](access_requests.md)
|
|
38
|
-
- [Project Members](members.md)
|
|
39
|
-
- [Project Snippets](project_snippets.md)
|
|
40
|
-
- [Repositories](repositories.md)
|
|
41
|
-
- [Repository Files](repository_files.md)
|
|
42
|
-
- [Runners](runners.md)
|
|
43
|
-
- [Services](services.md)
|
|
44
|
-
- [Session](session.md)
|
|
45
|
-
- [Settings](settings.md)
|
|
46
|
-
- [Sidekiq metrics](sidekiq_metrics.md)
|
|
47
|
-
- [System Hooks](system_hooks.md)
|
|
48
|
-
- [Tags](tags.md)
|
|
49
|
-
- [Todos](todos.md)
|
|
50
|
-
- [Users](users.md)
|
|
51
|
-
- [Validate CI configuration](ci/lint.md)
|
|
52
|
-
- [V3 to V4](v3_to_v4.md)
|
|
53
|
-
- [Version](version.md)
|
|
54
|
-
|
|
55
|
-
### Internal CI API
|
|
56
|
-
|
|
57
|
-
The following documentation is for the [internal CI API](ci/README.md):
|
|
58
|
-
|
|
59
|
-
- [Builds](ci/builds.md)
|
|
60
|
-
- [Runners](ci/runners.md)
|
|
61
|
-
|
|
62
|
-
## Authentication
|
|
63
|
-
|
|
64
|
-
All API requests require authentication via a session cookie or token. There are
|
|
65
|
-
three types of tokens available: private tokens, OAuth 2 tokens, and personal
|
|
66
|
-
access tokens.
|
|
67
|
-
|
|
68
|
-
If authentication information is invalid or omitted, an error message will be
|
|
69
|
-
returned with status code `401`:
|
|
70
|
-
|
|
71
|
-
```json
|
|
72
|
-
{
|
|
73
|
-
"message": "401 Unauthorized"
|
|
74
|
-
}
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
### Private Tokens
|
|
78
|
-
|
|
79
|
-
You need to pass a `private_token` parameter via query string or header. If passed as a
|
|
80
|
-
header, the header name must be `PRIVATE-TOKEN` (uppercase and with a dash instead of
|
|
81
|
-
an underscore). You can find or reset your private token in your account page
|
|
82
|
-
(`/profile/account`).
|
|
83
|
-
|
|
84
|
-
### OAuth 2 Tokens
|
|
85
|
-
|
|
86
|
-
You can use an OAuth 2 token to authenticate with the API by passing it either in the
|
|
87
|
-
`access_token` parameter or in the `Authorization` header.
|
|
88
|
-
|
|
89
|
-
Example of using the OAuth2 token in the header:
|
|
90
|
-
|
|
91
|
-
```shell
|
|
92
|
-
curl --header "Authorization: Bearer OAUTH-TOKEN" https://gitlab.example.com/api/v3/projects
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
Read more about [GitLab as an OAuth2 client](oauth2.md).
|
|
96
|
-
|
|
97
|
-
### Personal Access Tokens
|
|
98
|
-
|
|
99
|
-
> [Introduced][ce-3749] in GitLab 8.8.
|
|
100
|
-
|
|
101
|
-
You can create as many personal access tokens as you like from your GitLab
|
|
102
|
-
profile (`/profile/personal_access_tokens`); perhaps one for each application
|
|
103
|
-
that needs access to the GitLab API.
|
|
104
|
-
|
|
105
|
-
Once you have your token, pass it to the API using either the `private_token`
|
|
106
|
-
parameter or the `PRIVATE-TOKEN` header.
|
|
107
|
-
|
|
108
|
-
> [Introduced][ce-5951] in GitLab 8.15.
|
|
109
|
-
|
|
110
|
-
Personal Access Tokens can be created with one or more scopes that allow various actions
|
|
111
|
-
that a given token can perform. Although there are only two scopes available at the
|
|
112
|
-
moment – `read_user` and `api` – the groundwork has been laid to add more scopes easily.
|
|
113
|
-
|
|
114
|
-
At any time you can revoke any personal access token by just clicking **Revoke**.
|
|
115
|
-
|
|
116
|
-
### Session Cookie
|
|
117
|
-
|
|
118
|
-
When signing in to GitLab as an ordinary user, a `_gitlab_session` cookie is
|
|
119
|
-
set. The API will use this cookie for authentication if it is present, but using
|
|
120
|
-
the API to generate a new session cookie is currently not supported.
|
|
121
|
-
|
|
122
|
-
## Basic Usage
|
|
123
|
-
|
|
124
|
-
API requests should be prefixed with `api` and the API version. The API version
|
|
125
|
-
is defined in [`lib/api.rb`][lib-api-url].
|
|
126
|
-
|
|
127
|
-
Example of a valid API request:
|
|
128
|
-
|
|
129
|
-
```shell
|
|
130
|
-
GET https://gitlab.example.com/api/v3/projects?private_token=9koXpg98eAheJpvBs5tK
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
Example of a valid API request using cURL and authentication via header:
|
|
134
|
-
|
|
135
|
-
```shell
|
|
136
|
-
curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects"
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
The API uses JSON to serialize data. You don't need to specify `.json` at the
|
|
140
|
-
end of an API URL.
|
|
141
|
-
|
|
142
|
-
## Status codes
|
|
143
|
-
|
|
144
|
-
The API is designed to return different status codes according to context and
|
|
145
|
-
action. This way, if a request results in an error, the caller is able to get
|
|
146
|
-
insight into what went wrong.
|
|
147
|
-
|
|
148
|
-
The following table gives an overview of how the API functions generally behave.
|
|
149
|
-
|
|
150
|
-
| Request type | Description |
|
|
151
|
-
| ------------ | ----------- |
|
|
152
|
-
| `GET` | Access one or more resources and return the result as JSON. |
|
|
153
|
-
| `POST` | Return `201 Created` if the resource is successfully created and return the newly created resource as JSON. |
|
|
154
|
-
| `GET` / `PUT` / `DELETE` | Return `200 OK` if the resource is accessed, modified or deleted successfully. The (modified) result is returned as JSON. |
|
|
155
|
-
| `DELETE` | Designed to be idempotent, meaning a request to a resource still returns `200 OK` even it was deleted before or is not available. The reasoning behind this, is that the user is not really interested if the resource existed before or not. |
|
|
156
|
-
|
|
157
|
-
The following table shows the possible return codes for API requests.
|
|
158
|
-
|
|
159
|
-
| Return values | Description |
|
|
160
|
-
| ------------- | ----------- |
|
|
161
|
-
| `200 OK` | The `GET`, `PUT` or `DELETE` request was successful, the resource(s) itself is returned as JSON. |
|
|
162
|
-
| `201 Created` | The `POST` request was successful and the resource is returned as JSON. |
|
|
163
|
-
| `304 Not Modified` | Indicates that the resource has not been modified since the last request. |
|
|
164
|
-
| `400 Bad Request` | A required attribute of the API request is missing, e.g., the title of an issue is not given. |
|
|
165
|
-
| `401 Unauthorized` | The user is not authenticated, a valid [user token](#authentication) is necessary. |
|
|
166
|
-
| `403 Forbidden` | The request is not allowed, e.g., the user is not allowed to delete a project. |
|
|
167
|
-
| `404 Not Found` | A resource could not be accessed, e.g., an ID for a resource could not be found. |
|
|
168
|
-
| `405 Method Not Allowed` | The request is not supported. |
|
|
169
|
-
| `409 Conflict` | A conflicting resource already exists, e.g., creating a project with a name that already exists. |
|
|
170
|
-
| `422 Unprocessable` | The entity could not be processed. |
|
|
171
|
-
| `500 Server Error` | While handling the request something went wrong server-side. |
|
|
172
|
-
|
|
173
|
-
## Sudo
|
|
174
|
-
|
|
175
|
-
All API requests support performing an API call as if you were another user,
|
|
176
|
-
provided your private token is from an administrator account. You need to pass
|
|
177
|
-
the `sudo` parameter either via query string or a header with an ID/username of
|
|
178
|
-
the user you want to perform the operation as. If passed as a header, the
|
|
179
|
-
header name must be `SUDO` (uppercase).
|
|
180
|
-
|
|
181
|
-
If a non administrative `private_token` is provided, then an error message will
|
|
182
|
-
be returned with status code `403`:
|
|
183
|
-
|
|
184
|
-
```json
|
|
185
|
-
{
|
|
186
|
-
"message": "403 Forbidden - Must be admin to use sudo"
|
|
187
|
-
}
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
If the sudo user ID or username cannot be found, an error message will be
|
|
191
|
-
returned with status code `404`:
|
|
192
|
-
|
|
193
|
-
```json
|
|
194
|
-
{
|
|
195
|
-
"message": "404 Not Found: No user id or username for: <id/username>"
|
|
196
|
-
}
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
---
|
|
200
|
-
|
|
201
|
-
Example of a valid API call and a request using cURL with sudo request,
|
|
202
|
-
providing a username:
|
|
203
|
-
|
|
204
|
-
```shell
|
|
205
|
-
GET /projects?private_token=9koXpg98eAheJpvBs5tK&sudo=username
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
```shell
|
|
209
|
-
curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" --header "SUDO: username" "https://gitlab.example.com/api/v3/projects"
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
Example of a valid API call and a request using cURL with sudo request,
|
|
213
|
-
providing an ID:
|
|
214
|
-
|
|
215
|
-
```shell
|
|
216
|
-
GET /projects?private_token=9koXpg98eAheJpvBs5tK&sudo=23
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
```shell
|
|
220
|
-
curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" --header "SUDO: 23" "https://gitlab.example.com/api/v3/projects"
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
## Pagination
|
|
224
|
-
|
|
225
|
-
Sometimes the returned result will span across many pages. When listing
|
|
226
|
-
resources you can pass the following parameters:
|
|
227
|
-
|
|
228
|
-
| Parameter | Description |
|
|
229
|
-
| --------- | ----------- |
|
|
230
|
-
| `page` | Page number (default: `1`) |
|
|
231
|
-
| `per_page`| Number of items to list per page (default: `20`, max: `100`) |
|
|
232
|
-
|
|
233
|
-
In the example below, we list 50 [namespaces](namespaces.md) per page.
|
|
234
|
-
|
|
235
|
-
```bash
|
|
236
|
-
curl --request PUT --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/namespaces?per_page=50
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
### Pagination Link header
|
|
240
|
-
|
|
241
|
-
[Link headers](http://www.w3.org/wiki/LinkHeader) are sent back with each
|
|
242
|
-
response. They have `rel` set to prev/next/first/last and contain the relevant
|
|
243
|
-
URL. Please use these links instead of generating your own URLs.
|
|
244
|
-
|
|
245
|
-
In the cURL example below, we limit the output to 3 items per page (`per_page=3`)
|
|
246
|
-
and we request the second page (`page=2`) of [comments](notes.md) of the issue
|
|
247
|
-
with ID `8` which belongs to the project with ID `8`:
|
|
248
|
-
|
|
249
|
-
```bash
|
|
250
|
-
curl --head --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/8/issues/8/notes?per_page=3&page=2
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
The response will then be:
|
|
254
|
-
|
|
255
|
-
```
|
|
256
|
-
HTTP/1.1 200 OK
|
|
257
|
-
Cache-Control: no-cache
|
|
258
|
-
Content-Length: 1103
|
|
259
|
-
Content-Type: application/json
|
|
260
|
-
Date: Mon, 18 Jan 2016 09:43:18 GMT
|
|
261
|
-
Link: <https://gitlab.example.com/api/v3/projects/8/issues/8/notes?page=1&per_page=3>; rel="prev", <https://gitlab.example.com/api/v3/projects/8/issues/8/notes?page=3&per_page=3>; rel="next", <https://gitlab.example.com/api/v3/projects/8/issues/8/notes?page=1&per_page=3>; rel="first", <https://gitlab.example.com/api/v3/projects/8/issues/8/notes?page=3&per_page=3>; rel="last"
|
|
262
|
-
Status: 200 OK
|
|
263
|
-
Vary: Origin
|
|
264
|
-
X-Next-Page: 3
|
|
265
|
-
X-Page: 2
|
|
266
|
-
X-Per-Page: 3
|
|
267
|
-
X-Prev-Page: 1
|
|
268
|
-
X-Request-Id: 732ad4ee-9870-4866-a199-a9db0cde3c86
|
|
269
|
-
X-Runtime: 0.108688
|
|
270
|
-
X-Total: 8
|
|
271
|
-
X-Total-Pages: 3
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
### Other pagination headers
|
|
275
|
-
|
|
276
|
-
Additional pagination headers are also sent back.
|
|
277
|
-
|
|
278
|
-
| Header | Description |
|
|
279
|
-
| ------ | ----------- |
|
|
280
|
-
| `X-Total` | The total number of items |
|
|
281
|
-
| `X-Total-Pages` | The total number of pages |
|
|
282
|
-
| `X-Per-Page` | The number of items per page |
|
|
283
|
-
| `X-Page` | The index of the current page (starting at 1) |
|
|
284
|
-
| `X-Next-Page` | The index of the next page |
|
|
285
|
-
| `X-Prev-Page` | The index of the previous page |
|
|
286
|
-
|
|
287
|
-
## `id` vs `iid`
|
|
288
|
-
|
|
289
|
-
When you work with the API, you may notice two similar fields in API entities:
|
|
290
|
-
`id` and `iid`. The main difference between them is scope.
|
|
291
|
-
|
|
292
|
-
For example, an issue might have `id: 46` and `iid: 5`.
|
|
293
|
-
|
|
294
|
-
| Parameter | Description |
|
|
295
|
-
| --------- | ----------- |
|
|
296
|
-
| `id` | Is unique across all issues and is used for any API call |
|
|
297
|
-
| `iid` | Is unique only in scope of a single project. When you browse issues or merge requests with the Web UI, you see the `iid` |
|
|
298
|
-
|
|
299
|
-
That means that if you want to get an issue via the API you should use the `id`:
|
|
300
|
-
|
|
301
|
-
```bash
|
|
302
|
-
GET /projects/42/issues/:id
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
On the other hand, if you want to create a link to a web page you should use
|
|
306
|
-
the `iid`:
|
|
307
|
-
|
|
308
|
-
```bash
|
|
309
|
-
GET /projects/42/issues/:iid
|
|
310
|
-
```
|
|
311
|
-
|
|
312
|
-
## Data validation and error reporting
|
|
313
|
-
|
|
314
|
-
When working with the API you may encounter validation errors, in which case
|
|
315
|
-
the API will answer with an HTTP `400` status.
|
|
316
|
-
|
|
317
|
-
Such errors appear in two cases:
|
|
318
|
-
|
|
319
|
-
- A required attribute of the API request is missing, e.g., the title of an
|
|
320
|
-
issue is not given
|
|
321
|
-
- An attribute did not pass the validation, e.g., user bio is too long
|
|
322
|
-
|
|
323
|
-
When an attribute is missing, you will get something like:
|
|
324
|
-
|
|
325
|
-
```
|
|
326
|
-
HTTP/1.1 400 Bad Request
|
|
327
|
-
Content-Type: application/json
|
|
328
|
-
{
|
|
329
|
-
"message":"400 (Bad request) \"title\" not given"
|
|
330
|
-
}
|
|
331
|
-
```
|
|
332
|
-
|
|
333
|
-
When a validation error occurs, error messages will be different. They will
|
|
334
|
-
hold all details of validation errors:
|
|
335
|
-
|
|
336
|
-
```
|
|
337
|
-
HTTP/1.1 400 Bad Request
|
|
338
|
-
Content-Type: application/json
|
|
339
|
-
{
|
|
340
|
-
"message": {
|
|
341
|
-
"bio": [
|
|
342
|
-
"is too long (maximum is 255 characters)"
|
|
343
|
-
]
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
```
|
|
347
|
-
|
|
348
|
-
This makes error messages more machine-readable. The format can be described as
|
|
349
|
-
follows:
|
|
350
|
-
|
|
351
|
-
```json
|
|
352
|
-
{
|
|
353
|
-
"message": {
|
|
354
|
-
"<property-name>": [
|
|
355
|
-
"<error-message>",
|
|
356
|
-
"<error-message>",
|
|
357
|
-
...
|
|
358
|
-
],
|
|
359
|
-
"<embed-entity>": {
|
|
360
|
-
"<property-name>": [
|
|
361
|
-
"<error-message>",
|
|
362
|
-
"<error-message>",
|
|
363
|
-
...
|
|
364
|
-
],
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
```
|
|
369
|
-
|
|
370
|
-
## Unknown route
|
|
371
|
-
|
|
372
|
-
When you try to access an API URL that does not exist you will receive 404 Not Found.
|
|
373
|
-
|
|
374
|
-
```
|
|
375
|
-
HTTP/1.1 404 Not Found
|
|
376
|
-
Content-Type: application/json
|
|
377
|
-
{
|
|
378
|
-
"error": "404 Not Found"
|
|
379
|
-
}
|
|
380
|
-
```
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
## Clients
|
|
384
|
-
|
|
385
|
-
There are many unofficial GitLab API Clients for most of the popular
|
|
386
|
-
programming languages. Visit the [GitLab website] for a complete list.
|
|
387
|
-
|
|
388
|
-
[GitLab website]: https://about.gitlab.com/applications/#api-clients "Clients using the GitLab API"
|
|
389
|
-
[lib-api-url]: https://gitlab.com/gitlab-org/gitlab-ce/tree/master/lib/api/api.rb
|
|
390
|
-
[ce-3749]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3749
|
|
391
|
-
[ce-5951]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5951
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
# Group and project access requests
|
|
2
|
-
|
|
3
|
-
>**Note:** This feature was introduced in GitLab 8.11
|
|
4
|
-
|
|
5
|
-
**Valid access levels**
|
|
6
|
-
|
|
7
|
-
The access levels are defined in the `Gitlab::Access` module. Currently, these levels are recognized:
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
10 => Guest access
|
|
11
|
-
20 => Reporter access
|
|
12
|
-
30 => Developer access
|
|
13
|
-
40 => Master access
|
|
14
|
-
50 => Owner access # Only valid for groups
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## List access requests for a group or project
|
|
18
|
-
|
|
19
|
-
Gets a list of access requests viewable by the authenticated user.
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
GET /groups/:id/access_requests
|
|
23
|
-
GET /projects/:id/access_requests
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
| Attribute | Type | Required | Description |
|
|
27
|
-
| --------- | ---- | -------- | ----------- |
|
|
28
|
-
| `id` | integer/string | yes | The group/project ID or path |
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/groups/:id/access_requests
|
|
32
|
-
curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/:id/access_requests
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Example response:
|
|
36
|
-
|
|
37
|
-
```json
|
|
38
|
-
[
|
|
39
|
-
{
|
|
40
|
-
"id": 1,
|
|
41
|
-
"username": "raymond_smith",
|
|
42
|
-
"name": "Raymond Smith",
|
|
43
|
-
"state": "active",
|
|
44
|
-
"created_at": "2012-10-22T14:13:35Z",
|
|
45
|
-
"requested_at": "2012-10-22T14:13:35Z"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"id": 2,
|
|
49
|
-
"username": "john_doe",
|
|
50
|
-
"name": "John Doe",
|
|
51
|
-
"state": "active",
|
|
52
|
-
"created_at": "2012-10-22T14:13:35Z",
|
|
53
|
-
"requested_at": "2012-10-22T14:13:35Z"
|
|
54
|
-
}
|
|
55
|
-
]
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
## Request access to a group or project
|
|
59
|
-
|
|
60
|
-
Requests access for the authenticated user to a group or project.
|
|
61
|
-
|
|
62
|
-
```
|
|
63
|
-
POST /groups/:id/access_requests
|
|
64
|
-
POST /projects/:id/access_requests
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
| Attribute | Type | Required | Description |
|
|
68
|
-
| --------- | ---- | -------- | ----------- |
|
|
69
|
-
| `id` | integer/string | yes | The group/project ID or path |
|
|
70
|
-
|
|
71
|
-
```bash
|
|
72
|
-
curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/groups/:id/access_requests
|
|
73
|
-
curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/:id/access_requests
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
Example response:
|
|
77
|
-
|
|
78
|
-
```json
|
|
79
|
-
{
|
|
80
|
-
"id": 1,
|
|
81
|
-
"username": "raymond_smith",
|
|
82
|
-
"name": "Raymond Smith",
|
|
83
|
-
"state": "active",
|
|
84
|
-
"created_at": "2012-10-22T14:13:35Z",
|
|
85
|
-
"requested_at": "2012-10-22T14:13:35Z"
|
|
86
|
-
}
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
## Approve an access request
|
|
90
|
-
|
|
91
|
-
Approves an access request for the given user.
|
|
92
|
-
|
|
93
|
-
```
|
|
94
|
-
PUT /groups/:id/access_requests/:user_id/approve
|
|
95
|
-
PUT /projects/:id/access_requests/:user_id/approve
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
| Attribute | Type | Required | Description |
|
|
99
|
-
| --------- | ---- | -------- | ----------- |
|
|
100
|
-
| `id` | integer/string | yes | The group/project ID or path |
|
|
101
|
-
| `user_id` | integer | yes | The user ID of the access requester |
|
|
102
|
-
| `access_level` | integer | no | A valid access level (defaults: `30`, developer access level) |
|
|
103
|
-
|
|
104
|
-
```bash
|
|
105
|
-
curl --request PUT --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/groups/:id/access_requests/:user_id/approve?access_level=20
|
|
106
|
-
curl --request PUT --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/:id/access_requests/:user_id/approve?access_level=20
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
Example response:
|
|
110
|
-
|
|
111
|
-
```json
|
|
112
|
-
{
|
|
113
|
-
"id": 1,
|
|
114
|
-
"username": "raymond_smith",
|
|
115
|
-
"name": "Raymond Smith",
|
|
116
|
-
"state": "active",
|
|
117
|
-
"created_at": "2012-10-22T14:13:35Z",
|
|
118
|
-
"access_level": 20
|
|
119
|
-
}
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
## Deny an access request
|
|
123
|
-
|
|
124
|
-
Denies an access request for the given user.
|
|
125
|
-
|
|
126
|
-
```
|
|
127
|
-
DELETE /groups/:id/access_requests/:user_id
|
|
128
|
-
DELETE /projects/:id/access_requests/:user_id
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
| Attribute | Type | Required | Description |
|
|
132
|
-
| --------- | ---- | -------- | ----------- |
|
|
133
|
-
| `id` | integer/string | yes | The group/project ID or path |
|
|
134
|
-
| `user_id` | integer | yes | The user ID of the access requester |
|
|
135
|
-
|
|
136
|
-
```bash
|
|
137
|
-
curl --request DELETE --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/groups/:id/access_requests/:user_id
|
|
138
|
-
curl --request DELETE --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/:id/access_requests/:user_id
|
|
139
|
-
```
|