Commit 1cbc7c17 authored by Marcel Amirault's avatar Marcel Amirault

Merge branch 'docs-aqualls-20200227.1-api-blocks' into 'master'

Docs: language identifiers for code blocks

See merge request gitlab-org/gitlab!26111
parents dfa81327 49333624
......@@ -260,7 +260,7 @@ returned with status code `404`:
Example of a valid API call and a request using cURL with sudo request,
providing a username:
```
```plaintext
GET /projects?private_token=<your_access_token>&sudo=username
```
......@@ -271,7 +271,7 @@ curl --header "Private-Token: <your_access_token>" --header "Sudo: username" "ht
Example of a valid API call and a request using cURL with sudo request,
providing an ID:
```
```plaintext
GET /projects?private_token=<your_access_token>&sudo=23
```
......@@ -444,7 +444,7 @@ URL-encoded.
For example, `/` is represented by `%2F`:
```
```plaintext
GET /api/v4/projects/diaspora%2Fdiaspora
```
......@@ -460,7 +460,7 @@ URL-encoded.
For example, `/` is represented by `%2F`:
```
```plaintext
GET /api/v4/projects/1/branches/my%2Fbranch/commits
```
......@@ -604,13 +604,13 @@ to a [W3 recommendation](http://www.w3.org/Addressing/URL/4_URI_Recommentations.
causes a `+` to be interpreted as a space. For example, in an ISO 8601 date, you may want to pass
a time in Mountain Standard Time, such as:
```
```plaintext
2017-10-17T23:11:13.000+05:30
```
The correct encoding for the query parameter would be:
```
```plaintext
2017-10-17T23:11:13.000%2B05:30
```
......
......@@ -9,7 +9,7 @@ User will need at least maintainer access to use these endpoints.
Returns a list of project clusters.
```
```plaintext
GET /projects/:id/clusters
```
......@@ -368,7 +368,7 @@ Example response:
Deletes an existing project cluster.
```
```plaintext
DELETE /projects/:id/clusters/:cluster_id
```
......
......@@ -4,7 +4,7 @@
Get list of a project's variables.
```
```plaintext
GET /projects/:id/variables
```
......@@ -12,7 +12,7 @@ GET /projects/:id/variables
|-----------|---------|----------|---------------------|
| `id` | integer/string | yes | The ID of a project or [urlencoded NAMESPACE/PROJECT_NAME of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
```
```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/variables"
```
......@@ -35,7 +35,7 @@ curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/a
Get the details of a project's specific variable.
```
```plaintext
GET /projects/:id/variables/:key
```
......@@ -44,7 +44,7 @@ GET /projects/:id/variables/:key
| `id` | integer/string | yes | The ID of a project or [urlencoded NAMESPACE/PROJECT_NAME of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
| `key` | string | yes | The `key` of a variable |
```
```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/variables/TEST_VARIABLE_1"
```
......@@ -62,7 +62,7 @@ curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/a
Create a new variable.
```
```plaintext
POST /projects/:id/variables
```
......@@ -76,7 +76,7 @@ POST /projects/:id/variables
| `masked` | boolean | no | Whether the variable is masked |
| `environment_scope` | string | no | The `environment_scope` of the variable |
```
```shell
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/variables" --form "key=NEW_VARIABLE" --form "value=new value"
```
......@@ -95,7 +95,7 @@ curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitla
Update a project's variable.
```
```plaintext
PUT /projects/:id/variables/:key
```
......@@ -109,7 +109,7 @@ PUT /projects/:id/variables/:key
| `masked` | boolean | no | Whether the variable is masked |
| `environment_scope` | string | no | The `environment_scope` of the variable |
```
```shell
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/variables/NEW_VARIABLE" --form "value=updated value"
```
......@@ -128,7 +128,7 @@ curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab
Remove a project's variable.
```
```plaintext
DELETE /projects/:id/variables/:key
```
......@@ -137,6 +137,6 @@ DELETE /projects/:id/variables/:key
| `id` | integer/string | yes | The ID of a project or [urlencoded NAMESPACE/PROJECT_NAME of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
| `key` | string | yes | The `key` of a variable |
```
```shell
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/variables/VARIABLE_1"
```
......@@ -23,7 +23,7 @@ visibility setting keep this setting. You can read more about the change in the
Get a list of project snippets.
```
```plaintext
GET /projects/:id/snippets
```
......@@ -35,7 +35,7 @@ Parameters:
Get a single project snippet.
```
```plaintext
GET /projects/:id/snippets/:snippet_id
```
......@@ -68,7 +68,7 @@ Parameters:
Creates a new project snippet. The user must have permission to create new snippets.
```
```plaintext
POST /projects/:id/snippets
```
......@@ -106,7 +106,7 @@ curl --request POST https://gitlab.com/api/v4/projects/:id/snippets \
Updates an existing project snippet. The user must have permission to change an existing snippet.
```
```plaintext
PUT /projects/:id/snippets/:snippet_id
```
......@@ -145,7 +145,7 @@ curl --request PUT https://gitlab.com/api/v4/projects/:id/snippets/:snippet_id \
Deletes an existing project snippet. This returns a `204 No Content` status code if the operation was successfully or `404` if the resource was not found.
```
```plaintext
DELETE /projects/:id/snippets/:snippet_id
```
......@@ -165,7 +165,7 @@ curl --request DELETE https://gitlab.com/api/v4/projects/:id/snippets/:snippet_i
Returns the raw project snippet as plain text.
```
```plaintext
GET /projects/:id/snippets/:snippet_id/raw
```
......@@ -187,7 +187,7 @@ curl https://gitlab.com/api/v4/projects/:id/snippets/:snippet_id/raw \
Available only for admins.
```
```plaintext
GET /projects/:id/snippets/:snippet_id/user_agent_detail
```
......
......@@ -8,7 +8,7 @@ Retrieving the statistics requires write access to the repository.
Currently only HTTP fetches statistics are returned.
Fetches statistics includes both clones and pulls count and are HTTP only, SSH fetches are not included.
```
```plaintext
GET /projects/:id/statistics
```
......
......@@ -21,7 +21,7 @@ in GitLab 11.5
## Get all templates of a particular type
```
```plaintext
GET /projects/:id/templates/:type
```
......@@ -87,7 +87,7 @@ Example response (licenses):
## Get one template of a particular type
```
```plaintext
GET /projects/:id/templates/:type/:key
```
......@@ -106,7 +106,6 @@ Example response (Dockerfile):
"name": "Binary",
"content": "# This file is a template, and might need editing before it works on your project.\n# This Dockerfile installs a compiled binary into a bare system.\n# You must either commit your compiled binary into source control (not recommended)\n# or build the binary first as part of a CI/CD pipeline.\n\nFROM buildpack-deps:jessie\n\nWORKDIR /usr/local/bin\n\n# Change `app` to whatever your binary is called\nAdd app .\nCMD [\"./app\"]\n"
}
```
Example response (license):
......
......@@ -35,7 +35,7 @@ There are currently three options for `merge_method` to choose from:
Get a list of all visible projects across GitLab for the authenticated user.
When accessed without authentication, only public projects with "simple" fields are returned.
```
```plaintext
GET /projects
```
......@@ -298,7 +298,7 @@ the `approvals_before_merge` parameter:
You can filter by [custom attributes](custom_attributes.md) with:
```
```plaintext
GET /projects?custom_attributes[key]=value&custom_attributes[other_key]=other_value
```
......@@ -315,7 +315,7 @@ Note that keyset pagination only supports `order_by=id`. Other sorting options a
Get a list of visible projects owned by the given user. When accessed without authentication, only public projects are returned.
```
```plaintext
GET /users/:user_id/projects
```
......@@ -530,7 +530,7 @@ This endpoint supports [keyset pagination](README.md#keyset-based-pagination) fo
Get a list of visible projects owned by the given user. When accessed without authentication, only public projects are returned.
```
```plaintext
GET /users/:user_id/starred_projects
```
......@@ -740,7 +740,7 @@ Example response:
Get a specific project. This endpoint can be accessed without authentication if
the project is publicly accessible.
```
```plaintext
GET /projects/:id
```
......@@ -955,7 +955,7 @@ If the project is a fork, and you provide a valid token to authenticate, the
Get the users list of a project.
```
```plaintext
GET /projects/:id/users
```
......@@ -993,7 +993,7 @@ Please refer to the [Events API documentation](events.md#list-a-projects-visible
Creates a new project owned by the authenticated user.
```
```plaintext
POST /projects
```
......@@ -1061,7 +1061,7 @@ where `password` is a public access key with the `api` scope enabled.
Creates a new project owned by the specified user. Available only for admins.
```
```plaintext
POST /projects/user/:user_id
```
......@@ -1128,7 +1128,7 @@ where `password` is a public access key with the `api` scope enabled.
Updates an existing project.
```
```plaintext
PUT /projects/:id
```
......@@ -1200,7 +1200,7 @@ The forking operation for a project is asynchronous and is completed in a
background job. The request will return immediately. To determine whether the
fork of the project has completed, query the `import_status` for the new project.
```
```plaintext
POST /projects/:id/fork
```
......@@ -1217,7 +1217,7 @@ POST /projects/:id/fork
List the projects accessible to the calling user that have an established, forked relationship with the specified project
```
```plaintext
GET /projects/:id/forks
```
......@@ -1315,7 +1315,7 @@ Example responses:
Stars a given project. Returns status code `304` if the project is already starred.
```
```plaintext
POST /projects/:id/star
```
......@@ -1405,7 +1405,7 @@ Example response:
Unstars a given project. Returns status code `304` if the project is not starred.
```
```plaintext
POST /projects/:id/unstar
```
......@@ -1495,7 +1495,7 @@ Example response:
List the users who starred the specified project.
```
```plaintext
GET /projects/:id/starrers
```
......@@ -1540,7 +1540,7 @@ Example responses:
Get languages used in a project with percentage value.
```
```plaintext
GET /projects/:id/languages
```
......@@ -1564,7 +1564,7 @@ Example response:
Archives the project if the user is either admin or the project owner of this project. This action is
idempotent, thus archiving an already archived project will not change the project.
```
```plaintext
POST /projects/:id/archive
```
......@@ -1673,7 +1673,7 @@ Example response:
Unarchives the project if the user is either admin or the project owner of this project. This action is
idempotent, thus unarchiving a non-archived project will not change the project.
```
```plaintext
POST /projects/:id/unarchive
```
......@@ -1786,7 +1786,7 @@ This endpoint either:
deletion happens after number of days specified in
[instance settings](../user/admin_area/settings/visibility_and_access_controls.md#default-deletion-adjourned-period-premium-only).
```
```plaintext
DELETE /projects/:id
```
......@@ -1800,7 +1800,7 @@ DELETE /projects/:id
Restores project marked for deletion.
```
```plaintext
POST /projects/:id/restore
```
......@@ -1812,7 +1812,7 @@ POST /projects/:id/restore
Uploads a file to the specified project to be used in an issue or merge request description, or a comment.
```
```plaintext
POST /projects/:id/uploads
```
......@@ -1848,7 +1848,7 @@ In Markdown contexts, the link is automatically expanded when the format in
Allow to share project with group.
```
```plaintext
POST /projects/:id/share
```
......@@ -1863,7 +1863,7 @@ POST /projects/:id/share
Unshare the project from the group. Returns `204` and no content on success.
```
```plaintext
DELETE /projects/:id/share/:group_id
```
......@@ -1885,7 +1885,7 @@ These are different for [System Hooks](system_hooks.md) that are system wide.
Get a list of project hooks.
```
```plaintext
GET /projects/:id/hooks
```
......@@ -1897,7 +1897,7 @@ GET /projects/:id/hooks
Get a specific hook for a project.
```
```plaintext
GET /projects/:id/hooks/:hook_id
```
......@@ -1930,7 +1930,7 @@ GET /projects/:id/hooks/:hook_id
Adds a hook to a specified project.
```
```plaintext
POST /projects/:id/hooks
```
......@@ -1955,7 +1955,7 @@ POST /projects/:id/hooks
Edits a hook for a specified project.
```
```plaintext
PUT /projects/:id/hooks/:hook_id
```
......@@ -1982,7 +1982,7 @@ PUT /projects/:id/hooks/:hook_id
Removes a hook from a project. This is an idempotent method and can be called multiple times.
Either the hook is available or not.
```
```plaintext
DELETE /projects/:id/hooks/:hook_id
```
......@@ -2000,7 +2000,7 @@ Allows modification of the forked relationship between existing projects. Availa
### Create a forked from/to relation between existing projects
```
```plaintext
POST /projects/:id/fork/:forked_from_id
```
......@@ -2011,7 +2011,7 @@ POST /projects/:id/fork/:forked_from_id
### Delete an existing forked from relationship
```
```plaintext
DELETE /projects/:id/fork
```
......@@ -2025,7 +2025,7 @@ Search for projects by name which are accessible to the authenticated user. This
endpoint can be accessed without authentication if the project is publicly
accessible.
```
```plaintext
GET /projects
```
......@@ -2043,7 +2043,7 @@ curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/ap
> Introduced in GitLab 9.0.
```
```plaintext
POST /projects/:id/housekeeping
```
......@@ -2057,7 +2057,7 @@ POST /projects/:id/housekeeping
Get the push rules of a project.
```
```plaintext
GET /projects/:id/push_rule
```
......@@ -2101,7 +2101,7 @@ the `commit_committer_check` and `reject_unsigned_commits` parameters:
Adds a push rule to a specified project.
```
```plaintext
POST /projects/:id/push_rule
```
......@@ -2124,7 +2124,7 @@ POST /projects/:id/push_rule
Edits a push rule for a specified project.
```
```plaintext
PUT /projects/:id/push_rule
```
......@@ -2150,7 +2150,7 @@ PUT /projects/:id/push_rule
Removes a push rule from a project. This is an idempotent method and can be called multiple times.
Either the push rule is available or not.
```
```plaintext
DELETE /projects/:id/push_rule
```
......@@ -2162,7 +2162,7 @@ DELETE /projects/:id/push_rule
> Introduced in GitLab 11.1.
```
```plaintext
PUT /projects/:id/transfer
```
......@@ -2186,7 +2186,7 @@ Read more in the [Project members](members.md) documentation.
> Introduced in [GitLab Starter](https://about.gitlab.com/pricing/) 10.3.
```
```plaintext
POST /projects/:id/mirror/pull
```
......@@ -2219,7 +2219,7 @@ format.
If a repository is corrupted to the point where `git clone` does not work, the
snapshot may allow some of the data to be retrieved.
```
```plaintext
GET /projects/:id/snapshot
```
......
......@@ -6,7 +6,7 @@
The access levels are defined in the `ProtectedRefAccess.allowed_access_levels` method. Currently, these levels are recognized:
```
```plaintext
0 => No access
30 => Developer access
40 => Maintainer access
......@@ -17,7 +17,7 @@ The access levels are defined in the `ProtectedRefAccess.allowed_access_levels`
Gets a list of protected branches from a project.
```
```plaintext
GET /projects/:id/protected_branches
```
......@@ -91,7 +91,7 @@ Example response:
Gets a single protected branch or wildcard protected branch.
```
```plaintext
GET /projects/:id/protected_branches/:name
```
......@@ -160,7 +160,7 @@ Example response:
Protects a single repository branch or several project repository
branches using a wildcard protected branch.
```
```plaintext
POST /projects/:id/protected_branches
```
......@@ -292,7 +292,7 @@ Example response:
Unprotects the given protected branch or wildcard protected branch.
```
```plaintext
DELETE /projects/:id/protected_branches/:name
```
......@@ -309,7 +309,7 @@ curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" 'https://git
Update the "code owner approval required" option for the given protected branch protected branch.
```
```plaintext
PATCH /projects/:id/protected_branches/:name
```
......
......@@ -7,7 +7,7 @@
The access levels are defined in the `ProtectedEnvironment::DeployAccessLevel::ALLOWED_ACCESS_LEVELS` method.
Currently, these levels are recognized:
```
```plaintext
30 => Developer access
40 => Maintainer access
60 => Admin access
......
......@@ -6,7 +6,7 @@
Currently, these levels are recognized:
```
```plaintext
0 => No access
30 => Developer access
40 => Maintainer access
......@@ -17,7 +17,7 @@ Currently, these levels are recognized:
Gets a list of protected tags from a project.
This function takes pagination parameters `page` and `per_page` to restrict the list of protected tags.
```
```plaintext
GET /projects/:id/protected_tags
```
......@@ -51,7 +51,7 @@ Example response:
Gets a single protected tag or wildcard protected tag.
The pagination parameters `page` and `per_page` can be used to restrict the list of protected tags.
```
```plaintext
GET /projects/:id/protected_tags/:name
```
......@@ -83,7 +83,7 @@ Example response:
Protects a single repository tag or several project repository
tags using a wildcard protected tag.
```
```plaintext
POST /projects/:id/protected_tags
```
......@@ -115,7 +115,7 @@ Example response:
Unprotects the given protected tag or wildcard protected tag.
```
```plaintext
DELETE /projects/:id/protected_tags/:name
```
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment