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
path: root/doc
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-09-26 12:06:04 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-26 12:06:04 +0300
commit759cd6c2985088d187ed519f2a881c2c690b34ec (patch)
tree183e291c0404bf9b3ac7638be6fa1fe94b7d2d14 /doc
parent9735395f94088df7e6470e3e8a2638385ede36b6 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc')
-rw-r--r--doc/api/api_resources.md1
-rw-r--r--doc/api/audit_events.md115
-rw-r--r--doc/api/environments.md14
3 files changed, 126 insertions, 4 deletions
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/environments.md b/doc/api/environments.md
index 26ee075c921..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"
}
```
@@ -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"
}
```