Commit d3527863 authored by Marcel Amirault's avatar Marcel Amirault

Merge branch 'docs-aqualls-20200226.1-codeblocks' into 'master'

Docs: Update API code blocks

See merge request gitlab-org/gitlab!26017
parents 11e45172 73a2f0a7
......@@ -4,7 +4,7 @@
Get all environments for a given project.
```
```plaintext
GET /projects/:id/environments
```
......@@ -34,7 +34,7 @@ Example response:
## Get a specific environment
```
```plaintext
GET /projects/:id/environments/:environment_id
```
......@@ -145,7 +145,7 @@ Creates a new environment with the given name and external_url.
It returns `201` if the environment was successfully created, `400` for wrong parameters.
```
```plaintext
POST /projects/:id/environments
```
......@@ -177,7 +177,7 @@ Updates an existing environment's name and/or external_url.
It returns `200` if the environment was successfully updated. In case of an error, a status code `400` is returned.
```
```plaintext
PUT /projects/:id/environments/:environments_id
```
......@@ -208,7 +208,7 @@ Example response:
It returns `204` if the environment was successfully deleted, and `404` if the environment does not exist.
```
```plaintext
DELETE /projects/:id/environments/:environment_id
```
......@@ -225,7 +225,7 @@ curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://git
It returns `200` if the environment was successfully stopped, and `404` if the environment does not exist.
```
```plaintext
POST /projects/:id/environments/:environment_id/stop
```
......
......@@ -10,7 +10,7 @@ Epics are available only in Ultimate. If epics feature is not available a `403`
Gets all issues that are assigned to an epic and the authenticated user has access to.
```
```plaintext
GET /groups/:id/epics/:epic_iid/issues
```
......@@ -106,7 +106,7 @@ Example response:
Creates an epic - issue association. If the issue in question belongs to another epic it is unassigned from that epic.
```
```plaintext
POST /groups/:id/epics/:epic_iid/issues/:issue_id
```
......@@ -212,7 +212,7 @@ Example response:
Removes an epic - issue association.
```
```plaintext
DELETE /groups/:id/epics/:epic_iid/issues/:epic_issue_id
```
......@@ -318,7 +318,7 @@ Example response:
Updates an epic - issue association.
```
```plaintext
PUT /groups/:id/epics/:epic_iid/issues/:epic_issue_id
```
......
......@@ -41,7 +41,7 @@ NOTE: **Note**
Gets all epics of the requested group and its subgroups.
```
```plaintext
GET /groups/:id/epics
GET /groups/:id/epics?author_id=5
GET /groups/:id/epics?labels=bug,reproduced
......@@ -160,7 +160,7 @@ Example response:
Gets a single epic
```
```plaintext
GET /groups/:id/epics/:epic_iid
```
......@@ -228,7 +228,7 @@ Starting with GitLab [11.3][ee-6448], `start_date` and `end_date` should no long
directly, as they now represent composite values. You can configure it via the `*_is_fixed` and
`*_fixed` fields instead.
```
```plaintext
POST /groups/:id/epics
```
......@@ -302,7 +302,7 @@ Starting with GitLab [11.3][ee-6448], `start_date` and `end_date` should no long
directly, as they now represent composite values. You can configure it via the `*_is_fixed` and
`*_fixed` fields instead.
```
```plaintext
PUT /groups/:id/epics/:epic_iid
```
......@@ -372,7 +372,7 @@ Example response:
Deletes an epic
```
```plaintext
DELETE /groups/:id/epics/:epic_iid
```
......@@ -391,7 +391,7 @@ Manually creates a todo for the current user on an epic. If
there already exists a todo for the user on that epic, status code `304` is
returned.
```
```plaintext
POST /groups/:id/epics/:epic_iid/todo
```
......
......@@ -8,7 +8,7 @@ The project settings API allows you to retrieve the Error Tracking settings for
### Get Error Tracking settings
```
```plaintext
GET /projects/:id/error_tracking/settings
```
......@@ -35,7 +35,7 @@ Example response:
The API allows you to enable or disable the Error Tracking settings for a project. Only for project maintainers.
```
```plaintext
PATCH /projects/:id/error_tracking/settings
```
......
......@@ -38,7 +38,7 @@ Note that these options are downcased.
Dates for the `before` and `after` parameters should be supplied in the following format:
```
```plaintext
YYYY-MM-DD
```
......@@ -54,7 +54,7 @@ GitLab removes events older than 2 years from the events table for performance r
Get a list of events for the authenticated user. Scope `read_user` or `api` is required.
```
```plaintext
GET /events
```
......@@ -128,7 +128,7 @@ Example response:
Get the contribution events for the specified user, sorted from newest to oldest. Scope `read_user` or `api` is required.
```
```plaintext
GET /users/:id/events
```
......@@ -259,7 +259,7 @@ Example response:
Get a list of visible events for a particular project.
```
```plaintext
GET /projects/:project_id/events
```
......
......@@ -16,7 +16,7 @@ For instance, there are two specs, `staging` and `production`, for a feature fla
When you pass `production` as a parameter to this endpoint, the system returns
the `production` feature flag spec only.
```
```plaintext
GET /projects/:id/feature_flag_scopes
```
......@@ -84,7 +84,7 @@ Example response:
Get all specs of a feature flag.
```
```plaintext
GET /projects/:id/feature_flags/:name/scopes
```
......@@ -147,7 +147,7 @@ Example response:
Creates a new feature flag spec.
```
```plaintext
POST /projects/:id/feature_flags/:name/scopes
```
......@@ -194,7 +194,7 @@ Example response:
Gets a single feature flag spec.
```
```plaintext
GET /projects/:id/feature_flags/:name/scopes/:environment_scope
```
......@@ -230,7 +230,7 @@ Example response:
Updates an existing feature flag spec.
```
```plaintext
PUT /projects/:id/feature_flags/:name/scopes/:environment_scope
```
......@@ -276,7 +276,7 @@ Example response:
Deletes a feature flag spec.
```
```plaintext
DELETE /projects/:id/feature_flags/:name/scopes/:environment_scope
```
......
......@@ -9,7 +9,7 @@ values.
Get a list of all persisted features, with its gate values.
```
```plaintext
GET /features
```
......@@ -50,7 +50,7 @@ Set a feature's gate value. If a feature with the given name doesn't exist yet
it will be created. The value can be a boolean, or an integer to indicate
percentage of time.
```
```plaintext
POST /features/:name
```
......@@ -93,6 +93,6 @@ Example response:
Removes a feature gate. Response is equal when the gate exists, or doesn't.
```
```plaintext
DELETE /features/:name
```
......@@ -7,7 +7,7 @@ as an admin.
Creates a new Geo node.
```
```plaintext
POST /geo_nodes
```
......@@ -68,7 +68,7 @@ Example response:
## Retrieve configuration about all Geo nodes
```
```plaintext
GET /geo_nodes
```
......@@ -135,7 +135,7 @@ Example response:
## Retrieve configuration about a specific Geo node
```
```plaintext
GET /geo_nodes/:id
```
......@@ -178,7 +178,7 @@ Updates settings of an existing Geo node.
_This can only be run against a primary Geo node._
```
```plaintext
PUT /geo_nodes/:id
```
......@@ -237,7 +237,7 @@ Removes the Geo node.
NOTE: **Note:**
Only a Geo primary node will accept this request.
```
```plaintext
DELETE /geo_nodes/:id
```
......@@ -251,7 +251,7 @@ To repair the OAuth authentication of a Geo node.
_This can only be run against a primary Geo node._
```
```plaintext
POST /geo_nodes/:id/repair
```
......@@ -282,7 +282,7 @@ Example response:
## Retrieve status about all Geo nodes
```
```plaintext
GET /geo_nodes/status
```
......@@ -441,7 +441,7 @@ In GitLab 12.0, deprecated fields `wikis_count` and `repositories_count` were re
## Retrieve status about a specific Geo node
```
```plaintext
GET /geo_nodes/:id/status
```
......@@ -512,7 +512,7 @@ In GitLab 12.0, deprecated fields `wikis_count` and `repositories_count` were re
This only works on a secondary node.
```
```plaintext
GET /geo_nodes/current/failures
```
......
......@@ -19,7 +19,7 @@ from the first group's project by creation date. If the group hasn't got any pro
Gets a list of a group's badges.
```
```plaintext
GET /groups/:id/badges
```
......@@ -52,7 +52,7 @@ Example response:
Gets a badge of a group.
```
```plaintext
GET /groups/:id/badges/:badge_id
```
......@@ -82,7 +82,7 @@ Example response:
Adds a badge to a group.
```
```plaintext
POST /groups/:id/badges
```
......@@ -113,7 +113,7 @@ Example response:
Updates a badge of a group.
```
```plaintext
PUT /groups/:id/badges/:badge_id
```
......@@ -145,7 +145,7 @@ Example response:
Removes a badge from a group.
```
```plaintext
DELETE /groups/:id/badges/:badge_id
```
......@@ -162,7 +162,7 @@ curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitl
Returns how the `link_url` and `image_url` final URLs would be after resolving the placeholder interpolation.
```
```plaintext
GET /groups/:id/badges/render
```
......
......@@ -9,7 +9,7 @@ request will result in `404` status code.
Lists Issue Boards in the given group.
```
```plaintext
GET /groups/:id/boards
```
......@@ -126,7 +126,7 @@ Example response:
Gets a single group issue board.
```
```plaintext
GET /groups/:id/boards/:board_id
```
......@@ -240,7 +240,7 @@ Example response:
Creates a Group Issue Board.
```
```plaintext
POST /groups/:id/boards
```
......@@ -306,7 +306,7 @@ Example response:
Updates a Group Issue Board.
```
```plaintext
PUT /groups/:id/boards/:board_id
```
......@@ -372,7 +372,7 @@ Example response:
Deletes a Group Issue Board.
```
```plaintext
DELETE /groups/:id/boards/:board_id
```
......@@ -390,7 +390,7 @@ curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitl
Get a list of the board's lists.
Does not include `open` and `closed` lists
```
```plaintext
GET /groups/:id/boards/:board_id/lists
```
......@@ -441,7 +441,7 @@ Example response:
Get a single board list.
```
```plaintext
GET /groups/:id/boards/:board_id/lists/:list_id
```
......@@ -473,7 +473,7 @@ Example response:
Creates a new Issue Board list.
```
```plaintext
POST /groups/:id/boards/:board_id/lists
```
......@@ -514,7 +514,7 @@ Example response:
Updates an existing Issue Board list. This call is used to change list position.
```
```plaintext
PUT /groups/:id/boards/:board_id/lists/:list_id
```
......@@ -547,7 +547,7 @@ Example response:
Only for admins and group owners. Deletes the board list in question.
```
```plaintext
DELETE /groups/:id/boards/:board_id/lists/:list_id
```
......
......@@ -10,7 +10,7 @@ User will need at least maintainer access for the group to use these endpoints.
Returns a list of group clusters.
```
```plaintext
GET /groups/:id/clusters
```
......@@ -77,7 +77,7 @@ Example response:
Gets a single group cluster.
```
```plaintext
GET /groups/:id/clusters/:cluster_id
```
......@@ -144,7 +144,7 @@ Example response:
Adds an existing Kubernetes cluster to the group.
```
```plaintext
POST /groups/:id/clusters/user
```
......@@ -213,7 +213,7 @@ Example response:
Updates an existing group cluster.
```
```plaintext
PUT /groups/:id/clusters/:cluster_id
```
......@@ -287,14 +287,13 @@ Example response:
"web_url":"https://gitlab.example.com/group-with-clusters-api"
}
}
```
## Delete group cluster
Deletes an existing group cluster.
```
```plaintext
DELETE /groups/:id/clusters/:cluster_id
```
......
......@@ -19,7 +19,7 @@ Group exports include the following:
Start a new group export.
```text
```plaintext
POST /groups/:id/export
```
......
......@@ -11,7 +11,7 @@ The `description_html` - was added to response JSON in [GitLab 12.7](https://git
Get all labels for a given group.
```
```plaintext
GET /groups/:id/labels
```
......@@ -60,7 +60,7 @@ Example response:
Get a single label for a given group.
```
```plaintext
GET /groups/:id/labels/:label_id
```
......@@ -95,7 +95,7 @@ Example response:
Create a new group label for a given group.
```
```plaintext
POST /groups/:id/labels
```
......@@ -131,7 +131,7 @@ Example response:
Updates an existing group label. At least one parameter is required, to update the group label.
```
```plaintext
PUT /groups/:id/labels/:label_id
```
......@@ -170,7 +170,7 @@ NOTE: **Note:** An older endpoint `PUT /groups/:id/labels` with `name` in the pa
Deletes a group label with a given name.
```
```plaintext
DELETE /groups/:id/labels/:label_id
```
......@@ -190,7 +190,7 @@ NOTE: **Note:** An older endpoint `DELETE /groups/:id/labels` with `name` in the
Subscribes the authenticated user to a group label to receive notifications. If
the user is already subscribed to the label, the status code `304` is returned.
```
```plaintext
POST /groups/:id/labels/:label_id/subscribe
```
......@@ -226,7 +226,7 @@ Unsubscribes the authenticated user from a group label to not receive
notifications from it. If the user is not subscribed to the label, the status
code `304` is returned.
```
```plaintext
POST /groups/:id/labels/:label_id/unsubscribe
```
......
......@@ -6,7 +6,7 @@
Get list of a group's variables.
```
```plaintext
GET /groups/:id/variables
```
......@@ -14,7 +14,7 @@ GET /groups/:id/variables
|-----------|---------|----------|---------------------|
| `id` | integer/string | yes | The ID of a group or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user |
```
```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/1/variables"
```
......@@ -41,7 +41,7 @@ curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/a
Get the details of a group's specific variable.
```
```plaintext
GET /groups/:id/variables/:key
```
......@@ -50,7 +50,7 @@ GET /groups/:id/variables/:key
| `id` | integer/string | yes | The ID of a group or [URL-encoded path of the group](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/groups/1/variables/TEST_VARIABLE_1"
```
......@@ -68,7 +68,7 @@ curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/a
Create a new variable.
```
```plaintext
POST /groups/:id/variables
```
......@@ -81,7 +81,7 @@ POST /groups/:id/variables
| `protected` | boolean | no | Whether the variable is protected |
| `masked` | boolean | no | Whether the variable is masked |
```
```shell
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/1/variables" --form "key=NEW_VARIABLE" --form "value=new value"
```
......@@ -99,7 +99,7 @@ curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitla
Update a group's variable.
```
```plaintext
PUT /groups/:id/variables/:key
```
......@@ -112,7 +112,7 @@ PUT /groups/:id/variables/:key
| `protected` | boolean | no | Whether the variable is protected |
| `masked` | boolean | no | Whether the variable is masked |
```
```shell
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/1/variables/NEW_VARIABLE" --form "value=updated value"
```
......@@ -130,7 +130,7 @@ curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab
Remove a group's variable.
```
```plaintext
DELETE /groups/:id/variables/:key
```
......@@ -139,7 +139,7 @@ DELETE /groups/:id/variables/:key
| `id` | integer/string | yes | The ID of a group or [URL-encoded path of the group](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/groups/1/variables/VARIABLE_1"
```
......
......@@ -6,7 +6,7 @@
Returns a list of group milestones.
```
```plaintext
GET /groups/:id/milestones
GET /groups/:id/milestones?iids[]=42
GET /groups/:id/milestones?iids[]=42&iids[]=43
......@@ -53,7 +53,7 @@ Example Response:
Gets a single group milestone.
```
```plaintext
GET /groups/:id/milestones/:milestone_id
```
......@@ -66,7 +66,7 @@ Parameters:
Creates a new group milestone.
```
```plaintext
POST /groups/:id/milestones
```
......@@ -82,7 +82,7 @@ Parameters:
Updates an existing group milestone.
```
```plaintext
PUT /groups/:id/milestones/:milestone_id
```
......@@ -100,7 +100,7 @@ Parameters:
Only for users with Developer access to the group.
```
```plaintext
DELETE /groups/:id/milestones/:milestone_id
```
......@@ -113,7 +113,7 @@ Parameters:
Gets all issues assigned to a single group milestone.
```
```plaintext
GET /groups/:id/milestones/:milestone_id/issues
```
......@@ -126,7 +126,7 @@ Parameters:
Gets all merge requests assigned to a single group milestone.
```
```plaintext
GET /groups/:id/milestones/:milestone_id/merge_requests
```
......@@ -143,7 +143,7 @@ Parameters:
Get all burndown chart events for a single milestone.
```
```plaintext
GET /groups/:id/milestones/:milestone_id/burndown_events
```
......
......@@ -21,7 +21,7 @@ Parameters:
| `owned` | boolean | no | Limit to groups explicitly owned by the current user |
| `min_access_level` | integer | no | Limit to groups where current user has at least this [access level](members.md) |
```
```plaintext
GET /groups
```
......@@ -55,7 +55,7 @@ GET /groups
When adding the parameter `statistics=true` and the authenticated user is an admin, additional group statistics are returned.
```
```plaintext
GET /groups?statistics=true
```
......@@ -99,7 +99,7 @@ You can search for groups by name or path, see below.
You can filter by [custom attributes](custom_attributes.md) with:
```
```plaintext
GET /groups?custom_attributes[key]=value&custom_attributes[other_key]=other_value
```
......@@ -127,7 +127,7 @@ Parameters:
| `owned` | boolean | no | Limit to groups explicitly owned by the current user |
| `min_access_level` | integer | no | Limit to groups where current user has at least this [access level](members.md) |
```
```plaintext
GET /groups/:id/subgroups
```
......@@ -165,7 +165,7 @@ Get a list of projects in this group. When accessed without authentication, only
By default, this request returns 20 results at a time because the API results [are paginated](README.md#pagination).
```
```plaintext
GET /groups/:id/projects
```
......@@ -239,7 +239,7 @@ Example response:
Get all details of a group. This endpoint can be accessed without authentication
if the group is publicly accessible. In case the user that requests is admin of the group, it will return the `runners_token` for the group too.
```
```plaintext
GET /groups/:id
```
......@@ -470,7 +470,7 @@ Feature.disable(:limit_projects_in_groups_api)
Creates a new project group. Available only for users who can create groups.
```
```plaintext
POST /groups
```
......@@ -500,7 +500,7 @@ Parameters:
Transfer a project to the Group namespace. Available only to instance administrators, although an [alternative API endpoint](projects.md#transfer-a-project-to-a-new-namespace) is available which does not require instance administrator access. Transferring projects may fail when tagged packages exist in the project's repository.
```
```plaintext
POST /groups/:id/projects/:project_id
```
......@@ -519,7 +519,7 @@ curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab
Updates the project group. Only available to group owners and administrators.
```
```plaintext
PUT /groups/:id
```
......@@ -548,7 +548,6 @@ PUT /groups/:id
```shell
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5?name=Experimental"
```
This endpoint returns:
......@@ -639,7 +638,7 @@ This endpoint either:
- Removes group, and queues a background job to delete all projects in the group as well.
- Since [GitLab 12.8](https://gitlab.com/gitlab-org/gitlab/issues/33257), on [Premium or Silver](https://about.gitlab.com/pricing/) or higher tiers, marks a group for deletion. The deletion will happen 7 days later by default, but this can be changed in the [instance settings](../user/admin_area/settings/visibility_and_access_controls.md#default-deletion-adjourned-period-premium-only).
```
```plaintext
DELETE /groups/:id
```
......@@ -671,7 +670,7 @@ Parameters:
Get all groups that match your string in their name or path.
```
```plaintext
GET /groups?search=foobar
```
......@@ -695,7 +694,7 @@ These are different from [System Hooks](system_hooks.md) that are system wide an
Get a list of group hooks
```
```plaintext
GET /groups/:id/hooks
```
......@@ -712,7 +711,7 @@ Get a specific hook for a group.
| `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) |
| `hook_id` | integer | yes | The ID of a group hook |
```
```plaintext
GET /groups/:id/hooks/:hook_id
```
......@@ -739,7 +738,7 @@ GET /groups/:id/hooks/:hook_id
Adds a hook to a specified group.
```
```plaintext
POST /groups/:id/hooks
```
......@@ -763,7 +762,7 @@ POST /groups/:id/hooks
Edits a hook for a specified group.
```
```plaintext
PUT /groups/:id/hooks/:hook_id
```
......@@ -789,7 +788,7 @@ PUT /groups/:id/hooks/:hook_id
Removes a hook from a group. This is an idempotent method and can be called multiple times.
Either the hook is available or not.
```
```plaintext
DELETE /groups/:id/hooks/:hook_id
```
......@@ -806,7 +805,7 @@ Group audit events can be accessed via the [Group Audit Events API](audit_events
Syncs the group with its linked LDAP group. Only available to group owners and administrators.
```
```plaintext
POST /groups/:id/ldap_sync
```
......@@ -826,7 +825,7 @@ List, add, and delete LDAP group links.
Lists LDAP group links.
```
```plaintext
GET /groups/:id/ldap_group_links
```
......@@ -838,7 +837,7 @@ Parameters:
Adds an LDAP group link.
```
```plaintext
POST /groups/:id/ldap_group_links
```
......@@ -853,7 +852,7 @@ Parameters:
Deletes an LDAP group link.
```
```plaintext
DELETE /groups/:id/ldap_group_links/:cn
```
......@@ -864,7 +863,7 @@ Parameters:
Deletes a LDAP group link for a specific LDAP provider
```
```plaintext
DELETE /groups/:id/ldap_group_links/:provider/:cn
```
......@@ -880,13 +879,13 @@ By default, groups only get 20 namespaces at a time because the API results are
To get more (up to 100), pass the following as an argument to the API call:
```
```plaintext
/groups?per_page=100
```
And to switch pages add:
```
```plaintext
/groups?per_page=100&page=2
```
......
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