Skip to content

Commit fb6e59e

Browse files
ereadaxilleas
authored andcommitted
Refactor of API landing page
- Breaks up into more sections. - Also minor fixes to pages within sections.
1 parent 2a5de7e commit fb6e59e

File tree

7 files changed

+150
-111
lines changed

7 files changed

+150
-111
lines changed

doc/api/README.md

Lines changed: 122 additions & 83 deletions
Large diffs are not rendered by default.

doc/api/lint.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> [Introduced][ce-5953] in GitLab 8.12.
44
5-
Checks if your .gitlab-ci.yml file is valid.
5+
Checks if your `.gitlab-ci.yml` file is valid.
66

77
```
88
POST /lint

doc/api/pages_domains.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The GitLab Pages feature must be enabled to use these endpoints. Find out more a
88

99
Get a list of all pages domains. The user must have admin permissions.
1010

11-
```http
11+
```text
1212
GET /pages/domains
1313
```
1414

@@ -34,7 +34,7 @@ curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/ap
3434

3535
Get a list of project pages domains. The user must have permissions to view pages domains.
3636

37-
```http
37+
```text
3838
GET /projects/:id/pages/domains
3939
```
4040

@@ -69,7 +69,7 @@ curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/ap
6969

7070
Get a single project pages domain. The user must have permissions to view pages domains.
7171

72-
```http
72+
```text
7373
GET /projects/:id/pages/domains/:domain
7474
```
7575

@@ -110,7 +110,7 @@ curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/ap
110110

111111
Creates a new pages domain. The user must have permissions to create new pages domains.
112112

113-
```http
113+
```text
114114
POST /projects/:id/pages/domains
115115
```
116116

@@ -146,7 +146,7 @@ curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --form "domain
146146

147147
Updates an existing project pages domain. The user must have permissions to change an existing pages domains.
148148

149-
```http
149+
```text
150150
PUT /projects/:id/pages/domains/:domain
151151
```
152152

@@ -182,7 +182,7 @@ curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" --form "certifi
182182

183183
Deletes an existing project pages domain.
184184

185-
```http
185+
```text
186186
DELETE /projects/:id/pages/domains/:domain
187187
```
188188

doc/api/project_import_export.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Project import/export API
22

3-
[Introduced][ce-41899] in GitLab 10.6
3+
> [Introduced][ce-41899] in GitLab 10.6.
44
5-
[See also the project import/export documentation](../user/project/settings/import_export.md)
5+
See also the [project import/export documentation](../user/project/settings/import_export.md).
66

77
## Schedule an export
88

@@ -16,7 +16,7 @@ data file uploads to the final server.
1616
If the `upload` params is present, `upload[url]` param is required.
1717
(**Note:** This feature was introduced in GitLab 10.7)
1818

19-
```http
19+
```text
2020
POST /projects/:id/export
2121
```
2222

@@ -28,8 +28,7 @@ POST /projects/:id/export
2828
| `upload[url]` | string | yes | The URL to upload the project |
2929
| `upload[http_method]` | string | no | The HTTP method to upload the exported project. Only `PUT` and `POST` methods allowed. Default is `PUT` |
3030

31-
32-
```console
31+
```sh
3332
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/export \
3433
--data "upload[http_method]=PUT" \
3534
--data-urlencode "upload[url]=https://example-bucket.s3.eu-west-3.amazonaws.com/backup?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIMBJHN2O62W8IELQ%2F20180312%2Feu-west-3%2Fs3%2Faws4_request&X-Amz-Date=20180312T110328Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host&X-Amz-Signature=8413facb20ff33a49a147a0b4abcff4c8487cc33ee1f7e450c46e8f695569dbd"
@@ -45,15 +44,15 @@ curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab
4544

4645
Get the status of export.
4746

48-
```http
47+
```text
4948
GET /projects/:id/export
5049
```
5150

5251
| Attribute | Type | Required | Description |
5352
| --------- | -------------- | -------- | ---------------------------------------- |
5453
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
5554

56-
```console
55+
```sh
5756
curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/export
5857
```
5958

@@ -86,26 +85,26 @@ to a web server, etc.
8685

8786
Download the finished export.
8887

89-
```http
88+
```text
9089
GET /projects/:id/export/download
9190
```
9291

9392
| Attribute | Type | Required | Description |
9493
| --------- | -------------- | -------- | ---------------------------------------- |
9594
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
9695

97-
```console
96+
```sh
9897
curl --header "PRIVATE-TOKEN: <your_access_token>" --remote-header-name --remote-name https://gitlab.example.com/api/v4/projects/5/export/download
9998
```
10099

101-
```console
100+
```sh
102101
ls *export.tar.gz
103102
2017-12-05_22-11-148_namespace_project_export.tar.gz
104103
```
105104

106105
## Import a file
107106

108-
```http
107+
```text
109108
POST /projects/import
110109
```
111110

@@ -124,7 +123,7 @@ cURL to post data using the header `Content-Type: multipart/form-data`.
124123
The `file=` parameter must point to a file on your file system and be preceded
125124
by `@`. For example:
126125

127-
```console
126+
```sh
128127
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --form "path=api-project" --form "file=@/path/to/file" https://gitlab.example.com/api/v4/projects/import
129128
```
130129

@@ -168,15 +167,15 @@ requests.post(url, headers=headers, data=data, files=files)
168167

169168
Get the status of an import.
170169

171-
```http
170+
```text
172171
GET /projects/:id/import
173172
```
174173

175174
| Attribute | Type | Required | Description |
176175
| --------- | -------------- | -------- | ---------------------------------------- |
177176
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
178177

179-
```console
178+
```sh
180179
curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/import
181180
```
182181

doc/api/protected_branches.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
**Valid access levels**
66

77
The access levels are defined in the `ProtectedRefAccess.allowed_access_levels` method. Currently, these levels are recognized:
8+
89
```
910
0 => No access
1011
30 => Developer access

doc/api/releases/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> - [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/issues/41766) in GitLab 11.7.
44
> - Using this API you can manipulate GitLab's [Release](../../user/project/releases/index.md) entries.
5-
> - For manipulating links as a release asset, see [Release Links API](links.md)
5+
> - For manipulating links as a release asset, see [Release Links API](links.md).
66
77
## List Releases
88

doc/api/templates/gitignores.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Gitignores API
1+
# `.gitignore` API
22

3-
## List gitignore templates
3+
## List `.gitignore` templates
44

5-
Get all gitignore templates.
5+
Get all `.gitignore` templates.
66

77
```
88
GET /templates/gitignores
@@ -99,17 +99,17 @@ Example response:
9999
]
100100
```
101101

102-
## Single gitignore template
102+
## Single `.gitignore` template
103103

104-
Get a single gitignore template.
104+
Get a single `.gitignore` template.
105105

106106
```
107107
GET /templates/gitignores/:key
108108
```
109109

110110
| Attribute | Type | Required | Description |
111111
| ---------- | ------ | -------- | ----------- |
112-
| `key` | string | yes | The key of the gitignore template |
112+
| `key` | string | yes | The key of the `.gitignore` template |
113113

114114
```bash
115115
curl https://gitlab.example.com/api/v4/templates/gitignores/Ruby

0 commit comments

Comments
 (0)