diff options
author | Patrick Bajao <ebajao@gitlab.com> | 2019-08-16 19:52:11 +0800 |
---|---|---|
committer | Patrick Bajao <ebajao@gitlab.com> | 2019-08-18 11:39:34 +0800 |
commit | b4137407a65688af793ab11e538a3d6969264a10 (patch) | |
tree | fd8d888cc5b5de31ac94889c8468c30a40143c60 | |
parent | 476ba32bbe5922b8d4f5c0508f5b16499c2e046f (diff) | |
download | gitlab-ce-11877-public-approval-api-ee-docs.tar.gz |
Doc: Update with new version of public API11877-public-approval-api-ee-docs
-rw-r--r-- | doc/api/merge_request_approvals.md | 214 |
1 files changed, 61 insertions, 153 deletions
diff --git a/doc/api/merge_request_approvals.md b/doc/api/merge_request_approvals.md index 8dfc9cf69d3..bf83bfd7e6a 100644 --- a/doc/api/merge_request_approvals.md +++ b/doc/api/merge_request_approvals.md @@ -63,7 +63,7 @@ POST /projects/:id/approvals ### Get project-level rules ->**Note:** This API endpoint is only available on 12.2 Starter and above. +>**Note:** This API endpoint is only available on 12.3 Starter and above. You can request information about a project's approval rules using the following endpoint: @@ -78,69 +78,66 @@ GET /projects/:id/approval_rules | `id` | integer | yes | The ID of a project | ```json -{ - "rules": [ - { - "id": 1, - "name": "security", - "rule_type": "regular", - "approvers": [ - { - "id": 5, - "name": "John Doe", - "username": "jdoe", - "state": "active", - "avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon", - "web_url": "http://localhost/jdoe" - }, - { - "id": 50, - "name": "Group Member 1", - "username": "group_member_1", - "state": "active", - "avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon", - "web_url": "http://localhost/group_member_1" - } - ], - "approvals_required": 3, - "users": [ - { - "id": 5, - "name": "John Doe", - "username": "jdoe", - "state": "active", - "avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon", - "web_url": "http://localhost/jdoe" - } - ], - "groups": [ - { - "id": 5, - "name": "group1", - "path": "group1", - "description": "", - "visibility": "public", - "lfs_enabled": false, - "avatar_url": null, - "web_url": "http://localhost/groups/group1", - "request_access_enabled": false, - "full_name": "group1", - "full_path": "group1", - "parent_id": null, - "ldap_cn": null, - "ldap_access": null - } - ], - "contains_hidden_groups": false - } - ], - "fallback_approvals_required": 3 -} +[ + { + "id": 1, + "name": "security", + "rule_type": "regular", + "eligible_approvers": [ + { + "id": 5, + "name": "John Doe", + "username": "jdoe", + "state": "active", + "avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon", + "web_url": "http://localhost/jdoe" + }, + { + "id": 50, + "name": "Group Member 1", + "username": "group_member_1", + "state": "active", + "avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon", + "web_url": "http://localhost/group_member_1" + } + ], + "approvals_required": 3, + "users": [ + { + "id": 5, + "name": "John Doe", + "username": "jdoe", + "state": "active", + "avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon", + "web_url": "http://localhost/jdoe" + } + ], + "groups": [ + { + "id": 5, + "name": "group1", + "path": "group1", + "description": "", + "visibility": "public", + "lfs_enabled": false, + "avatar_url": null, + "web_url": "http://localhost/groups/group1", + "request_access_enabled": false, + "full_name": "group1", + "full_path": "group1", + "parent_id": null, + "ldap_cn": null, + "ldap_access": null + } + ], + "contains_hidden_groups": false + } +] ``` ### Create project-level rule ->**Note:** This API endpoint is only available on 12.2 Starter and above. +>**Note:** This API endpoint is only available on 12.3 Starter and above. You can create project approval rules using the following endpoint: @@ -163,7 +160,7 @@ POST /projects/:id/approval_rules "id": 1, "name": "security", "rule_type": "regular", - "approvers": [ + "eligible_approvers": [ { "id": 2, "name": "John Doe", @@ -216,7 +213,7 @@ POST /projects/:id/approval_rules ### Update project-level rule ->**Note:** This API endpoint is only available on 12.2 Starter and above. +>**Note:** This API endpoint is only available on 12.3 Starter and above. You can update project approval rules using the following endpoint: @@ -242,7 +239,7 @@ PUT /projects/:id/approval_rules/:approval_rule_id "id": 1, "name": "security", "rule_type": "regular", - "approvers": [ + "eligible_approvers": [ { "id": 2, "name": "John Doe", @@ -295,7 +292,7 @@ PUT /projects/:id/approval_rules/:approval_rule_id ### Delete project-level rule ->**Note:** This API endpoint is only available on 12.2 Starter and above. +>**Note:** This API endpoint is only available on 12.3 Starter and above. You can delete project approval rules using the following endpoint: @@ -528,95 +525,6 @@ PUT /projects/:id/merge_requests/:merge_request_iid/approvers } ``` -### Get approval rules for Merge Request - ->**Note:** This API endpoint is only available on 12.2 Starter and above. - -You can request information about a merge request's approval rules using the following endpoint: - -``` -GET /projects/:id/merge_requests/:merge_request_iid/approval_rules -``` - -**Parameters:** - -| Attribute | Type | Required | Description | -|----------------------|---------|----------|-----------------------------------------------------------| -| `id` | integer | yes | The ID of a project | -| `merge_request_iid` | integer | yes | The IID of MR | - -```json -{ - "approval_rules_overwritten": true, - "rules": [ - { - "id": 1, - "name": "Ruby", - "rule_type": "regular", - "approvers": [ - { - "id": 4, - "name": "John Doe", - "username": "jdoe", - "state": "active", - "avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon", - "web_url": "http://localhost/jdoe" - }, - { - "id": 50, - "name": "Group Member 1", - "username": "group_member_1", - "state": "active", - "avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon", - "web_url": "http://localhost/group_member_1" - } - ], - "approvals_required": 2, - "users": [ - { - "id": 4, - "name": "John Doe", - "username": "jdoe", - "state": "active", - "avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon", - "web_url": "http://localhost/jdoe" - } - ], - "groups": [ - { - "id": 5, - "name": "group1", - "path": "group1", - "description": "", - "visibility": "public", - "lfs_enabled": false, - "avatar_url": null, - "web_url": "http://localhost/groups/group1", - "request_access_enabled": false, - "full_name": "group1", - "full_path": "group1", - "parent_id": null, - "ldap_cn": null, - "ldap_access": null - } - ], - "contains_hidden_groups": false, - "approved_by": [ - { - "id": 4, - "name": "John Doe", - "username": "jdoe", - "state": "active", - "avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon", - "web_url": "http://localhost/jdoe" - } - ], - "source_rule": null, - "approved": true - } - ] -} -``` ## Approve Merge Request >**Note:** This API endpoint is only available on 8.9 Starter and above. |