diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-22 14:31:16 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-22 14:31:16 +0300 |
commit | 905c1110b08f93a19661cf42a276c7ea90d0a0ff (patch) | |
tree | 756d138db422392c00471ab06acdff92c5a9b69c /doc/api | |
parent | 50d93f8d1686950fc58dda4823c4835fd0d8c14b (diff) |
Add latest changes from gitlab-org/gitlab@12-4-stable-ee
Diffstat (limited to 'doc/api')
39 files changed, 1102 insertions, 232 deletions
diff --git a/doc/api/README.md b/doc/api/README.md index d037ab1a95f..6858e5b7d56 100644 --- a/doc/api/README.md +++ b/doc/api/README.md @@ -329,7 +329,7 @@ curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab ### Pagination Link header -[Link headers](http://www.w3.org/wiki/LinkHeader) are sent back with each +[Link headers](https://www.w3.org/wiki/LinkHeader) are sent back with each response. They have `rel` set to prev/next/first/last and contain the relevant URL. Please use these links instead of generating your own URLs. @@ -563,7 +563,7 @@ The correct encoding for the query parameter would be: ## Clients There are many unofficial GitLab API Clients for most of the popular -programming languages. Visit the [GitLab website] for a complete list. +programming languages. Visit the [GitLab website](https://about.gitlab.com/partners/#api-clients) for a complete list. ## Rate limits @@ -572,7 +572,6 @@ For administrator documentation on rate limit settings, see specifically used by GitLab.com, see [GitLab.com-specific rate limits](../user/gitlab_com/index.md#gitlabcom-specific-rate-limits). -[GitLab website]: https://about.gitlab.com/applications/#api-clients "Clients using the GitLab API" [lib-api-url]: https://gitlab.com/gitlab-org/gitlab-foss/tree/master/lib/api/api.rb [ce-3749]: https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/3749 [ce-5951]: https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/5951 diff --git a/doc/api/access_requests.md b/doc/api/access_requests.md index 973c3968d90..584a4ecb89c 100644 --- a/doc/api/access_requests.md +++ b/doc/api/access_requests.md @@ -6,7 +6,7 @@ The access levels are defined in the `Gitlab::Access` module. Currently, these levels are recognized: -``` +```plaintext 10 => Guest access 20 => Reporter access 30 => Developer access @@ -18,14 +18,16 @@ Gets a list of access requests viewable by the authenticated user. -``` +```plaintext GET /groups/:id/access_requests GET /projects/:id/access_requests ``` -| Attribute | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | +| Attribute | Type | Required | Description | +| --------- | -------------- | -------- | ----------- | +| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | + +Example request: ```bash curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/:id/access_requests @@ -59,14 +61,16 @@ Example response: Requests access for the authenticated user to a group or project. -``` +```plaintext POST /groups/:id/access_requests POST /projects/:id/access_requests ``` -| Attribute | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | +| Attribute | Type | Required | Description | +| --------- | -------------- | -------- | ----------- | +| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | + +Example request: ```bash curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/:id/access_requests @@ -90,16 +94,18 @@ Example response: Approves an access request for the given user. -``` +```plaintext PUT /groups/:id/access_requests/:user_id/approve PUT /projects/:id/access_requests/:user_id/approve ``` -| Attribute | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | -| `user_id` | integer | yes | The user ID of the access requester | -| `access_level` | integer | no | A valid access level (defaults: `30`, developer access level) | +| Attribute | Type | Required | Description | +| -------------- | -------------- | -------- | ----------- | +| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | +| `user_id` | integer | yes | The user ID of the access requester | +| `access_level` | integer | no | A valid access level (defaults: `30`, developer access level) | + +Example request: ```bash curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/:id/access_requests/:user_id/approve?access_level=20 @@ -123,15 +129,17 @@ Example response: Denies an access request for the given user. -``` +```plaintext DELETE /groups/:id/access_requests/:user_id DELETE /projects/:id/access_requests/:user_id ``` -| Attribute | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | -| `user_id` | integer | yes | The user ID of the access requester | +| Attribute | Type | Required | Description | +| --------- | -------------- | -------- | ----------- | +| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | +| `user_id` | integer | yes | The user ID of the access requester | + +Example request: ```bash curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/:id/access_requests/:user_id diff --git a/doc/api/api_resources.md b/doc/api/api_resources.md index e2ddc2cbc18..232a9825691 100644 --- a/doc/api/api_resources.md +++ b/doc/api/api_resources.md @@ -104,6 +104,7 @@ The following API resources are available outside of project and group contexts | Resource | Available endpoints | |:--------------------------------------------------|:------------------------------------------------------------------------| | [Applications](applications.md) | `/applications` | +| [Audit Events](audit_events.md) **(PREMIUM ONLY)** | `/audit_events` | | [Avatar](avatar.md) | `/avatar` | | [Broadcast messages](broadcast_messages.md) | `/broadcast_messages` | | [Code snippets](snippets.md) | `/snippets` | diff --git a/doc/api/audit_events.md b/doc/api/audit_events.md new file mode 100644 index 00000000000..aca221cf990 --- /dev/null +++ b/doc/api/audit_events.md @@ -0,0 +1,115 @@ +# Audit Events API **(PREMIUM ONLY)** + +The Audit Events API allows you to retrieve [instance audit events](../administration/audit_events.md#instance-events-premium-only). + +To retrieve audit events using the API, you must [authenticate yourself](README.html#authentication) as an Administrator. + +## Retrieve all instance audit events + +``` +GET /audit_events +``` + +| Attribute | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `created_after` | string | no | Return audit events created on or after the given time. Format: ISO 8601 YYYY-MM-DDTHH:MM:SSZ | +| `created_before` | string | no | Return audit events created on or before the given time. Format: ISO 8601 YYYY-MM-DDTHH:MM:SSZ | +| `entity_type` | string | no | Return audit events for the given entity type. Valid values are: `User`, `Group`, or `Project`. | +| `entity_id` | boolean | no | Return audit events for the given entity ID. Requires `entity_type` attribute to be present. | + +By default, `GET` requests return 20 results at a time because the API results +are paginated. + +Read more on [pagination](README.md#pagination). + +```bash +curl --header "PRIVATE-TOKEN: <your_access_token>" https://primary.example.com/api/v4/audit_events +``` + +Example response: + +```json +[ + { + "id": 1, + "author_id": 1, + "entity_id": 6, + "entity_type": "Project", + "details": { + "custom_message": "Project archived", + "author_name": "Administrator", + "target_id": "flightjs/flight", + "target_type": "Project", + "target_details": "flightjs/flight", + "ip_address": "127.0.0.1", + "entity_path": "flightjs/flight" + }, + "created_at": "2019-08-30T07:00:41.885Z" + }, + { + "id": 2, + "author_id": 1, + "entity_id": 60, + "entity_type": "Group", + "details": { + "add": "group", + "author_name": "Administrator", + "target_id": "flightjs", + "target_type": "Group", + "target_details": "flightjs", + "ip_address": "127.0.0.1", + "entity_path": "flightjs" + }, + "created_at": "2019-08-27T18:36:44.162Z" + }, + { + "id": 3, + "author_id": 51, + "entity_id": 51, + "entity_type": "User", + "details": { + "change": "email address", + "from": "hello@flightjs.com", + "to": "maintainer@flightjs.com", + "author_name": "Andreas", + "target_id": 51, + "target_type": "User", + "target_details": "Andreas", + "ip_address": null, + "entity_path": "Andreas" + }, + "created_at": "2019-08-22T16:34:25.639Z" + } +] +``` + +## Retrieve single instance audit event + +``` +GET /audit_events/:id +``` + +```bash +curl --header "PRIVATE-TOKEN: <your_access_token>" https://primary.example.com/api/v4/audit_events/1 +``` + +Example response: + +```json +{ + "id": 1, + "author_id": 1, + "entity_id": 6, + "entity_type": "Project", + "details": { + "custom_message": "Project archived", + "author_name": "Administrator", + "target_id": "flightjs/flight", + "target_type": "Project", + "target_details": "flightjs/flight", + "ip_address": "127.0.0.1", + "entity_path": "flightjs/flight" + }, + "created_at": "2019-08-30T07:00:41.885Z" +} +``` diff --git a/doc/api/boards.md b/doc/api/boards.md index 151ab5487dd..b9c2a984dc5 100644 --- a/doc/api/boards.md +++ b/doc/api/boards.md @@ -48,7 +48,8 @@ Example response: "color" : "#F0AD4E", "description" : null }, - "position" : 1 + "position" : 1, + "max_issue_count": 0 }, { "id" : 2, @@ -57,7 +58,8 @@ Example response: "color" : "#FF0000", "description" : null }, - "position" : 2 + "position" : 2, + "max_issue_count": 0 }, { "id" : 3, @@ -66,7 +68,8 @@ Example response: "color" : "#FF5F00", "description" : null }, - "position" : 3 + "position" : 3, + "max_issue_count": 0 } ] } @@ -117,7 +120,8 @@ Example response: "color" : "#F0AD4E", "description" : null }, - "position" : 1 + "position" : 1, + "max_issue_count": 0 }, { "id" : 2, @@ -126,7 +130,8 @@ Example response: "color" : "#FF0000", "description" : null }, - "position" : 2 + "position" : 2, + "max_issue_count": 0 }, { "id" : 3, @@ -135,7 +140,8 @@ Example response: "color" : "#FF5F00", "description" : null }, - "position" : 3 + "position" : 3, + "max_issue_count": 0 } ] } @@ -185,7 +191,8 @@ Example response: "color" : "#F0AD4E", "description" : null }, - "position" : 1 + "position" : 1, + "max_issue_count": 0 }, { "id" : 2, @@ -194,7 +201,8 @@ Example response: "color" : "#FF0000", "description" : null }, - "position" : 2 + "position" : 2, + "max_issue_count": 0 }, { "id" : 3, @@ -203,7 +211,8 @@ Example response: "color" : "#FF5F00", "description" : null }, - "position" : 3 + "position" : 3, + "max_issue_count": 0 } ] } @@ -336,7 +345,8 @@ Example response: "color" : "#F0AD4E", "description" : null }, - "position" : 1 + "position" : 1, + "max_issue_count": 0 }, { "id" : 2, @@ -345,7 +355,8 @@ Example response: "color" : "#FF0000", "description" : null }, - "position" : 2 + "position" : 2, + "max_issue_count": 0 }, { "id" : 3, @@ -354,7 +365,8 @@ Example response: "color" : "#FF5F00", "description" : null }, - "position" : 3 + "position" : 3, + "max_issue_count": 0 } ] ``` @@ -387,7 +399,8 @@ Example response: "color" : "#F0AD4E", "description" : null }, - "position" : 1 + "position" : 1, + "max_issue_count": 0 } ``` @@ -427,7 +440,8 @@ Example response: "color" : "#F0AD4E", "description" : null }, - "position" : 1 + "position" : 1, + "max_issue_count": 0 } ``` @@ -460,7 +474,8 @@ Example response: "color" : "#F0AD4E", "description" : null }, - "position" : 1 + "position" : 1, + "max_issue_count": 0 } ``` diff --git a/doc/api/commits.md b/doc/api/commits.md index cf1bca7b193..3927a4bbc62 100644 --- a/doc/api/commits.md +++ b/doc/api/commits.md @@ -11,12 +11,13 @@ GET /projects/:id/repository/commits | Attribute | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user -| `ref_name` | string | no | The name of a repository branch or tag or if not given the default branch | +| `ref_name` | string | no | The name of a repository branch, tag or revision range, or if not given the default branch | | `since` | string | no | Only commits after or on this date will be returned in ISO 8601 format YYYY-MM-DDTHH:MM:SSZ | | `until` | string | no | Only commits before or on this date will be returned in ISO 8601 format YYYY-MM-DDTHH:MM:SSZ | | `path` | string | no | The file path | | `all` | boolean | no | Retrieve every commit from the repository | | `with_stats` | boolean | no | Stats about each commit will be added to the response | +| `first_parent` | boolean | no | Follow only the first parent commit upon seeing a merge commit | ```bash curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/repository/commits" @@ -533,7 +534,7 @@ Example response: }, "description" : null, "sha" : "18f3e63d05582537db6d183d9d557be09e1f90c8", - "target_url" : "https://gitlab.example.com/thedude/gitlab-ce/builds/91", + "target_url" : "https://gitlab.example.com/thedude/gitlab-foss/builds/91", "finished_at" : null, "id" : 91, "ref" : "master" @@ -544,7 +545,7 @@ Example response: "allow_failure" : false, "status" : "pending", "created_at" : "2016-01-19T08:40:25.832Z", - "target_url" : "https://gitlab.example.com/thedude/gitlab-ce/builds/90", + "target_url" : "https://gitlab.example.com/thedude/gitlab-foss/builds/90", "id" : 90, "finished_at" : null, "ref" : "master", diff --git a/doc/api/container_registry.md b/doc/api/container_registry.md index cb1a81b97b6..7e5e265351e 100644 --- a/doc/api/container_registry.md +++ b/doc/api/container_registry.md @@ -252,8 +252,8 @@ This action does not delete blobs. In order to delete them and recycle disk spac [run the garbage collection](https://docs.gitlab.com/omnibus/maintenance/README.html#removing-unused-layers-not-referenced-by-manifests). NOTE: **Note:** -Due to a [Docker Distribution deficiency](https://gitlab.com/gitlab-org/gitlab-foss/issues/21405), -it doesn't remove tags whose manifest is shared by multiple tags. +Since GitLab 12.4, individual tags are deleted. +For more details, see the [discussion](https://gitlab.com/gitlab-org/gitlab/issues/15737). Examples: diff --git a/doc/api/deployments.md b/doc/api/deployments.md index 0a67f134d54..27254c42e3a 100644 --- a/doc/api/deployments.md +++ b/doc/api/deployments.md @@ -24,6 +24,7 @@ Example of response [ { "created_at": "2016-08-11T07:36:40.222Z", + "updated_at": "2016-08-11T07:38:12.414Z", "deployable": { "commit": { "author_email": "admin@example.com", @@ -83,6 +84,7 @@ Example of response }, { "created_at": "2016-08-11T11:32:35.444Z", + "updated_at": "2016-08-11T11:34:01.123Z", "deployable": { "commit": { "author_email": "admin@example.com", @@ -167,6 +169,7 @@ Example of response "ref": "master", "sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a", "created_at": "2016-08-11T11:32:35.444Z", + "updated_at": "2016-08-11T11:34:01.123Z", "user": { "name": "Administrator", "username": "root", @@ -220,3 +223,100 @@ Example of response } } ``` + +## Create a deployment + +``` +POST /projects/:id/deployments +``` + +| Attribute | Type | Required | Description | +|------------------|----------------|----------|---------------------| +| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | +| `environment` | string | yes | The name of the environment to create the deployment for | +| `sha` | string | yes | The SHA of the commit that is deployed | +| `ref` | string | yes | The name of the branch or tag that is deployed | +| `tag` | boolean | yes | A boolean that indicates if the deployed ref is a tag (true) or not (false) | +| `status` | string | yes | The status of the deployment | + +The status can be one of the following values: + +- created +- running +- success +- failed +- canceled + +```bash +curl --data "environment=production&sha=a91957a858320c0e17f3a0eca7cfacbff50ea29a&ref=master&tag=false&status=success" --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/deployments" +``` + +Example of a response: + +```json +{ + "id": 42, + "iid": 2, + "ref": "master", + "sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a", + "created_at": "2016-08-11T11:32:35.444Z", + "status": "success", + "user": { + "name": "Administrator", + "username": "root", + "id": 1, + "state": "active", + "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", + "web_url": "http://localhost:3000/root" + }, + "environment": { + "id": 9, + "name": "production", + "external_url": "https://about.gitlab.com" + }, + "deployable": null +} +``` + +## Updating a deployment + +``` +PUT /projects/:id/deployments/:deployment_id +``` + +| Attribute | Type | Required | Description | +|------------------|----------------|----------|---------------------| +| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | +| `deployment_id` | integer | yes | The ID of the deployment to update | +| `status` | string | yes | The new status of the deployment | + +```bash +curl --request PUT --data "status=success" --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/deployments/42" +``` + +Example of a response: + +```json +{ + "id": 42, + "iid": 2, + "ref": "master", + "sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a", + "created_at": "2016-08-11T11:32:35.444Z", + "status": "success", + "user": { + "name": "Administrator", + "username": "root", + "id": 1, + "state": "active", + "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", + "web_url": "http://localhost:3000/root" + }, + "environment": { + "id": 9, + "name": "production", + "external_url": "https://about.gitlab.com" + }, + "deployable": null +} +``` diff --git a/doc/api/environments.md b/doc/api/environments.md index 44f86861ff7..3f46c11ed69 100644 --- a/doc/api/environments.md +++ b/doc/api/environments.md @@ -26,7 +26,8 @@ Example response: "id": 1, "name": "review/fix-foo", "slug": "review-fix-foo-dfjre3", - "external_url": "https://review-fix-foo-dfjre3.example.gitlab.com" + "external_url": "https://review-fix-foo-dfjre3.example.gitlab.com", + "state": "available" } ] ``` @@ -54,12 +55,14 @@ Example of response "name": "review/fix-foo", "slug": "review-fix-foo-dfjre3", "external_url": "https://review-fix-foo-dfjre3.example.gitlab.com" + "state": "available", "last_deployment": { "id": 100, "iid": 34, "ref": "fdroid", "sha": "416d8ea11849050d3d1f5104cf8cf51053e790ab", "created_at": "2019-03-25T18:55:13.252Z", + "status": "success", "user": { "id": 1, "name": "Administrator", @@ -163,7 +166,8 @@ Example response: "id": 1, "name": "deploy", "slug": "deploy", - "external_url": "https://deploy.example.gitlab.com" + "external_url": "https://deploy.example.gitlab.com", + "state": "available" } ``` @@ -180,7 +184,7 @@ PUT /projects/:id/environments/:environments_id | Attribute | Type | Required | Description | | --------------- | ------- | --------------------------------- | ------------------------------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | -| `environment_id` | integer | yes | The ID of the environment | The ID of the environment | +| `environment_id` | integer | yes | The ID of the environment | | `name` | string | no | The new name of the environment | | `external_url` | string | no | The new external_url | @@ -195,7 +199,8 @@ Example response: "id": 1, "name": "staging", "slug": "staging", - "external_url": "https://staging.example.gitlab.com" + "external_url": "https://staging.example.gitlab.com", + "state": "available" } ``` @@ -240,6 +245,7 @@ Example response: "id": 1, "name": "deploy", "slug": "deploy", - "external_url": "https://deploy.example.gitlab.com" + "external_url": "https://deploy.example.gitlab.com", + "state": "stopped" } ``` diff --git a/doc/api/epics.md b/doc/api/epics.md index 92b534fc187..c7a050f1465 100644 --- a/doc/api/epics.md +++ b/doc/api/epics.md @@ -67,7 +67,7 @@ Example response: "title": "Accusamus iste et ullam ratione voluptatem omnis debitis dolor est.", "description": "Molestias dolorem eos vitae expedita impedit necessitatibus quo voluptatum.", "state": "opened", - "web_edit_url": "http://localhost:3001/groups/test/-/epics/4", + "web_url": "http://localhost:3001/groups/test/-/epics/4", "reference": "&4", "author": { "id": 10, @@ -88,6 +88,7 @@ Example response: "due_date_from_milestones": "2018-07-31", "created_at": "2018-07-17T13:36:22.770Z", "updated_at": "2018-07-18T12:22:05.239Z", + "closed_at": "2018-08-18T12:22:05.239Z", "labels": [], "upvotes": 4, "downvotes": 0 @@ -122,7 +123,7 @@ Example response: "title": "Ea cupiditate dolores ut vero consequatur quasi veniam voluptatem et non.", "description": "Molestias dolorem eos vitae expedita impedit necessitatibus quo voluptatum.", "state": "opened", - "web_edit_url": "http://localhost:3001/groups/test/-/epics/5", + "web_url": "http://localhost:3001/groups/test/-/epics/5", "reference": "&5", "author":{ "id": 7, @@ -143,9 +144,11 @@ Example response: "due_date_from_milestones": "2018-07-31", "created_at": "2018-07-17T13:36:22.770Z", "updated_at": "2018-07-18T12:22:05.239Z", + "closed_at": "2018-08-18T12:22:05.239Z", "labels": [], "upvotes": 4, - "downvotes": 0 + "downvotes": 0, + "subscribed": true } ``` @@ -167,7 +170,7 @@ POST /groups/:id/epics | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user | | `title` | string | yes | The title of the epic | | `labels` | string | no | The comma separated list of labels | -| `description` | string | no | The description of the epic. Limited to 1 000 000 characters. | +| `description` | string | no | The description of the epic. Limited to 1,048,576 characters. | | `start_date_is_fixed` | boolean | no | Whether start date should be sourced from `start_date_fixed` or from milestones (since 11.3) | | `start_date_fixed` | string | no | The fixed start date of an epic (since 11.3) | | `due_date_is_fixed` | boolean | no | Whether due date should be sourced from `due_date_fixed` or from milestones (since 11.3) | @@ -188,7 +191,7 @@ Example response: "title": "Epic", "description": "Epic description", "state": "opened", - "web_edit_url": "http://localhost:3001/groups/test/-/epics/6", + "web_url": "http://localhost:3001/groups/test/-/epics/5", "reference": "&6", "author": { "name" : "Alexandra Bashirian", @@ -209,6 +212,7 @@ Example response: "due_date_from_milestones": "2018-07-31", "created_at": "2018-07-17T13:36:22.770Z", "updated_at": "2018-07-18T12:22:05.239Z", + "closed_at": "2018-08-18T12:22:05.239Z", "labels": [], "upvotes": 4, "downvotes": 0 @@ -233,7 +237,7 @@ PUT /groups/:id/epics/:epic_iid | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user | | `epic_iid` | integer/string | yes | The internal ID of the epic | | `title` | string | no | The title of an epic | -| `description` | string | no | The description of an epic. Limited to 1 000 000 characters. | +| `description` | string | no | The description of an epic. Limited to 1,048,576 characters. | | `labels` | string | no | The comma separated list of labels | | `start_date_is_fixed` | boolean | no | Whether start date should be sourced from `start_date_fixed` or from milestones (since 11.3) | | `start_date_fixed` | string | no | The fixed start date of an epic (since 11.3) | @@ -255,7 +259,7 @@ Example response: "title": "New Title", "description": "Epic description", "state": "opened", - "web_edit_url": "http://localhost:3001/groups/test/-/epics/6", + "web_url": "http://localhost:3001/groups/test/-/epics/5", "reference": "&6", "author": { "name" : "Alexandra Bashirian", @@ -276,6 +280,7 @@ Example response: "due_date_from_milestones": "2018-07-31", "created_at": "2018-07-17T13:36:22.770Z", "updated_at": "2018-07-18T12:22:05.239Z", + "closed_at": "2018-08-18T12:22:05.239Z", "labels": [], "upvotes": 4, "downvotes": 0 @@ -358,7 +363,8 @@ Example response: "start_date": null, "end_date": null, "created_at": "2018-01-21T06:21:13.165Z", - "updated_at": "2018-01-22T12:41:41.166Z" + "updated_at": "2018-01-22T12:41:41.166Z", + "closed_at": "2018-08-18T12:22:05.239Z" }, "target_url": "https://gitlab.example.com/groups/epics/5", "body": "Vel voluptas atque dicta mollitia adipisci qui at.", diff --git a/doc/api/features.md b/doc/api/features.md index e8d0c7c942b..8b5ea27007d 100644 --- a/doc/api/features.md +++ b/doc/api/features.md @@ -61,7 +61,7 @@ POST /features/:name | `feature_group` | string | no | A Feature group name | | `user` | string | no | A GitLab username | | `group` | string | no | A GitLab group's path, for example `gitlab-org` | -| `project` | string | no | A projects path, for example `gitlab-org/gitlab-ce` | +| `project` | string | no | A projects path, for example `gitlab-org/gitlab-foss` | Note that you can enable or disable a feature for a `feature_group`, a `user`, a `group`, and a `project` in a single API call. diff --git a/doc/api/graphql/index.md b/doc/api/graphql/index.md index eb5faac5ede..9eb254b4677 100644 --- a/doc/api/graphql/index.md +++ b/doc/api/graphql/index.md @@ -42,7 +42,7 @@ A first iteration of a GraphQL API includes the following queries ### Multiplex queries GitLab supports batching queries into a single request using -[apollo-link-batch-http](https://www.apollographql.com/docs/link/links/batch-http). More +[apollo-link-batch-http](https://www.apollographql.com/docs/link/links/batch-http/). More info about multiplexed queries is also available for [graphql-ruby](https://graphql-ruby.org/queries/multiplex.html) the library GitLab uses on the backend. diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md index e87270f884a..839289cf677 100644 --- a/doc/api/graphql/reference/index.md +++ b/doc/api/graphql/reference/index.md @@ -54,9 +54,87 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph | `message` | String | | | `authoredDate` | Time | | | `webUrl` | String! | | +| `signatureHtml` | String | Rendered html for the commit signature | | `author` | User | | | `latestPipeline` | Pipeline | Latest pipeline for this commit | +### CreateDiffNotePayload + +| Name | Type | Description | +| --- | ---- | ---------- | +| `clientMutationId` | String | A unique identifier for the client performing the mutation. | +| `errors` | String! => Array | Reasons why the mutation failed. | +| `note` | Note | The note after mutation | + +### CreateImageDiffNotePayload + +| Name | Type | Description | +| --- | ---- | ---------- | +| `clientMutationId` | String | A unique identifier for the client performing the mutation. | +| `errors` | String! => Array | Reasons why the mutation failed. | +| `note` | Note | The note after mutation | + +### CreateNotePayload + +| Name | Type | Description | +| --- | ---- | ---------- | +| `clientMutationId` | String | A unique identifier for the client performing the mutation. | +| `errors` | String! => Array | Reasons why the mutation failed. | +| `note` | Note | The note after mutation | + +### Design + +| Name | Type | Description | +| --- | ---- | ---------- | +| `id` | ID! | | +| `project` | Project! | | +| `issue` | Issue! | | +| `notesCount` | Int! | The total count of user-created notes for this design | +| `filename` | String! | | +| `fullPath` | String! | | +| `event` | DesignVersionEvent! | The change that happened to the design at this version | +| `image` | String! | | +| `diffRefs` | DiffRefs! | | + +### DesignCollection + +| Name | Type | Description | +| --- | ---- | ---------- | +| `project` | Project! | | +| `issue` | Issue! | | + +### DesignManagementDeletePayload + +| Name | Type | Description | +| --- | ---- | ---------- | +| `clientMutationId` | String | A unique identifier for the client performing the mutation. | +| `errors` | String! => Array | Reasons why the mutation failed. | +| `version` | DesignVersion | The new version in which the designs are deleted | + +### DesignManagementUploadPayload + +| Name | Type | Description | +| --- | ---- | ---------- | +| `clientMutationId` | String | A unique identifier for the client performing the mutation. | +| `errors` | String! => Array | Reasons why the mutation failed. | +| `designs` | Design! => Array | The designs that were uploaded by the mutation | +| `skippedDesigns` | Design! => Array | Any designs that were skipped from the upload due to there being no change to their content since their last version | + +### DesignVersion + +| Name | Type | Description | +| --- | ---- | ---------- | +| `id` | ID! | | +| `sha` | ID! | | + +### DestroyNotePayload + +| Name | Type | Description | +| --- | ---- | ---------- | +| `clientMutationId` | String | A unique identifier for the client performing the mutation. | +| `errors` | String! => Array | Reasons why the mutation failed. | +| `note` | Note | The note after mutation | + ### DetailedStatus | Name | Type | Description | @@ -74,9 +152,7 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph | Name | Type | Description | | --- | ---- | ---------- | -| `headSha` | String! | The sha of the head at the time the comment was made | -| `baseSha` | String | The merge base of the branch the comment was made on | -| `startSha` | String! | The sha of the branch being compared against | +| `diffRefs` | DiffRefs! | | | `filePath` | String! | The path of the file that was changed | | `oldPath` | String | The path of the file on the start sha. | | `newPath` | String | The path of the file on the head sha. | @@ -88,13 +164,147 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph | `width` | Int | The total width of the image | | `height` | Int | The total height of the image | +### DiffRefs + +| Name | Type | Description | +| --- | ---- | ---------- | +| `headSha` | String! | The sha of the head at the time the comment was made | +| `baseSha` | String! | The merge base of the branch the comment was made on | +| `startSha` | String! | The sha of the branch being compared against | + ### Discussion | Name | Type | Description | | --- | ---- | ---------- | | `id` | ID! | | +| `replyId` | ID! | The ID used to reply to this discussion | | `createdAt` | Time! | | +### Epic + +| Name | Type | Description | +| --- | ---- | ---------- | +| `userPermissions` | EpicPermissions! | Permissions for the current user on the resource | +| `id` | ID! | | +| `iid` | ID! | | +| `title` | String | | +| `description` | String | | +| `state` | EpicState! | | +| `group` | Group! | | +| `parent` | Epic | | +| `author` | User! | | +| `startDate` | Time | | +| `startDateIsFixed` | Boolean | | +| `startDateFixed` | Time | | +| `startDateFromMilestones` | Time | | +| `dueDate` | Time | | +| `dueDateIsFixed` | Boolean | | +| `dueDateFixed` | Time | | +| `dueDateFromMilestones` | Time | | +| `closedAt` | Time | | +| `createdAt` | Time | | +| `updatedAt` | Time | | +| `hasChildren` | Boolean! | | +| `hasIssues` | Boolean! | | +| `webPath` | String! | | +| `webUrl` | String! | | +| `relativePosition` | Int | The relative position of the epic in the Epic tree | +| `relationPath` | String | | +| `reference` | String! | | +| `subscribed` | Boolean! | Boolean flag for whether the currently logged in user is subscribed to this epic | + +### EpicIssue + +| Name | Type | Description | +| --- | ---- | ---------- | +| `userPermissions` | IssuePermissions! | Permissions for the current user on the resource | +| `iid` | ID! | | +| `title` | String! | | +| `titleHtml` | String | The GitLab Flavored Markdown rendering of `title` | +| `description` | String | | +| `descriptionHtml` | String | The GitLab Flavored Markdown rendering of `description` | +| `state` | IssueState! | | +| `reference` | String! | | +| `author` | User! | | +| `milestone` | Milestone | | +| `dueDate` | Time | | +| `confidential` | Boolean! | | +| `discussionLocked` | Boolean! | | +| `upvotes` | Int! | | +| `downvotes` | Int! | | +| `userNotesCount` | Int! | | +| `webPath` | String! | | +| `webUrl` | String! | | +| `relativePosition` | Int | | +| `timeEstimate` | Int! | The time estimate on the issue | +| `totalTimeSpent` | Int! | Total time reported as spent on the issue | +| `closedAt` | Time | | +| `createdAt` | Time! | | +| `updatedAt` | Time! | | +| `taskCompletionStatus` | TaskCompletionStatus! | | +| `epic` | Epic | The epic to which issue belongs | +| `weight` | Int | | +| `designs` | DesignCollection | | +| `designCollection` | DesignCollection | | +| `epicIssueId` | ID! | | +| `relationPath` | String | | +| `id` | ID | The global id of the epic-issue relation | + +### EpicPermissions + +| Name | Type | Description | +| --- | ---- | ---------- | +| `readEpic` | Boolean! | Whether or not a user can perform `read_epic` on this resource | +| `readEpicIid` | Boolean! | Whether or not a user can perform `read_epic_iid` on this resource | +| `updateEpic` | Boolean! | Whether or not a user can perform `update_epic` on this resource | +| `destroyEpic` | Boolean! | Whether or not a user can perform `destroy_epic` on this resource | +| `adminEpic` | Boolean! | Whether or not a user can perform `admin_epic` on this resource | +| `createEpic` | Boolean! | Whether or not a user can perform `create_epic` on this resource | +| `createNote` | Boolean! | Whether or not a user can perform `create_note` on this resource | +| `awardEmoji` | Boolean! | Whether or not a user can perform `award_emoji` on this resource | + +### EpicTreeReorderPayload + +| Name | Type | Description | +| --- | ---- | ---------- | +| `clientMutationId` | String | A unique identifier for the client performing the mutation. | +| `errors` | String! => Array | Reasons why the mutation failed. | + +### ExtendedIssue + +| Name | Type | Description | +| --- | ---- | ---------- | +| `userPermissions` | IssuePermissions! | Permissions for the current user on the resource | +| `iid` | ID! | | +| `title` | String! | | +| `titleHtml` | String | The GitLab Flavored Markdown rendering of `title` | +| `description` | String | | +| `descriptionHtml` | String | The GitLab Flavored Markdown rendering of `description` | +| `state` | IssueState! | | +| `reference` | String! | | +| `author` | User! | | +| `milestone` | Milestone | | +| `dueDate` | Time | | +| `confidential` | Boolean! | | +| `discussionLocked` | Boolean! | | +| `upvotes` | Int! | | +| `downvotes` | Int! | | +| `userNotesCount` | Int! | | +| `webPath` | String! | | +| `webUrl` | String! | | +| `relativePosition` | Int | | +| `timeEstimate` | Int! | The time estimate on the issue | +| `totalTimeSpent` | Int! | Total time reported as spent on the issue | +| `closedAt` | Time | | +| `createdAt` | Time! | | +| `updatedAt` | Time! | | +| `taskCompletionStatus` | TaskCompletionStatus! | | +| `epic` | Epic | The epic to which issue belongs | +| `weight` | Int | | +| `designs` | DesignCollection | | +| `designCollection` | DesignCollection | | +| `subscribed` | Boolean! | Boolean flag for whether the currently logged in user is subscribed to this issue | + ### Group | Name | Type | Description | @@ -109,11 +319,13 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph | `visibility` | String | | | `lfsEnabled` | Boolean | | | `requestAccessEnabled` | Boolean | | -| `rootStorageStatistics` | RootStorageStatistics | The aggregated storage statistics. Only available if the namespace has no parent | +| `rootStorageStatistics` | RootStorageStatistics | The aggregated storage statistics. Only available for root namespaces | | `userPermissions` | GroupPermissions! | Permissions for the current user on the resource | | `webUrl` | String! | | | `avatarUrl` | String | | | `parent` | Group | | +| `epicsEnabled` | Boolean | | +| `epic` | Epic | | ### GroupPermissions @@ -144,10 +356,16 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph | `webPath` | String! | | | `webUrl` | String! | | | `relativePosition` | Int | | +| `timeEstimate` | Int! | The time estimate on the issue | +| `totalTimeSpent` | Int! | Total time reported as spent on the issue | | `closedAt` | Time | | | `createdAt` | Time! | | | `updatedAt` | Time! | | | `taskCompletionStatus` | TaskCompletionStatus! | | +| `epic` | Epic | The epic to which issue belongs | +| `weight` | Int | | +| `designs` | DesignCollection | | +| `designCollection` | DesignCollection | | ### IssuePermissions @@ -158,6 +376,9 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph | `updateIssue` | Boolean! | Whether or not a user can perform `update_issue` on this resource | | `createNote` | Boolean! | Whether or not a user can perform `create_note` on this resource | | `reopenIssue` | Boolean! | Whether or not a user can perform `reopen_issue` on this resource | +| `readDesign` | Boolean! | Whether or not a user can perform `read_design` on this resource | +| `createDesign` | Boolean! | Whether or not a user can perform `create_design` on this resource | +| `destroyDesign` | Boolean! | Whether or not a user can perform `destroy_design` on this resource | ### Label @@ -185,6 +406,7 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph | `updatedAt` | Time! | | | `sourceProject` | Project | | | `targetProject` | Project! | | +| `diffRefs` | DiffRefs | | | `project` | Project! | | | `projectId` | Int! | | | `sourceProjectId` | Int | | @@ -213,8 +435,13 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph | `webUrl` | String | | | `upvotes` | Int! | | | `downvotes` | Int! | | -| `subscribed` | Boolean! | | | `headPipeline` | Pipeline | | +| `milestone` | Milestone | The milestone this merge request is linked to | +| `subscribed` | Boolean! | Boolean flag for whether the currently logged in user is subscribed to this MR | +| `discussionLocked` | Boolean! | Boolean flag determining if comments on the merge request are locked to members only | +| `timeEstimate` | Int! | The time estimate for the merge request | +| `totalTimeSpent` | Int! | Total time reported as spent on the merge request | +| `reference` | String! | Internal merge request reference. Returned in shortened format by default | | `taskCompletionStatus` | TaskCompletionStatus! | | ### MergeRequestPermissions @@ -271,6 +498,7 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph | `visibility` | String | | | `lfsEnabled` | Boolean | | | `requestAccessEnabled` | Boolean | | +| `rootStorageStatistics` | RootStorageStatistics | The aggregated storage statistics. Only available for root namespaces | ### Note @@ -381,7 +609,7 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph | `statistics` | ProjectStatistics | | | `repository` | Repository | | | `mergeRequest` | MergeRequest | | -| `issue` | Issue | | +| `issue` | ExtendedIssue | | ### ProjectPermissions @@ -424,6 +652,10 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph | `createPages` | Boolean! | Whether or not a user can perform `create_pages` on this resource | | `destroyPages` | Boolean! | Whether or not a user can perform `destroy_pages` on this resource | | `readPagesContent` | Boolean! | Whether or not a user can perform `read_pages_content` on this resource | +| `adminOperations` | Boolean! | Whether or not a user can perform `admin_operations` on this resource | +| `readDesign` | Boolean! | Whether or not a user can perform `read_design` on this resource | +| `createDesign` | Boolean! | Whether or not a user can perform `create_design` on this resource | +| `destroyDesign` | Boolean! | Whether or not a user can perform `destroy_design` on this resource | ### ProjectStatistics @@ -458,12 +690,12 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph | Name | Type | Description | | --- | ---- | ---------- | -| `storageSize` | Int! | The total storage in Bytes | -| `repositorySize` | Int! | The git repository size in Bytes | -| `lfsObjectsSize` | Int! | The LFS objects size in Bytes | -| `buildArtifactsSize` | Int! | The CI artifacts size in Bytes | -| `packagesSize` | Int! | The packages size in Bytes | -| `wikiSize` | Int! | The wiki size in Bytes | +| `storageSize` | Int! | The total storage in bytes | +| `repositorySize` | Int! | The git repository size in bytes | +| `lfsObjectsSize` | Int! | The LFS objects size in bytes | +| `buildArtifactsSize` | Int! | The CI artifacts size in bytes | +| `packagesSize` | Int! | The packages size in bytes | +| `wikiSize` | Int! | The wiki size in bytes | ### Submodule @@ -474,6 +706,8 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph | `type` | EntryType! | | | `path` | String! | | | `flatPath` | String! | | +| `webUrl` | String | | +| `treeUrl` | String | | ### TaskCompletionStatus @@ -482,6 +716,20 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph | `count` | Int! | | | `completedCount` | Int! | | +### Todo + +| Name | Type | Description | +| --- | ---- | ---------- | +| `id` | ID! | Id of the todo | +| `project` | Project | The project this todo is associated with | +| `group` | Group | Group this todo is associated with | +| `author` | User! | The owner of this todo | +| `action` | TodoActionEnum! | Action of the todo | +| `targetType` | TodoTargetEnum! | Target type of the todo | +| `body` | String! | Body of the todo | +| `state` | TodoStateEnum! | State of the todo | +| `createdAt` | Time! | Timestamp this todo was created | + ### ToggleAwardEmojiPayload | Name | Type | Description | @@ -495,7 +743,7 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph | Name | Type | Description | | --- | ---- | ---------- | -| `lastCommit` | Commit | | +| `lastCommit` | Commit | Last commit for the tree | ### TreeEntry @@ -508,6 +756,22 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph | `flatPath` | String! | | | `webUrl` | String | | +### UpdateEpicPayload + +| Name | Type | Description | +| --- | ---- | ---------- | +| `clientMutationId` | String | A unique identifier for the client performing the mutation. | +| `errors` | String! => Array | Reasons why the mutation failed. | +| `epic` | Epic | The epic after mutation | + +### UpdateNotePayload + +| Name | Type | Description | +| --- | ---- | ---------- | +| `clientMutationId` | String | A unique identifier for the client performing the mutation. | +| `errors` | String! => Array | Reasons why the mutation failed. | +| `note` | Note | The note after mutation | + ### User | Name | Type | Description | diff --git a/doc/api/group_clusters.md b/doc/api/group_clusters.md index 8a85b5b8763..e878bb5fa4d 100644 --- a/doc/api/group_clusters.md +++ b/doc/api/group_clusters.md @@ -276,5 +276,5 @@ Parameters: Example request: ```bash -curl --request DELETE --header 'Private-Token: <your_access_token>' https://gitlab.example.com/api/v4/groups/26/clusters/23' +curl --request DELETE --header 'Private-Token: <your_access_token>' https://gitlab.example.com/api/v4/groups/26/clusters/23 ``` diff --git a/doc/api/group_labels.md b/doc/api/group_labels.md index 5030bba3159..f3c3a821354 100644 --- a/doc/api/group_labels.md +++ b/doc/api/group_labels.md @@ -16,6 +16,7 @@ GET /groups/:id/labels | --------- | ---- | -------- | ----------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user. | | `with_counts` | boolean | no | Whether or not to include issue and merge request counts. Defaults to `false`. _([Introduced in GitLab 12.2](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/31543))_ | +| `include_ancestor_groups` | boolean | no | Include ancestor groups. Defaults to `true`. | ```bash curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/labels?with_counts=true @@ -50,6 +51,40 @@ Example response: ] ``` +## Get a single group label + +Get a single label for a given group. + +``` +GET /groups/:id/labels/:label_id +``` + +| Attribute | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user. | +| `label_id` | integer or string | yes | The ID or title of a group's label. | +| `include_ancestor_groups` | boolean | no | Include ancestor groups. Defaults to `true`. | + +```bash +curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/labels/bug +``` + +Example response: + +```json +{ + "id": 7, + "name": "bug", + "color": "#FF0000", + "text_color" : "#FFFFFF", + "description": null, + "open_issues_count": 0, + "closed_issues_count": 0, + "open_merge_requests_count": 0, + "subscribed": false +} +``` + ## Create a new group label Create a new group label for a given group. @@ -90,19 +125,19 @@ Example response: Updates an existing group label. At least one parameter is required, to update the group label. ``` -PUT /groups/:id/labels +PUT /groups/:id/labels/:label_id ``` | Attribute | Type | Required | Description | | ------------- | ------- | -------- | ---------------------------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user | -| `name` | string | yes | The name of the label | +| `label_id` | integer or string | yes | The ID or title of a group's label. | | `new_name` | string | no | The new name of the label | | `color` | string | no | The color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the [CSS color names](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#Color_keywords) | | `description` | string | no | The description of the label. | ```bash -curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" --header "Content-Type: application/json" --data '{"name": "Feature Proposal", "new_name": "Feature Idea" }' https://gitlab.example.com/api/v4/groups/5/labels +curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" --header "Content-Type: application/json" --data '{"new_name": "Feature Idea" }' https://gitlab.example.com/api/v4/groups/5/labels/Feature%20Proposal ``` Example response: @@ -121,23 +156,27 @@ Example response: } ``` +NOTE: **Note:** An older endpoint `PUT /groups/:id/labels` with `name` in the params is still available, but deprecated. + ## Delete a group label Deletes a group label with a given name. ``` -DELETE /groups/:id/labels +DELETE /groups/:id/labels/:label_id ``` | Attribute | Type | Required | Description | | --------- | ------- | -------- | --------------------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user | -| `name` | string | yes | The name of the label. | +| `label_id` | integer or string | yes | The ID or title of a group's label. | ```bash -curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/labels?name=bug +curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/labels/bug ``` +NOTE: **Note:** An older endpoint `DELETE /groups/:id/labels` with `name` in the params is still available, but deprecated. + ## Subscribe to a group label Subscribes the authenticated user to a group label to receive notifications. If diff --git a/doc/api/groups.md b/doc/api/groups.md index b0d60d58049..312bd04e24c 100644 --- a/doc/api/groups.md +++ b/doc/api/groups.md @@ -31,6 +31,13 @@ GET /groups "path": "foo-bar", "description": "An interesting group", "visibility": "public", + "share_with_group_lock": false, + "require_two_factor_authentication": false, + "two_factor_grace_period": 48, + "project_creation_level": "developer", + "auto_devops_enabled": null, + "subgroup_creation_level": "owner", + "emails_disabled": null, "lfs_enabled": true, "avatar_url": "http://localhost:3000/uploads/group/avatar/1/foo.jpg", "web_url": "http://localhost:3000/groups/foo-bar", @@ -57,6 +64,13 @@ GET /groups?statistics=true "path": "foo-bar", "description": "An interesting group", "visibility": "public", + "share_with_group_lock": false, + "require_two_factor_authentication": false, + "two_factor_grace_period": 48, + "project_creation_level": "developer", + "auto_devops_enabled": null, + "subgroup_creation_level": "owner", + "emails_disabled": null, "lfs_enabled": true, "avatar_url": "http://localhost:3000/uploads/group/avatar/1/foo.jpg", "web_url": "http://localhost:3000/groups/foo-bar", @@ -119,6 +133,13 @@ GET /groups/:id/subgroups "path": "foo-bar", "description": "An interesting group", "visibility": "public", + "share_with_group_lock": false, + "require_two_factor_authentication": false, + "two_factor_grace_period": 48, + "project_creation_level": "developer", + "auto_devops_enabled": null, + "subgroup_creation_level": "owner", + "emails_disabled": null, "lfs_enabled": true, "avatar_url": "http://gitlab.example.com/uploads/group/avatar/1/foo.jpg", "web_url": "http://gitlab.example.com/groups/foo-bar", @@ -434,6 +455,13 @@ Parameters: | `path` | string | yes | The path of the group. | | `description` | string | no | The group's description. | | `visibility` | string | no | The group's visibility. Can be `private`, `internal`, or `public`. | +| `share_with_group_lock` | boolean | no | Prevent sharing a project with another group within this group. | +| `require_two_factor_authentication` | boolean | no | Require all users in this group to setup Two-factor authentication. | +| `two_factor_grace_period` | integer | no | Time before Two-factor authentication is enforced (in hours). | +| `project_creation_level` | string | no | Determine if developers can create projects in the group. Can be `noone` (No one), `maintainer` (Maintainers), or `developer` (Developers + Maintainers). | +| `auto_devops_enabled` | boolean | no | Default to Auto DevOps pipeline for all projects within this group. | +| `subgroup_creation_level` | integer | no | Allowed to create subgroups. Can be `owner` (Owners), or `maintainer` (Maintainers). | +| `emails_disabled` | boolean | no | Disable email notifications | | `lfs_enabled` | boolean | no | Enable/disable Large File Storage (LFS) for the projects in this group. | | `request_access_enabled` | boolean | no | Allow users to request member access. | | `parent_id` | integer | no | The parent group ID for creating nested group. | @@ -472,6 +500,13 @@ PUT /groups/:id | `membership_lock` | boolean | no | **(STARTER)** Prevent adding new members to project membership within this group. | | `share_with_group_lock` | boolean | no | Prevent sharing a project with another group within this group. | | `visibility` | string | no | The visibility level of the group. Can be `private`, `internal`, or `public`. | +| `share_with_group_lock` | boolean | no | Prevent sharing a project with another group within this group. | +| `require_two_factor_authentication` | boolean | no | Require all users in this group to setup Two-factor authentication. | +| `two_factor_grace_period` | integer | no | Time before Two-factor authentication is enforced (in hours). | +| `project_creation_level` | string | no | Determine if developers can create projects in the group. Can be `noone` (No one), `maintainer` (Maintainers), or `developer` (Developers + Maintainers). | +| `auto_devops_enabled` | boolean | no | Default to Auto DevOps pipeline for all projects within this group. | +| `subgroup_creation_level` | integer | no | Allowed to create subgroups. Can be `owner` (Owners), or `maintainer` (Maintainers). | +| `emails_disabled` | boolean | no | Disable email notifications | | `lfs_enabled` (optional) | boolean | no | Enable/disable Large File Storage (LFS) for the projects in this group. | | `request_access_enabled` | boolean | no | Allow users to request member access. | | `file_template_project_id` | integer | no | **(PREMIUM)** The ID of a project to load custom file templates from. | diff --git a/doc/api/issues.md b/doc/api/issues.md index e323ebce7ca..0ddbb18ce92 100644 --- a/doc/api/issues.md +++ b/doc/api/issues.md @@ -58,7 +58,7 @@ GET /issues?confidential=true | `updated_after` | datetime | no | Return issues updated on or after the given time | | `updated_before` | datetime | no | Return issues updated on or before the given time | | `confidential` | Boolean | no | Filter confidential or public issues. | -| `not` | Hash | no | Return issues that do not match the parameters supplied. Accepts: `labels`, `milestone`, `author_id`, `author_username`, `assignee_id`, `assignee_username`, `my_reaction_emoji`, `search`, `in` | +| `not` | Hash | no | Return issues that do not match the parameters supplied. Accepts: `labels`, `milestone`, `author_id`, `author_username`, `assignee_id`, `assignee_username`, `my_reaction_emoji`, `search`, `in` | ```bash curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/issues @@ -207,7 +207,7 @@ GET /groups/:id/issues?confidential=true | `updated_after` | datetime | no | Return issues updated on or after the given time | | `updated_before` | datetime | no | Return issues updated on or before the given time | | `confidential` | Boolean | no | Filter confidential or public issues. | -| `not` | Hash | no | Return issues that do not match the parameters supplied. Accepts: `labels`, `milestone`, `author_id`, `author_username`, `assignee_id`, `assignee_username`, `my_reaction_emoji`, `search`, `in` | +| `not` | Hash | no | Return issues that do not match the parameters supplied. Accepts: `labels`, `milestone`, `author_id`, `author_username`, `assignee_id`, `assignee_username`, `my_reaction_emoji`, `search`, `in` | ```bash curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/4/issues @@ -605,7 +605,7 @@ POST /projects/:id/issues | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `iid` | integer/string | no | The internal ID of the project's issue (requires admin or project owner rights) | | `title` | string | yes | The title of an issue | -| `description` | string | no | The description of an issue. Limited to 1 000 000 characters. | +| `description` | string | no | The description of an issue. Limited to 1,048,576 characters. | | `confidential` | boolean | no | Set an issue to be confidential. Default is `false`. | | `assignee_ids` | integer array | no | The ID of a user to assign issue | | `milestone_id` | integer | no | The global ID of a milestone to assign issue | @@ -615,6 +615,7 @@ POST /projects/:id/issues | `merge_request_to_resolve_discussions_of` | integer | no | The IID of a merge request in which to resolve all issues. This will fill the issue with a default description and mark all discussions as resolved. When passing a description or title, these values will take precedence over the default values.| | `discussion_to_resolve` | string | no | The ID of a discussion to resolve. This will fill in the issue with a default description and mark the discussion as resolved. Use in combination with `merge_request_to_resolve_discussions_of`. | | `weight` **(STARTER)** | integer | no | The weight of the issue. Valid values are greater than or equal to 0. | +| `epic_iid` **(ULTIMATE)** | integer | no | IID of the epic to add the issue to. Valid values are greater than or equal to 0. | ```bash curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/4/issues?title=Issues%20with%20auth&labels=bug @@ -706,7 +707,7 @@ PUT /projects/:id/issues/:issue_iid | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `issue_iid` | integer | yes | The internal ID of a project's issue | | `title` | string | no | The title of an issue | -| `description` | string | no | The description of an issue. Limited to 1 000 000 characters. | +| `description` | string | no | The description of an issue. Limited to 1,048,576 characters. | | `confidential` | boolean | no | Updates an issue to be confidential | | `assignee_ids` | integer array | no | The ID of the user(s) to assign the issue to. Set to `0` or provide an empty value to unassign all assignees. | | `milestone_id` | integer | no | The global ID of a milestone to assign the issue to. Set to `0` or provide an empty value to unassign a milestone.| @@ -716,6 +717,7 @@ PUT /projects/:id/issues/:issue_iid | `due_date` | string | no | Date time string in the format YEAR-MONTH-DAY, e.g. `2016-03-11` | | `weight` **(STARTER)** | integer | no | The weight of the issue. Valid values are greater than or equal to 0. 0 | | `discussion_locked` | boolean | no | Flag indicating if the issue's discussion is locked. If the discussion is locked only project members can add or edit comments. | +| `epic_iid` **(ULTIMATE)** | integer | no | IID of the epic to add the issue to. Valid values are greater than or equal to 0. | ```bash curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/4/issues/85?state_event=close @@ -1370,8 +1372,11 @@ Example response: "state": "opened", "created_at": "2018-09-18T14:36:15.510Z", "updated_at": "2018-09-19T07:45:13.089Z", + "closed_by": null, + "closed_at": null, "target_branch": "v2.x", "source_branch": "so_long_jquery", + "user_notes_count": 9, "upvotes": 0, "downvotes": 0, "author": { @@ -1411,10 +1416,10 @@ Example response: "merge_status": "cannot_be_merged", "sha": "3b7b528e9353295c1c125dad281ac5b5deae5f12", "merge_commit_sha": null, - "user_notes_count": 9, "discussion_locked": null, "should_remove_source_branch": null, "force_remove_source_branch": false, + "reference": "!11", "web_url": "https://gitlab.example.com/twitter/flight/merge_requests/4", "time_stats": { "time_estimate": 0, @@ -1422,7 +1427,67 @@ Example response: "human_time_estimate": null, "human_total_time_spent": null }, - "squash": false + "squash": false, + "task_completion_status": { + "count": 0, + "completed_count": 0 + }, + "changes_count": "10", + "latest_build_started_at": "2018-12-05T01:16:41.723Z", + "latest_build_finished_at": "2018-12-05T02:35:54.046Z", + "first_deployed_to_production_at": null, + "pipeline": { + "id": 38980952, + "sha": "81c6a84c7aebd45a1ac2c654aa87f11e32338e0a", + "ref": "test-branch", + "status": "success", + "web_url": "https://gitlab.com/gitlab-org/gitlab/pipelines/38980952" + }, + "head_pipeline": { + "id": 38980952, + "sha": "81c6a84c7aebd45a1ac2c654aa87f11e32338e0a", + "ref": "test-branch", + "status": "success", + "web_url": "https://gitlab.example.com/twitter/flight/pipelines/38980952", + "before_sha": "3c738a37eb23cf4c0ed0d45d6ddde8aad4a8da51", + "tag": false, + "yaml_errors": null, + "user": { + "id": 19, + "name": "Jody Baumbach", + "username": "felipa.kuvalis", + "state": "active", + "avatar_url": "https://www.gravatar.com/avatar/6541fc75fc4e87e203529bd275fafd07?s=80&d=identicon", + "web_url": "https://gitlab.example.com/felipa.kuvalis" + }, + "created_at": "2018-12-05T01:16:13.342Z", + "updated_at": "2018-12-05T02:35:54.086Z", + "started_at": "2018-12-05T01:16:41.723Z", + "finished_at": "2018-12-05T02:35:54.046Z", + "committed_at": null, + "duration": 4436, + "coverage": "46.68", + "detailed_status": { + "icon": "status_warning", + "text": "passed", + "label": "passed with warnings", + "group": "success-with-warnings", + "tooltip": "passed", + "has_details": true, + "details_path": "/twitter/flight/pipelines/38", + "illustration": null, + "favicon": "https://gitlab.example.com/assets/ci_favicons/favicon_status_success-8451333011eee8ce9f2ab25dc487fe24a8758c694827a582f17f42b0a90446a2.png" + } + }, + "diff_refs": { + "base_sha": "d052d768f0126e8cddf80afd8b1eb07f406a3fcb", + "head_sha": "81c6a84c7aebd45a1ac2c654aa87f11e32338e0a", + "start_sha": "d052d768f0126e8cddf80afd8b1eb07f406a3fcb" + }, + "merge_error": null, + "user": { + "can_merge": true + } } ] ``` diff --git a/doc/api/jobs.md b/doc/api/jobs.md index 8ee4facc018..bafcfd110d3 100644 --- a/doc/api/jobs.md +++ b/doc/api/jobs.md @@ -537,9 +537,9 @@ Possible response status codes: | 400 | Invalid path provided | | 404 | Build not found or no file/artifacts | -## Get a trace file +## Get a log file -Get a trace of a specific job of a project +Get a log (trace) of a specific job of a project: ``` GET /projects/:id/jobs/:job_id/trace @@ -556,10 +556,10 @@ curl --location --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.ex Possible response status codes: -| Status | Description | -|-----------|-----------------------------------| -| 200 | Serves the trace file | -| 404 | Build not found or no trace file | +| Status | Description | +|-----------|-------------------------------| +| 200 | Serves the log file | +| 404 | Job not found or no log file | ## Cancel a job @@ -661,7 +661,7 @@ Example of response ## Erase a job -Erase a single job of a project (remove job artifacts and a job trace) +Erase a single job of a project (remove job artifacts and a job log) ``` POST /projects/:id/jobs/:job_id/erase diff --git a/doc/api/labels.md b/doc/api/labels.md index 93833fd81cb..525dbe02e5f 100644 --- a/doc/api/labels.md +++ b/doc/api/labels.md @@ -12,6 +12,7 @@ GET /projects/:id/labels | --------- | ------- | -------- | --------------------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `with_counts` | boolean | no | Whether or not to include issue and merge request counts. Defaults to `false`. _([Introduced in GitLab 12.2](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/31543))_ | +| `include_ancestor_groups` | boolean | no | Include ancestor groups. Defaults to `true`. | ```bash curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/labels?with_counts=true @@ -89,6 +90,42 @@ Example response: ] ``` +## Get a single project label + +Get a single label for a given project. + +``` +GET /projects/:id/labels/:label_id +``` + +| Attribute | Type | Required | Description | +| --------- | ------- | -------- | --------------------- | +| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | +| `label_id` | integer or string | yes | The ID or title of a group's label. | +| `include_ancestor_groups` | boolean | no | Include ancestor groups. Defaults to `true`. | + +```bash +curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/labels/bug +``` + +Example response: + +```json +{ + "id" : 1, + "name" : "bug", + "color" : "#d9534f", + "text_color" : "#FFFFFF", + "description": "Bug reported by user", + "open_issues_count": 1, + "closed_issues_count": 0, + "open_merge_requests_count": 1, + "subscribed": false, + "priority": 10, + "is_project_label": true +} +``` + ## Create a new label Creates a new label for the given repository with the given name and color. @@ -132,40 +169,40 @@ Example response: Deletes a label with a given name. ``` -DELETE /projects/:id/labels +DELETE /projects/:id/labels/:label_id ``` | Attribute | Type | Required | Description | | --------- | ------- | -------- | --------------------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | -| `label_id` | integer | yes (or `name`) | The id of the existing label | -| `name` | string | yes (or `label_id`) | The name of the existing label | +| `label_id` | integer or string | yes | The ID or title of a group's label. | ```bash -curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/labels?name=bug" +curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/labels/bug" ``` +NOTE: **Note:** An older endpoint `DELETE /projects/:id/labels` with `name` in the params is still available, but deprecated. + ## Edit an existing label Updates an existing label with new name or new color. At least one parameter is required, to update the label. ``` -PUT /projects/:id/labels +PUT /projects/:id/labels/:label_id ``` | Attribute | Type | Required | Description | | --------------- | ------- | --------------------------------- | ------------------------------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | -| `label_id` | integer | yes (or `name`) | The id of the existing label | -| `name` | string | yes (or `label_id`) | The name of the existing label | +| `label_id` | integer or string | yes | The ID or title of a group's label. | | `new_name` | string | yes if `color` is not provided | The new name of the label | | `color` | string | yes if `new_name` is not provided | The color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the [CSS color names](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#Color_keywords) | | `description` | string | no | The new description of the label | | `priority` | integer | no | The new priority of the label. Must be greater or equal than zero or `null` to remove the priority. | ```bash -curl --request PUT --data "name=documentation&new_name=docs&color=#8E44AD&description=Documentation" --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/labels" +curl --request PUT --data "new_name=docs&color=#8E44AD&description=Documentation" --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/labels/documentation" ``` Example response: @@ -186,6 +223,8 @@ Example response: } ``` +NOTE: **Note:** An older endpoint `PUT /projects/:id/labels` with `name` or `label_id` in the params is still available, but deprecated. + ## Promote a project label to a group label > [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/25218) in GitLab 12.3. @@ -193,16 +232,16 @@ Example response: Promotes a project label to a group label. ``` -PUT /projects/:id/labels/promote +PUT /projects/:id/labels/:label_id/promote ``` | Attribute | Type | Required | Description | | --------------- | ------- | --------------------------------- | ------------------------------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | -| `name` | string | yes | The name of the existing label | +| `label_id` | integer or string | yes | The ID or title of a group's label. | ```bash -curl --request PUT --data "name=documentation" --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/labels/promote" +curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/labels/documentation/promote" ``` Example response: @@ -220,6 +259,8 @@ Example response: } ``` +NOTE: **Note:** An older endpoint `PUT /projects/:id/labels/promote` with `name` in the params is still available, but deprecated. + ## Subscribe to a label Subscribes the authenticated user to a label to receive notifications. diff --git a/doc/api/members.md b/doc/api/members.md index da62dc53659..50dcf86c972 100644 --- a/doc/api/members.md +++ b/doc/api/members.md @@ -26,6 +26,7 @@ GET /projects/:id/members | --------- | ---- | -------- | ----------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the project or group](README.md#namespaced-path-encoding) owned by the authenticated user | | `query` | string | no | A query string to search for members | +| `user_ids` | array of integers | no | Filter the results on the given user IDs | ```bash curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/:id/members @@ -62,9 +63,8 @@ Example response: ## List all members of a group or project including inherited members Gets a list of group or project members viewable by the authenticated user, including inherited members through ancestor groups. -When a user is a member of the project/group and of one or more ancestor groups the user is returned only once with the project access_level (if exists) -or the access_level for the user in the first group which he belongs to in the project groups ancestors chain. -**Note:** We plan to [change](https://gitlab.com/gitlab-org/gitlab-foss/issues/62284) this behavior to return highest access_level instead. +When a user is a member of the project/group and of one or more ancestor groups the user is returned only once with the project `access_level` (if exists) +or the `access_level` for the user in the first group which he belongs to in the project groups ancestors chain. ``` GET /groups/:id/members/all @@ -75,6 +75,7 @@ GET /projects/:id/members/all | --------- | ---- | -------- | ----------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the project or group](README.md#namespaced-path-encoding) owned by the authenticated user | | `query` | string | no | A query string to search for members | +| `user_ids` | array of integers | no | Filter the results on the given user IDs | ```bash curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/:id/members/all @@ -120,7 +121,7 @@ Example response: ## Get a member of a group or project -Gets a member of a group or project. +Gets a member of a group or project. Returns only direct members and not inherited members through ancestor groups. ``` GET /groups/:id/members/:user_id @@ -152,6 +153,42 @@ Example response: } ``` +## Get a member of a group or project, including inherited members + +> [Introduced](https://gitlab.com/gitlab-org/gitlab/merge_requests/17744) in GitLab 12.4. + +Gets a member of a group or project, including members inherited through ancestor groups. See the corresponding [endpoint to list all inherited members](#list-all-members-of-a-group-or-project-including-inherited-members) for details. + +``` +GET /groups/:id/members/all/:user_id +GET /projects/:id/members/all/:user_id +``` + +| Attribute | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `id` | integer/string | yes | The ID or [URL-encoded path of the project or group](README.md#namespaced-path-encoding) owned by the authenticated user | +| `user_id` | integer | yes | The user ID of the member | + +```bash +curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/:id/members/all/:user_id +curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/:id/members/all/:user_id +``` + +Example response: + +```json +{ + "id": 1, + "username": "raymond_smith", + "name": "Raymond Smith", + "state": "active", + "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", + "web_url": "http://192.168.1.8:3000/root", + "access_level": 30, + "expires_at": null +} +``` + ## Add a member to a group or project Adds a member to a group or project. diff --git a/doc/api/merge_requests.md b/doc/api/merge_requests.md index 21e24dc7934..4bc46c3030d 100644 --- a/doc/api/merge_requests.md +++ b/doc/api/merge_requests.md @@ -823,7 +823,7 @@ Parameters: ## Create MR Pipeline -> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/31722) in Gitlab 12.3. +> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/31722) in GitLab 12.3. Create a new [pipeline for a merge request](../ci/merge_request_pipelines/index.md). A pipeline created via this endpoint will not run a regular branch/tag pipeline, it requires `.gitlab-ci.yml` to be configured with `only: [merge_requests]` to create jobs. @@ -897,7 +897,7 @@ POST /projects/:id/merge_requests | `title` | string | yes | Title of MR | | `assignee_id` | integer | no | Assignee user ID | | `assignee_ids` | integer array | no | The ID of the user(s) to assign the MR to. Set to `0` or provide an empty value to unassign all assignees. | -| `description` | string | no | Description of MR. Limited to 1 000 000 characters. | +| `description` | string | no | Description of MR. Limited to 1,048,576 characters. | | `target_project_id` | integer | no | The target project (numeric id) | | `labels` | string | no | Labels for MR as a comma-separated list | | `milestone_id` | integer | no | The global ID of a milestone | @@ -1050,7 +1050,7 @@ PUT /projects/:id/merge_requests/:merge_request_iid | `assignee_ids` | integer array | no | The ID of the user(s) to assign the MR to. Set to `0` or provide an empty value to unassign all assignees. | | `milestone_id` | integer | no | The global ID of a milestone to assign the merge request to. Set to `0` or provide an empty value to unassign a milestone.| | `labels` | string | no | Comma-separated label names for a merge request. Set to an empty string to unassign all labels. | -| `description` | string | no | Description of MR. Limited to 1 000 000 characters. | +| `description` | string | no | Description of MR. Limited to 1,048,576 characters. | | `state_event` | string | no | New state (close/reopen) | | `remove_source_branch` | boolean | no | Flag indicating if a merge request should remove the source branch when merging | | `squash` | boolean | no | Squash commits into a single commit when merging | diff --git a/doc/api/notes.md b/doc/api/notes.md index 1f5baf7d0e1..2cace425ff2 100644 --- a/doc/api/notes.md +++ b/doc/api/notes.md @@ -113,7 +113,7 @@ Parameters: - `id` (required) - The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) - `issue_iid` (required) - The IID of an issue -- `body` (required) - The content of a note. Limited to 1 000 000 characters. +- `body` (required) - The content of a note. Limited to 1,000,000 characters. - `created_at` (optional) - Date time string, ISO 8601 formatted, e.g. 2016-03-11T03:45:40Z (requires admin or project/group owner rights) ```bash @@ -133,7 +133,7 @@ Parameters: - `id` (required) - The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) - `issue_iid` (required) - The IID of an issue - `note_id` (required) - The ID of a note -- `body` (required) - The content of a note. Limited to 1 000 000 characters. +- `body` (required) - The content of a note. Limited to 1,000,000 characters. ```bash curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/issues/11/notes?body=note @@ -231,7 +231,7 @@ Parameters: - `id` (required) - The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) - `snippet_id` (required) - The ID of a snippet -- `body` (required) - The content of a note. Limited to 1 000 000 characters. +- `body` (required) - The content of a note. Limited to 1,000,000 characters. - `created_at` (optional) - Date time string, ISO 8601 formatted, e.g. 2016-03-11T03:45:40Z ```bash @@ -251,7 +251,7 @@ Parameters: - `id` (required) - The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) - `snippet_id` (required) - The ID of a snippet - `note_id` (required) - The ID of a note -- `body` (required) - The content of a note. Limited to 1 000 000 characters. +- `body` (required) - The content of a note. Limited to 1,000,000 characters. ```bash curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/snippets/11/notes?body=note @@ -354,7 +354,7 @@ Parameters: - `id` (required) - The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) - `merge_request_iid` (required) - The IID of a merge request -- `body` (required) - The content of a note. Limited to 1 000 000 characters. +- `body` (required) - The content of a note. Limited to 1,000,000 characters. - `created_at` (optional) - Date time string, ISO 8601 formatted, e.g. 2016-03-11T03:45:40Z ### Modify existing merge request note @@ -370,7 +370,7 @@ Parameters: - `id` (required) - The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) - `merge_request_iid` (required) - The IID of a merge request - `note_id` (required) - The ID of a note -- `body` (required) - The content of a note. Limited to 1 000 000 characters. +- `body` (required) - The content of a note. Limited to 1,000,000 characters. ```bash curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/merge_requests/11/notes?body=note @@ -472,7 +472,7 @@ Parameters: | --------- | -------------- | -------- | ----------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) | | `epic_id` | integer | yes | The ID of an epic | -| `body` | string | yes | The content of a note. Limited to 1 000 000 characters. | +| `body` | string | yes | The content of a note. Limited to 1,000,000 characters. | ```bash curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/snippet/11/notes?body=note @@ -493,7 +493,7 @@ Parameters: | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) | | `epic_id` | integer | yes | The ID of an epic | | `note_id` | integer | yes | The ID of a note | -| `body` | string | yes | The content of a note. Limited to 1 000 000 characters. | +| `body` | string | yes | The content of a note. Limited to 1,000,000 characters. | ```bash curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/snippet/11/notes?body=note diff --git a/doc/api/oauth2.md b/doc/api/oauth2.md index f9382361187..6b49a39b83a 100644 --- a/doc/api/oauth2.md +++ b/doc/api/oauth2.md @@ -102,7 +102,7 @@ CAUTION: **Important:** Avoid using this flow for applications that store data outside of the GitLab instance. If you do, make sure to verify `application id` associated with the access token before granting access to the data -(see [/oauth/token/info](https://github.com/doorkeeper-gem/doorkeeper/wiki/API-endpoint-descriptions-and-examples#get----oauthtokeninfo)). +(see [`/oauth/token/info`](https://github.com/doorkeeper-gem/doorkeeper/wiki/API-endpoint-descriptions-and-examples#get----oauthtokeninfo)). Unlike the web flow, the client receives an `access token` immediately as a result of the authorization request. The flow does not use the client secret diff --git a/doc/api/pipelines.md b/doc/api/pipelines.md index c012c947c3a..90a4f8d6e26 100644 --- a/doc/api/pipelines.md +++ b/doc/api/pipelines.md @@ -34,14 +34,18 @@ Example of response "status": "pending", "ref": "new-pipeline", "sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a", - "web_url": "https://example.com/foo/bar/pipelines/47" + "web_url": "https://example.com/foo/bar/pipelines/47", + "created_at": "2016-08-11T11:28:34.085Z", + "updated_at": "2016-08-11T11:32:35.169Z", }, { "id": 48, "status": "pending", "ref": "new-pipeline", "sha": "eb94b618fb5865b26e80fdd8ae531b7a63ad851a", - "web_url": "https://example.com/foo/bar/pipelines/48" + "web_url": "https://example.com/foo/bar/pipelines/48", + "created_at": "2016-08-12T10:06:04.561Z", + "updated_at": "2016-08-12T10:09:56.223Z", } ] ``` diff --git a/doc/api/project_aliases.md b/doc/api/project_aliases.md index 9d59ca1e3b5..da8d7600c7c 100644 --- a/doc/api/project_aliases.md +++ b/doc/api/project_aliases.md @@ -23,12 +23,12 @@ Example response: { "id": 1, "project_id": 1, - "name": "gitlab-ce" + "name": "gitlab-foss" }, { "id": 2, "project_id": 2, - "name": "gitlab-ee" + "name": "gitlab" } ] ``` @@ -46,7 +46,7 @@ GET /project_aliases/:name | `name` | string | yes | The name of the alias | ``` -curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/project_aliases/gitlab-ee" +curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/project_aliases/gitlab" ``` Example response: @@ -55,7 +55,7 @@ Example response: { "id": 1, "project_id": 1, - "name": "gitlab-ee" + "name": "gitlab" } ``` @@ -74,13 +74,13 @@ POST /project_aliases | `name` | string | yes | The name of the alias. Must be unique. | ``` -curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/project_aliases" --form "project_id=1" --form "name=gitlab-ee" +curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/project_aliases" --form "project_id=1" --form "name=gitlab" ``` or ``` -curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/project_aliases" --form "project_id=gitlab-org/gitlab-ee" --form "name=gitlab-ee" +curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/project_aliases" --form "project_id=gitlab-org/gitlab" --form "name=gitlab" ``` Example response: @@ -89,7 +89,7 @@ Example response: { "id": 1, "project_id": 1, - "name": "gitlab-ee" + "name": "gitlab" } ``` @@ -107,5 +107,5 @@ DELETE /project_aliases/:name | `name` | string | yes | The name of the alias | ``` -curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/project_aliases/gitlab-ee" +curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/project_aliases/gitlab" ``` diff --git a/doc/api/project_import_export.md b/doc/api/project_import_export.md index e285c721d11..cd02d423a9f 100644 --- a/doc/api/project_import_export.md +++ b/doc/api/project_import_export.md @@ -111,6 +111,7 @@ POST /projects/import | Attribute | Type | Required | Description | | --------- | -------------- | -------- | ---------------------------------------- | | `namespace` | integer/string | no | The ID or path of the namespace that the project will be imported to. Defaults to the current user's namespace | +| `name` | string | no | The name of the project to be imported. Defaults to the path of the project if not provided | | `file` | string | yes | The file to be uploaded | | `path` | string | yes | Name and path for new project | | `overwrite` | boolean | no | If there is a project with the same path the import will overwrite it. Default to false | @@ -131,14 +132,12 @@ cURL doesn't support posting a file from a remote server. Importing a project fr ```python import requests -import urllib -import json -import sys +from io import BytesIO -s3_file = urllib.urlopen(presigned_url) +s3_file = requests.get(presigned_url) url = 'https://gitlab.example.com/api/v4/projects/import' -files = {'file': s3_file} +files = {'file': ('file.tar.gz', BytesIO(s3_file.content))} data = { "path": "example-project", "namespace": "example-group" diff --git a/doc/api/project_snippets.md b/doc/api/project_snippets.md index c2a39fd2178..7a6c90701ba 100644 --- a/doc/api/project_snippets.md +++ b/doc/api/project_snippets.md @@ -78,7 +78,7 @@ Parameters: - `title` (required) - The title of a snippet - `file_name` (required) - The name of a snippet file - `description` (optional) - The description of a snippet -- `code` (required) - The content of a snippet +- `content` (required) - The content of a snippet - `visibility` (required) - The snippet's visibility Example request: @@ -97,7 +97,7 @@ curl --request POST https://gitlab.com/api/v4/projects/:id/snippets \ "title" : "Example Snippet Title", "description" : "More verbose snippet description", "file_name" : "example.txt", - "code" : "source code \n with multiple lines\n", + "content" : "source code \n with multiple lines\n", "visibility" : "private" } ``` @@ -117,7 +117,7 @@ Parameters: - `title` (optional) - The title of a snippet - `file_name` (optional) - The name of a snippet file - `description` (optional) - The description of a snippet -- `code` (optional) - The content of a snippet +- `content` (optional) - The content of a snippet - `visibility` (optional) - The snippet's visibility Example request: @@ -136,7 +136,7 @@ curl --request PUT https://gitlab.com/api/v4/projects/:id/snippets \ "title" : "Updated Snippet Title", "description" : "More verbose snippet description", "file_name" : "new_filename.txt", - "code" : "updated source code \n with multiple lines\n", + "content" : "updated source code \n with multiple lines\n", "visibility" : "private" } ``` diff --git a/doc/api/projects.md b/doc/api/projects.md index af0c8ed7c5b..c352b972b17 100644 --- a/doc/api/projects.md +++ b/doc/api/projects.md @@ -809,16 +809,16 @@ If the project is a fork, and you provide a valid token to authenticate, the "description":"GitLab Community Edition", "name":"GitLab Community Edition", "name_with_namespace":"GitLab.org / GitLab Community Edition", - "path":"gitlab-ce", - "path_with_namespace":"gitlab-org/gitlab-ce", + "path":"gitlab-foss", + "path_with_namespace":"gitlab-org/gitlab-foss", "created_at":"2013-09-26T06:02:36.000Z", "default_branch":"master", "tag_list":[], - "ssh_url_to_repo":"git@gitlab.com:gitlab-org/gitlab-ce.git", + "ssh_url_to_repo":"git@gitlab.com:gitlab-org/gitlab-foss.git", "http_url_to_repo":"https://gitlab.com/gitlab-org/gitlab-foss.git", "web_url":"https://gitlab.com/gitlab-org/gitlab-foss", "avatar_url":"https://assets.gitlab-static.net/uploads/-/system/project/avatar/13083/logo-extra-whitespace.png", - "license_url": "https://gitlab.com/gitlab-org/gitlab-foss/blob/master/LICENSE", + "license_url": "https://gitlab.com/gitlab-org/gitlab/blob/master/LICENSE", "license": { "key": "mit", "name": "MIT License", @@ -931,9 +931,13 @@ POST /projects | `auto_devops_deploy_strategy` | string | no | Auto Deploy strategy (`continuous`, `manual` or `timed_incremental`) | | `repository_storage` | string | no | **(STARTER ONLY)** Which storage shard the repository is on. Available only to admins | | `approvals_before_merge` | integer | no | **(STARTER)** How many approvers should approve merge requests by default | +| `external_authorization_classification_label` | string | no | **(PREMIUM)** The classification label for the project | | `mirror` | boolean | no | **(STARTER)** Enables pull mirroring in a project | | `mirror_trigger_builds` | boolean | no | **(STARTER)** Pull mirroring triggers builds | | `initialize_with_readme` | boolean | no | `false` by default | +| `template_name` | string | no | When used without `use_custom_template`, name of a [built-in project template](../gitlab-basics/create-project.md#built-in-templates). When used with `use_custom_template`, name of a custom project template | +| `use_custom_template` | boolean | no | **(PREMIUM)** Use either custom [instance](../user/admin_area/custom_project_templates.md) or [group](../user/group/custom_project_templates.md) (with `group_with_project_templates_id`) project template | +| `group_with_project_templates_id` | integer | no | **(PREMIUM)** For group-level custom templates, specifies ID of group from which all the custom project templates are sourced. Leave empty for instance-level templates. Requires `use_custom_template` to be true | NOTE: **Note:** If your HTTP repository is not publicly accessible, add authentication information to the URL: `https://username:password@gitlab.company.com/group/project.git` @@ -991,6 +995,7 @@ POST /projects/user/:user_id | `external_authorization_classification_label` | string | no | **(PREMIUM)** The classification label for the project | | `mirror` | boolean | no | **(STARTER)** Enables pull mirroring in a project | | `mirror_trigger_builds` | boolean | no | **(STARTER)** Pull mirroring triggers builds | +| `initialize_with_readme` | boolean | no | `false` by default | | `template_name` | string | no | When used without `use_custom_template`, name of a [built-in project template](../gitlab-basics/create-project.md#built-in-templates). When used with `use_custom_template`, name of a custom project template | | `use_custom_template` | boolean | no | **(PREMIUM)** Use either custom [instance](../user/admin_area/custom_project_templates.md) or [group](../user/group/custom_project_templates.md) (with `group_with_project_templates_id`) project template | | `group_with_project_templates_id` | integer | no | **(PREMIUM)** For group-level custom templates, specifies ID of group from which all the custom project templates are sourced. Leave empty for instance-level templates. Requires `use_custom_template` to be true | @@ -2018,7 +2023,7 @@ Read more in the [Project members](members.md) documentation. ## Start the pull mirroring process for a Project **(STARTER)** -> Introduced in [GitLab Starter](https://about.gitlab.com/pricing) 10.3. +> Introduced in [GitLab Starter](https://about.gitlab.com/pricing/) 10.3. ``` POST /projects/:id/mirror/pull diff --git a/doc/api/protected_branches.md b/doc/api/protected_branches.md index a14c9046ca7..4a750b42f65 100644 --- a/doc/api/protected_branches.md +++ b/doc/api/protected_branches.md @@ -46,7 +46,8 @@ Example response: "access_level": 40, "access_level_description": "Maintainers" } - ] + ], + "code_owner_approval_required": "false" }, ... ] @@ -76,7 +77,8 @@ Example response: "group_id": 1234, "access_level_description": "Example Merge Group" } - ] + ], + "code_owner_approval_required": "false" }, ... ] @@ -115,7 +117,8 @@ Example response: "access_level": 40, "access_level_description": "Maintainers" } - ] + ], + "code_owner_approval_required": "false" } ``` @@ -142,7 +145,8 @@ Example response: "group_id": 1234, "access_level_description": "Example Merge Group" } - ] + ], + "code_owner_approval_required": "false" } ``` @@ -161,14 +165,15 @@ curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" 'https://gitla | Attribute | Type | Required | Description | | --------- | ---- | -------- | ----------- | -| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | -| `name` | string | yes | The name of the branch or wildcard | -| `push_access_level` | string | no | Access levels allowed to push (defaults: `40`, maintainer access level) | -| `merge_access_level` | string | no | Access levels allowed to merge (defaults: `40`, maintainer access level) | -| `unprotect_access_level` | string | no | Access levels allowed to unprotect (defaults: `40`, maintainer access level) | -| `allowed_to_push` | array | no | **(STARTER)** Array of access levels allowed to push, with each described by a hash | -| `allowed_to_merge` | array | no | **(STARTER)** Array of access levels allowed to merge, with each described by a hash | -| `allowed_to_unprotect` | array | no | **(STARTER)**Array of access levels allowed to unprotect, with each described by a hash | +| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | +| `name` | string | yes | The name of the branch or wildcard | +| `push_access_level` | string | no | Access levels allowed to push (defaults: `40`, maintainer access level) | +| `merge_access_level` | string | no | Access levels allowed to merge (defaults: `40`, maintainer access level) | +| `unprotect_access_level` | string | no | Access levels allowed to unprotect (defaults: `40`, maintainer access level) | +| `allowed_to_push` | array | no | **(STARTER)** Array of access levels allowed to push, with each described by a hash | +| `allowed_to_merge` | array | no | **(STARTER)** Array of access levels allowed to merge, with each described by a hash | +| `allowed_to_unprotect` | array | no | **(STARTER)** Array of access levels allowed to unprotect, with each described by a hash | +| `code_owner_approval_required` | boolean | no | **(PREMIUM)** Prevent pushes to this branch if it matches an item in the [`CODEOWNERS` file](../user/project/code_owners.md). (defaults: false) | Example response: @@ -192,7 +197,8 @@ Example response: "access_level": 40, "access_level_description": "Maintainers" } - ] + ], + "code_owner_approval_required": "false" } ``` @@ -227,7 +233,8 @@ Example response: "group_id": null, "access_level_description": "Maintainers" } - ] + ], + "code_owner_approval_required": "false" } ``` @@ -268,7 +275,8 @@ Example response: "group_id": null, "access_level_description": "Maintainers" } - ] + ], + "code_owner_approval_required": "false" } ``` @@ -288,3 +296,21 @@ curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" 'https://git | --------- | ---- | -------- | ----------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `name` | string | yes | The name of the branch | + +## Require code owner approvals for a single branch + +Update the "code owner approval required" option for the given protected branch protected branch. + +``` +PATCH /projects/:id/protected_branches/:name +``` + +```bash +curl --request PATCH --header "PRIVATE-TOKEN: <your_access_token>" 'https://gitlab.example.com/api/v4/projects/5/protected_branches/feature-branch' +``` + +| Attribute | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | +| `name` | string | yes | The name of the branch | +| `code_owner_approval_required` | boolean | no | **(PREMIUM)** Prevent pushes to this branch if it matches an item in the [`CODEOWNERS` file](../user/project/code_owners.md). (defaults: false)| diff --git a/doc/api/releases/index.md b/doc/api/releases/index.md index c856a06b57d..ee2df3e4c5d 100644 --- a/doc/api/releases/index.md +++ b/doc/api/releases/index.md @@ -85,6 +85,8 @@ Example response: "web_url":"https://gitlab.example.com/root/awesome-app/-/milestones/2" } ], + "commit_path":"/root/awesome-app/commit/588440f66559714280628a4f9799f0c4eb880a4a", + "tag_path":"/root/awesome-app/-/tags/v0.11.1", "assets":{ "count":6, "sources":[ @@ -119,7 +121,7 @@ Example response: "external":true } ] - } + }, }, { "tag_name":"v0.1", @@ -175,7 +177,7 @@ Example response: "links":[ ] - } + }, } ] ``` @@ -261,6 +263,8 @@ Example response: "web_url":"https://gitlab.example.com/root/awesome-app/-/milestones/2" } ], + "commit_path":"/root/awesome-app/commit/588440f66559714280628a4f9799f0c4eb880a4a", + "tag_path":"/root/awesome-app/-/tags/v0.11.1", "assets":{ "count":4, "sources":[ @@ -284,7 +288,7 @@ Example response: "links":[ ] - } + }, } ``` @@ -296,18 +300,18 @@ Create a Release. You need push access to the repository to create a Release. POST /projects/:id/releases ``` -| Attribute | Type | Required | Description | -| -------------------| --------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- | -| `id` | integer/string | yes | The ID or [URL-encoded path of the project](../README.md#namespaced-path-encoding). | -| `name` | string | yes | The release name. | -| `tag_name` | string | yes | The tag where the release will be created from. | -| `description` | string | yes | The description of the release. You can use [markdown](../../user/markdown.md). | -| `ref` | string | no | If `tag_name` doesn't exist, the release will be created from `ref`. It can be a commit SHA, another tag name, or a branch name. | -| `milestones` | array of string | no | The title of each milestone the release is associated with. | -| `assets:links` | array of hash | no | An array of assets links. | -| `assets:links:name`| string | required by: `assets:links` | The name of the link. | -| `assets:links:url` | string | required by: `assets:links` | The url of the link. | -| `released_at` | datetime | no | The date when the release will be/was ready. Defaults to the current time. Expected in ISO 8601 format (`2019-03-15T08:00:00Z`). | +| Attribute | Type | Required | Description | +| -------------------| --------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `id` | integer/string | yes | The ID or [URL-encoded path of the project](../README.md#namespaced-path-encoding). | +| `name` | string | yes | The release name. | +| `tag_name` | string | yes | The tag where the release will be created from. | +| `description` | string | yes | The description of the release. You can use [markdown](../../user/markdown.md). | +| `ref` | string | yes, if `tag_name` doesn't exist | If `tag_name` doesn't exist, the release will be created from `ref`. It can be a commit SHA, another tag name, or a branch name. | +| `milestones` | array of string | no | The title of each milestone the release is associated with. | +| `assets:links` | array of hash | no | An array of assets links. | +| `assets:links:name`| string | required by: `assets:links` | The name of the link. | +| `assets:links:url` | string | required by: `assets:links` | The url of the link. | +| `released_at` | datetime | no | The date when the release will be/was ready. Defaults to the current time. Expected in ISO 8601 format (`2019-03-15T08:00:00Z`). | Example request: @@ -379,6 +383,8 @@ Example response: "web_url":"https://gitlab.example.com/root/awesome-app/-/milestones/2" } ], + "commit_path":"/root/awesome-app/commit/588440f66559714280628a4f9799f0c4eb880a4a", + "tag_path":"/root/awesome-app/-/tags/v0.11.1", "assets":{ "count":5, "sources":[ @@ -407,7 +413,7 @@ Example response: "external":true } ] - } + }, } ``` @@ -483,6 +489,8 @@ Example response: "web_url":"https://gitlab.example.com/root/awesome-app/-/milestones/3" } ], + "commit_path":"/root/awesome-app/commit/588440f66559714280628a4f9799f0c4eb880a4a", + "tag_path":"/root/awesome-app/-/tags/v0.11.1", "assets":{ "count":4, "sources":[ @@ -506,7 +514,7 @@ Example response: "links":[ ] - } + }, } ``` @@ -563,6 +571,8 @@ Example response: "committer_email":"admin@example.com", "committed_date":"2019-01-03T01:53:28.000Z" }, + "commit_path":"/root/awesome-app/commit/588440f66559714280628a4f9799f0c4eb880a4a", + "tag_path":"/root/awesome-app/-/tags/v0.11.1", "assets":{ "count":4, "sources":[ @@ -586,7 +596,7 @@ Example response: "links":[ ] - } + }, } ``` diff --git a/doc/api/runners.md b/doc/api/runners.md index 51a546e91dc..45d68e40777 100644 --- a/doc/api/runners.md +++ b/doc/api/runners.md @@ -184,8 +184,8 @@ Example response: "id": 1, "name": "GitLab Community Edition", "name_with_namespace": "GitLab.org / GitLab Community Edition", - "path": "gitlab-ce", - "path_with_namespace": "gitlab-org/gitlab-ce" + "path": "gitlab-foss", + "path_with_namespace": "gitlab-org/gitlab-foss" } ], "token": "205086a8e3b9a2b818ffac9b89d102", @@ -243,8 +243,8 @@ Example response: "id": 1, "name": "GitLab Community Edition", "name_with_namespace": "GitLab.org / GitLab Community Edition", - "path": "gitlab-ce", - "path_with_namespace": "gitlab-org/gitlab-ce" + "path": "gitlab-foss", + "path_with_namespace": "gitlab-org/gitlab-foss" } ], "token": "205086a8e3b9a2b818ffac9b89d102", diff --git a/doc/api/scim.md b/doc/api/scim.md index bc4f2bf9040..8cbd6103e88 100644 --- a/doc/api/scim.md +++ b/doc/api/scim.md @@ -24,6 +24,11 @@ Parameters: |:----------|:--------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------| | `filter` | string | yes | A [filter](#available-filters) expression. | | `group_path` | string | yes | Full path to the group. | +| `startIndex` | integer | no | The 1-based index indicating where to start returning results from. A value of less than one will be interpreted as 1. | +| `count` | integer | no | Desired maximum number of query results. | + +NOTE: **Note:** +Pagination follows the [SCIM spec](https://tools.ietf.org/html/rfc7644#section-3.4.2.4) rather than GitLab pagination as used elsewhere. If records change between requests it is possible for a page to either be missing records that have moved to a different page or repeat records from a previous request. Example request: diff --git a/doc/api/services.md b/doc/api/services.md index ff181f2ba61..4abc02dec3c 100644 --- a/doc/api/services.md +++ b/doc/api/services.md @@ -10,7 +10,7 @@ Asana - Teamwork without email Set Asana service for a project. -> This service adds commit messages as comments to Asana tasks. Once enabled, commit messages are checked for Asana task URLs (for example, `https://app.asana.com/0/123456/987654`) or task IDs starting with # (for example, `#987654`). Every task ID found will get the commit comment added to it. You can also close a task with a message containing: `fix #123456`. You can find your Api Keys here: <https://asana.com/developers/documentation/getting-started/auth#api-key>. +> This service adds commit messages as comments to Asana tasks. Once enabled, commit messages are checked for Asana task URLs (for example, `https://app.asana.com/0/123456/987654`) or task IDs starting with # (for example, `#987654`). Every task ID found will get the commit comment added to it. You can also close a task with a message containing: `fix #123456`. You can find your API Keys here: <https://asana.com/developers/documentation/getting-started/auth#api-key>. ``` PUT /projects/:id/services/asana @@ -414,6 +414,42 @@ Get Flowdock service settings for a project. GET /projects/:id/services/flowdock ``` +## GitHub **(PREMIUM)** + +Code collaboration software. + +### Create/Edit GitHub service + +Set GitHub service for a project. + +``` +PUT /projects/:id/services/github +``` + +Parameters: + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `token` | string | true | GitHub API token with `repo:status` OAuth scope | +| `repository_url` | string | true | GitHub repository URL | +| `static_context` | boolean | false | Append instance name instead of branch to [status check name](../user/project/integrations/github.md#static--dynamic-status-check-names) | + +### Delete GitHub service + +Delete GitHub service for a project. + +``` +DELETE /projects/:id/services/github +``` + +### Get GitHub service settings + +Get GitHub service settings for a project. + +``` +GET /projects/:id/services/github +``` + ## Hangouts Chat Google GSuite team collaboration tool. @@ -1189,7 +1225,7 @@ GET /projects/:id/services/jenkins-deprecated ``` [jira-doc]: ../user/project/integrations/jira.md -[old-jira-api]: https://gitlab.com/gitlab-org/gitlab-foss/blob/8-13-stable/doc/api/services.md#jira +[old-jira-api]: https://gitlab.com/gitlab-org/gitlab/blob/8-13-stable/doc/api/services.md#jira ## MockCI diff --git a/doc/api/settings.md b/doc/api/settings.md index 39fc848b272..2d9e435bbb6 100644 --- a/doc/api/settings.md +++ b/doc/api/settings.md @@ -1,7 +1,3 @@ ---- -table_display_block: true ---- - # Application settings API These API calls allow you to read and modify GitLab instance @@ -183,8 +179,8 @@ are listed in the descriptions of the relevant settings. | `admin_notification_email` | string | no | Abuse reports will be sent to this address if it is set. Abuse reports are always available in the admin area. | | `after_sign_out_path` | string | no | Where to redirect users after logout. | | `after_sign_up_text` | string | no | Text shown to the user after signing up | -| `akismet_api_key` | string | required by: `akismet_enabled` | API key for akismet spam protection. | -| `akismet_enabled` | boolean | no | (**If enabled, requires:** `akismet_api_key`) Enable or disable akismet spam protection. | +| `akismet_api_key` | string | required by: `akismet_enabled` | API key for Akismet spam protection. | +| `akismet_enabled` | boolean | no | (**If enabled, requires:** `akismet_api_key`) Enable or disable Akismet spam protection. | | `allow_group_owners_to_manage_ldap` | boolean | no | **(PREMIUM)** Set to `true` to allow group owners to manage LDAP | | `allow_local_requests_from_hooks_and_services` | boolean | no | (Deprecated: Use `allow_local_requests_from_web_hooks_and_services` instead) Allow requests to the local network from hooks and services. | | `allow_local_requests_from_system_hooks` | boolean | no | Allow requests to the local network from system hooks. | @@ -218,7 +214,7 @@ are listed in the descriptions of the relevant settings. | `ed25519_key_restriction` | integer | no | The minimum allowed curve size (in bits) of an uploaded ED25519 key. Default is `0` (no restriction). `-1` disables ED25519 keys. | | `elasticsearch_aws_access_key` | string | no | **(PREMIUM)** AWS IAM access key | | `elasticsearch_aws` | boolean | no | **(PREMIUM)** Enable the use of AWS hosted Elasticsearch | -| `elasticsearch_aws_region` | string | no | **(PREMIUM)** The AWS region the elasticsearch domain is configured | +| `elasticsearch_aws_region` | string | no | **(PREMIUM)** The AWS region the Elasticsearch domain is configured | | `elasticsearch_aws_secret_access_key` | string | no | **(PREMIUM)** AWS IAM secret access key | | `elasticsearch_indexing` | boolean | no | **(PREMIUM)** Enable Elasticsearch indexing | | `elasticsearch_limit_indexing` | boolean | no | **(PREMIUM)** Limit Elasticsearch to index certain namespaces and projects | @@ -290,12 +286,14 @@ are listed in the descriptions of the relevant settings. | `plantuml_url` | string | required by: `plantuml_enabled` | The PlantUML instance URL for integration. | | `polling_interval_multiplier` | decimal | no | Interval multiplier used by endpoints that perform polling. Set to `0` to disable polling. | | `project_export_enabled` | boolean | no | Enable project export. | -| `prometheus_metrics_enabled` | boolean | no | Enable prometheus metrics. | +| `prometheus_metrics_enabled` | boolean | no | Enable Prometheus metrics. | | `protected_ci_variables` | boolean | no | Environment variables are protected by default. | | `pseudonymizer_enabled` | boolean | no | **(PREMIUM)** When enabled, GitLab will run a background job that will produce pseudonymized CSVs of the GitLab database that will be uploaded to your configured object storage directory. -| `recaptcha_enabled` | boolean | no | (**If enabled, requires:** `recaptcha_private_key` and `recaptcha_site_key`) Enable recaptcha. | -| `recaptcha_private_key` | string | required by: `recaptcha_enabled` | Private key for recaptcha. | -| `recaptcha_site_key` | string | required by: `recaptcha_enabled` | Site key for recaptcha. | +| `push_event_hooks_limit` | integer | no | Number of changes (branches or tags) in a single push to determine whether webhooks and services will be fired or not. Webhooks and services won't be submitted if it surpasses that value. | +| `push_event_activities_limit` | integer | no | Number of changes (branches or tags) in a single push to determine whether individual push events or bulk push events will be created. [Bulk push events will be created](../user/admin_area/settings/push_event_activities_limit.md) if it surpasses that value. | +| `recaptcha_enabled` | boolean | no | (**If enabled, requires:** `recaptcha_private_key` and `recaptcha_site_key`) Enable reCAPTCHA. | +| `recaptcha_private_key` | string | required by: `recaptcha_enabled` | Private key for reCAPTCHA. | +| `recaptcha_site_key` | string | required by: `recaptcha_enabled` | Site key for reCAPTCHA. | | `receive_max_input_size` | integer | no | Maximum push size (MB). | | `repository_checks_enabled` | boolean | no | GitLab will periodically run `git fsck` in all project and wiki repositories to look for silent disk corruption issues. | | `repository_size_limit` | integer | no | **(PREMIUM)** Size limit per repository (MB) | diff --git a/doc/api/tags.md b/doc/api/tags.md index 3807688ffe3..56143969e3c 100644 --- a/doc/api/tags.md +++ b/doc/api/tags.md @@ -116,6 +116,12 @@ Parameters: - `message` (optional) - Creates annotated tag. - `release_description` (optional) - Add release notes to the Git tag and store it in the GitLab database. +```bash +curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/repository/tags?tag_name=test&ref=master" +``` + +Example response: + ```json { "commit": { diff --git a/doc/api/templates/gitignores.md b/doc/api/templates/gitignores.md index 0b6d944cb62..45820b24f10 100644 --- a/doc/api/templates/gitignores.md +++ b/doc/api/templates/gitignores.md @@ -12,10 +12,12 @@ information on `gitignore`, see the Get all `.gitignore` templates. -``` +```plaintext GET /templates/gitignores ``` +Example request: + ```bash curl https://gitlab.example.com/api/v4/templates/gitignores ``` @@ -111,14 +113,16 @@ Example response: Get a single `.gitignore` template. -``` +```plaintext GET /templates/gitignores/:key ``` -| Attribute | Type | Required | Description | -| ---------- | ------ | -------- | ----------- | +| Attribute | Type | Required | Description | +| ---------- | ------ | -------- | ------------------------------------ | | `key` | string | yes | The key of the `.gitignore` template | +Example request: + ```bash curl https://gitlab.example.com/api/v4/templates/gitignores/Ruby ``` diff --git a/doc/api/templates/gitlab_ci_ymls.md b/doc/api/templates/gitlab_ci_ymls.md index 80f94b953e3..b8fdb9e233c 100644 --- a/doc/api/templates/gitlab_ci_ymls.md +++ b/doc/api/templates/gitlab_ci_ymls.md @@ -12,10 +12,12 @@ information on CI/CD pipeline configuration in GitLab, see the Get all GitLab CI YML templates. -``` +```plaintext GET /templates/gitlab_ci_ymls ``` +Example request: + ```bash curl https://gitlab.example.com/api/v4/templates/gitlab_ci_ymls ``` @@ -29,6 +31,10 @@ Example response: "name": "Android" }, { + "key": "Android-Fastlane", + "name": "Android-Fastlane" + }, + { "key": "Auto-DevOps", "name": "Auto-DevOps" }, @@ -49,6 +55,10 @@ Example response: "name": "Clojure" }, { + "key": "Code-Quality", + "name": "Code-Quality" + }, + { "key": "Crystal", "name": "Crystal" }, @@ -95,14 +105,6 @@ Example response: { "key": "Mono", "name": "Mono" - }, - { - "key": "Nodejs", - "name": "Nodejs" - }, - { - "key": "OpenShift", - "name": "OpenShift" } ] ``` @@ -111,14 +113,16 @@ Example response: Get a single GitLab CI YML template. -``` +```plaintext GET /templates/gitlab_ci_ymls/:key ``` -| Attribute | Type | Required | Description | -| ---------- | ------ | -------- | ----------- | +| Attribute | Type | Required | Description | +| ---------- | ------ | -------- | ------------------------------------- | | `key` | string | yes | The key of the GitLab CI YML template | +Example request: + ```bash curl https://gitlab.example.com/api/v4/templates/gitlab_ci_ymls/Ruby ``` @@ -128,7 +132,7 @@ Example response: ```json { "name": "Ruby", - "content": "# This file is a template, and might need editing before it works on your project.\n# Official language image. Look for the different tagged releases at:\n# https://hub.docker.com/r/library/ruby/tags/\nimage: \"ruby:2.5\"\n\n# Pick zero or more services to be used on all builds.\n# Only needed when using a docker container to run your tests in.\n# Check out: http://docs.gitlab.com/ce/ci/docker/using_docker_images.html#what-is-a-service\nservices:\n - mysql:latest\n - redis:latest\n - postgres:latest\n\nvariables:\n POSTGRES_DB: database_name\n\n# Cache gems in between builds\ncache:\n paths:\n - vendor/ruby\n\n# This is a basic example for a gem or script which doesn't use\n# services such as redis or postgres\nbefore_script:\n - ruby -v # Print out ruby version for debugging\n # Uncomment next line if your rails app needs a JS runtime:\n # - apt-get update -q && apt-get install nodejs -yqq\n - bundle install -j $(nproc) --path vendor # Install dependencies into ./vendor/ruby\n\n# Optional - Delete if not using `rubocop`\nrubocop:\n script:\n - rubocop\n\nrspec:\n script:\n - rspec spec\n\nrails:\n variables:\n DATABASE_URL: \"postgresql://postgres:postgres@postgres:5432/$POSTGRES_DB\"\n script:\n - rails db:migrate\n - rails db:seed\n - rails test\n\n# This deploy job uses a simple deploy flow to Heroku, other providers, e.g. AWS Elastic Beanstalk\n# are supported too: https://github.com/travis-ci/dpl\ndeploy:\n type: deploy\n environment: production\n script:\n - gem install dpl\n - dpl --provider=heroku --app=$HEROKU_APP_NAME --api-key=$HEROKU_PRODUCTION_KEY\n" + "content": "# This file is a template, and might need editing before it works on your project.\n# Official language image. Look for the different tagged releases at:\n# https://hub.docker.com/r/library/ruby/tags/\nimage: \"ruby:2.5\"\n\n# Pick zero or more services to be used on all builds.\n# Only needed when using a docker container to run your tests in.\n# Check out: http://docs.gitlab.com/ce/ci/docker/using_docker_images.html#what-is-a-service\nservices:\n - mysql:latest\n - redis:latest\n - postgres:latest\n\nvariables:\n POSTGRES_DB: database_name\n\n# Cache gems in between builds\ncache:\n paths:\n - vendor/ruby\n\n# This is a basic example for a gem or script which doesn't use\n# services such as redis or postgres\nbefore_script:\n - ruby -v # Print out ruby version for debugging\n # Uncomment next line if your rails app needs a JS runtime:\n # - apt-get update -q && apt-get install nodejs -yqq\n - bundle install -j $(nproc) --path vendor # Install dependencies into ./vendor/ruby\n\n# Optional - Delete if not using `rubocop`\nrubocop:\n script:\n - rubocop\n\nrspec:\n script:\n - rspec spec\n\nrails:\n variables:\n DATABASE_URL: \"postgresql://postgres:postgres@postgres:5432/$POSTGRES_DB\"\n script:\n - rails db:migrate\n - rails db:seed\n - rails test\n\n# This deploy job uses a simple deploy flow to Heroku, other providers, e.g. AWS Elastic Beanstalk\n# are supported too: https://github.com/travis-ci/dpl\ndeploy:\n type: deploy\n environment: production\n script:\n - gem install dpl\n - dpl --provider=heroku --app=$HEROKU_APP_NAME --api-key=$HEROKU_PRODUCTION_KEY\n" } ``` diff --git a/doc/api/todos.md b/doc/api/todos.md index bc2eeccacbe..b708b4391a2 100644 --- a/doc/api/todos.md +++ b/doc/api/todos.md @@ -36,8 +36,8 @@ Example Response: "id": 2, "name": "Gitlab Ce", "name_with_namespace": "Gitlab Org / Gitlab Ce", - "path": "gitlab-ce", - "path_with_namespace": "gitlab-org/gitlab-ce" + "path": "gitlab-foss", + "path_with_namespace": "gitlab-org/gitlab-foss" }, "author": { "name": "Administrator", @@ -109,8 +109,8 @@ Example Response: "id": 2, "name": "Gitlab Ce", "name_with_namespace": "Gitlab Org / Gitlab Ce", - "path": "gitlab-ce", - "path_with_namespace": "gitlab-org/gitlab-ce" + "path": "gitlab-foss", + "path_with_namespace": "gitlab-org/gitlab-foss" }, "author": { "name": "Maxie Medhurst", @@ -207,8 +207,8 @@ Example Response: "id": 2, "name": "Gitlab Ce", "name_with_namespace": "Gitlab Org / Gitlab Ce", - "path": "gitlab-ce", - "path_with_namespace": "gitlab-org/gitlab-ce" + "path": "gitlab-foss", + "path_with_namespace": "gitlab-org/gitlab-foss" }, "author": { "name": "Administrator", diff --git a/doc/api/users.md b/doc/api/users.md index 380396c7377..33b6efa7a02 100644 --- a/doc/api/users.md +++ b/doc/api/users.md @@ -393,20 +393,21 @@ PUT /users/:id Parameters: -- `email` - Email -- `username` - Username -- `name` - Name -- `password` - Password -- `skype` - Skype ID -- `linkedin` - LinkedIn -- `twitter` - Twitter account -- `website_url` - Website URL -- `organization` - Organization name -- `projects_limit` - Limit projects each user can create -- `extern_uid` - External UID -- `provider` - External provider name +- `id` (required) - The ID of the user +- `email` (optional) - Email +- `username` (optional) - Username +- `name` (optional) - Name +- `password` (optional) - Password +- `skype` (optional) - Skype ID +- `linkedin` (optional) - LinkedIn +- `twitter` (optional) - Twitter account +- `website_url` (optional) - Website URL +- `organization` (optional) - Organization name +- `projects_limit` (optional) - Limit projects each user can create +- `extern_uid` (optional) - External UID +- `provider` (optional) - External provider name - `group_id_for_saml` (optional) - ID of group where SAML has been configured -- `bio` - User's biography +- `bio` (optional) - User's biography - `location` (optional) - User's location - `public_email` (optional) - The public email of the user - `admin` (optional) - User is admin - true or false (default) @@ -419,7 +420,7 @@ Parameters: - `private_profile` (optional) - User's profile is private - true or false (default) - `shared_runners_minutes_limit` (optional) - Pipeline minutes quota for this user **(STARTER)** - `extra_shared_runners_minutes_limit` (optional) - Extra pipeline minutes quota for this user **(STARTER)** -- `note` (optional) - Admin notes for this user **(STARTER)** +- `note` (optional) - Admin notes for this user **(STARTER)** On password update, user will be forced to change it upon next login. Note, at the moment this method does only return a `404` error, @@ -595,7 +596,7 @@ PUT /user/status | Attribute | Type | Required | Description | | --------- | ------ | -------- | ----------- | -| `emoji` | string | no | The name of the emoji to use as status, if omitted `speech_balloon` is used. Emoji name can be one of the specified names in the [Gemojione index][gemojione-index]. | +| `emoji` | string | no | The name of the emoji to use as status, if omitted `speech_balloon` is used. Emoji name can be one of the specified names in the [Gemojione index](https://github.com/bonusly/gemojione/blob/master/config/index.json). | | `message` | string | no | The message to set as a status. It can also contain emoji codes. | When both parameters `emoji` and `message` are empty, the status will be cleared. @@ -1151,6 +1152,48 @@ Parameters: Will return `201 OK` on success, `404 User Not Found` is user cannot be found or `403 Forbidden` when trying to unblock a user blocked by LDAP synchronization. +## Deactivate user + +> [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/issues/63921) in GitLab 12.4. + +Deactivates the specified user. Available only for admin. + +``` +POST /users/:id/deactivate +``` + +Parameters: + +- `id` (required) - id of specified user + +Returns: + +- `201 OK` on success. +- `404 User Not Found` if user cannot be found. +- `403 Forbidden` when trying to deactivate a user: + - Blocked by admin or by LDAP synchronization. + - That has any activity in past 14 days. These cannot be deactivated. + +## Activate user + +> [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/issues/63921) in GitLab 12.4. + +Activates the specified user. Available only for admin. + +``` +POST /users/:id/activate +``` + +Parameters: + +- `id` (required) - id of specified user + +Returns: + +- `201 OK` on success. +- `404 User Not Found` if user cannot be found. +- `403 Forbidden` when trying to activate a user blocked by admin or by LDAP synchronization. + ### Get user contribution events Please refer to the [Events API documentation](events.md#get-user-contribution-events) @@ -1362,5 +1405,3 @@ Example response: ``` Please note that `last_activity_at` is deprecated, please use `last_activity_on`. - -[gemojione-index]: https://github.com/jonathanwiesel/gemojione/blob/master/config/index.json |