Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-06-04 03:08:17 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-06-04 03:08:17 +0300
commit340fd2966e6565a549f8e611b25d2525fc6929d1 (patch)
treebfe8876fe6f2a7c78b9e49feec0bf80d8d45bd52 /doc/api/audit_events.md
parentfc92738a0245f1be88250448bebd9c20e9849444 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/api/audit_events.md')
-rw-r--r--doc/api/audit_events.md112
1 files changed, 112 insertions, 0 deletions
diff --git a/doc/api/audit_events.md b/doc/api/audit_events.md
index 36b3722475f..ce2a9afd53c 100644
--- a/doc/api/audit_events.md
+++ b/doc/api/audit_events.md
@@ -225,3 +225,115 @@ Example response:
"created_at": "2019-08-28T19:36:44.162Z"
}
```
+
+## Project Audit Events **(STARTER)**
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/219238) in GitLab 13.1.
+
+The Project Audit Events API allows you to retrieve [project audit events](../administration/audit_events.md#project-events-starter).
+
+To retrieve project audit events using the API, you must [authenticate yourself](README.md#authentication) as a Maintainer or an Owner of the project.
+
+### Retrieve all project audit events
+
+```plaintext
+GET /projects/:id/audit_events
+```
+
+| Attribute | Type | Required | Description |
+| --------- | ---- | -------- | ----------- |
+| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) |
+| `created_after` | string | no | Return project audit events created on or after the given time. Format: ISO 8601 YYYY-MM-DDTHH:MM:SSZ |
+| `created_before` | string | no | Return project audit events created on or before the given time. Format: ISO 8601 YYYY-MM-DDTHH:MM:SSZ |
+
+By default, `GET` requests return 20 results at a time because the API results
+are paginated.
+
+Read more on [pagination](README.md#pagination).
+
+```shell
+curl --header "PRIVATE-TOKEN: <your_access_token>" https://primary.example.com/api/v4/projects/7/audit_events
+```
+
+Example response:
+
+```json
+[
+ {
+ "id": 5,
+ "author_id": 1,
+ "entity_id": 7,
+ "entity_type": "Project",
+ "details": {
+ "change": "prevent merge request approval from reviewers",
+ "from": "",
+ "to": "true",
+ "author_name": "Administrator",
+ "target_id": 7,
+ "target_type": "Project",
+ "target_details": "twitter/typeahead-js",
+ "ip_address": "127.0.0.1",
+ "entity_path": "twitter/typeahead-js"
+ },
+ "created_at": "2020-05-26T22:55:04.230Z"
+ },
+ {
+ "id": 4,
+ "author_id": 1,
+ "entity_id": 7,
+ "entity_type": "Project",
+ "details": {
+ "change": "prevent merge request approval from authors",
+ "from": "false",
+ "to": "true",
+ "author_name": "Administrator",
+ "target_id": 7,
+ "target_type": "Project",
+ "target_details": "twitter/typeahead-js",
+ "ip_address": "127.0.0.1",
+ "entity_path": "twitter/typeahead-js"
+ },
+ "created_at": "2020-05-26T22:55:04.218Z"
+ }
+]
+```
+
+### Retrieve a specific project audit event
+
+Only available to project maintainers or owners.
+
+```plaintext
+GET /projects/:id/audit_events/:audit_event_id
+```
+
+| Attribute | Type | Required | Description |
+| --------- | ---- | -------- | ----------- |
+| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) |
+| `audit_event_id` | integer | yes | The ID of the audit event |
+
+```shell
+curl --header "PRIVATE-TOKEN: <your_access_token>" https://primary.example.com/api/v4/projects/7/audit_events/5
+```
+
+Example response:
+
+```json
+{
+ "id": 5,
+ "author_id": 1,
+ "entity_id": 7,
+ "entity_type": "Project",
+ "details": {
+ "change": "prevent merge request approval from reviewers",
+ "from": "",
+ "to": "true",
+ "author_name": "Administrator",
+ "target_id": 7,
+ "target_type": "Project",
+ "target_details": "twitter/typeahead-js",
+ "ip_address": "127.0.0.1",
+ "entity_path": "twitter/typeahead-js"
+ },
+ "created_at": "2020-05-26T22:55:04.230Z"
+}
+```