diff options
Diffstat (limited to 'doc/api')
89 files changed, 500 insertions, 508 deletions
diff --git a/doc/api/README.md b/doc/api/README.md index ef3b578f04e..30e1f1ed79c 100644 --- a/doc/api/README.md +++ b/doc/api/README.md @@ -335,7 +335,7 @@ resources you can pass the following parameters: In the example below, we list 50 [namespaces](namespaces.md) per page. -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/namespaces?per_page=50" ``` @@ -349,7 +349,7 @@ In the cURL example below, we limit the output to 3 items per page (`per_page=3` and we request the second page (`page=2`) of [comments](notes.md) of the issue with ID `8` which belongs to the project with ID `8`: -```bash +```shell curl --head --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/8/issues/8/notes?per_page=3&page=2 ``` @@ -409,7 +409,7 @@ This method is controlled by the following parameters: In the example below, we list 50 [projects](projects.md) per page, ordered by `id` ascending. -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects?pagination=keyset&per_page=50&order_by=id&sort=asc" ``` @@ -472,7 +472,7 @@ We can call the API with `array` and `hash` types parameters as shown below: `import_sources` is a parameter of type `array`: -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \ -d "import_sources[]=github" \ -d "import_sources[]=bitbucket" \ @@ -483,7 +483,7 @@ https://gitlab.example.com/api/v4/some_endpoint `override_params` is a parameter of type `hash`: -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \ --form "namespace=email" \ --form "path=impapi" \ @@ -497,7 +497,7 @@ https://gitlab.example.com/api/v4/projects/import `variables` is a parameter of type `array` containing hash key/value pairs `[{ 'key' => 'UPLOAD_TO_S3', 'value' => 'true' }]`: -```bash +```shell curl --globoff --request POST --header "PRIVATE-TOKEN: ********************" \ "https://gitlab.example.com/api/v4/projects/169/pipeline?ref=master&variables[][key]=VAR1&variables[][value]=hello&variables[][key]=VAR2&variables[][value]=world" diff --git a/doc/api/access_requests.md b/doc/api/access_requests.md index a9ebffbc606..75622fcc2de 100644 --- a/doc/api/access_requests.md +++ b/doc/api/access_requests.md @@ -29,7 +29,7 @@ GET /projects/:id/access_requests Example request: -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/:id/access_requests curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/:id/access_requests ``` @@ -72,7 +72,7 @@ POST /projects/:id/access_requests Example request: -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/:id/access_requests curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/:id/access_requests ``` @@ -107,7 +107,7 @@ PUT /projects/:id/access_requests/:user_id/approve Example request: -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/:id/access_requests/:user_id/approve?access_level=20 curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/:id/access_requests/:user_id/approve?access_level=20 ``` @@ -141,7 +141,7 @@ DELETE /projects/:id/access_requests/:user_id Example request: -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/:id/access_requests/:user_id curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/:id/access_requests/:user_id ``` diff --git a/doc/api/appearance.md b/doc/api/appearance.md index e2c10fa2574..354a69cb604 100644 --- a/doc/api/appearance.md +++ b/doc/api/appearance.md @@ -13,7 +13,7 @@ List the current appearance configuration of the GitLab instance. GET /application/appearance ``` -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/application/appearance ``` @@ -57,7 +57,7 @@ PUT /application/appearance | `message_font_color` | string | no | Font color for the system header / footer bar | `email_header_and_footer_enabled` | boolean | no | Add header and footer to all outgoing emails if enabled -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/application/appearance?email_header_and_footer_enabled=true&header_message=test ``` diff --git a/doc/api/applications.md b/doc/api/applications.md index 549828a983e..cb45fc742ca 100644 --- a/doc/api/applications.md +++ b/doc/api/applications.md @@ -31,7 +31,7 @@ Parameters: Example request: -```sh +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --data "name=MyApplication&redirect_uri=http://redirect.uri&scopes=" https://gitlab.example.com/api/v4/applications ``` @@ -58,7 +58,7 @@ GET /applications Example request: -```sh +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/applications ``` @@ -97,6 +97,6 @@ Parameters: Example request: -```sh +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/applications/:id ``` diff --git a/doc/api/audit_events.md b/doc/api/audit_events.md index a06a300e149..5af2bdc1d29 100644 --- a/doc/api/audit_events.md +++ b/doc/api/audit_events.md @@ -24,7 +24,7 @@ are paginated. Read more on [pagination](README.md#pagination). -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://primary.example.com/api/v4/audit_events ``` @@ -91,7 +91,7 @@ Example response: GET /audit_events/:id ``` -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://primary.example.com/api/v4/audit_events/1 ``` @@ -141,7 +141,7 @@ are paginated. Read more on [pagination](README.md#pagination). -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://primary.example.com/api/v4/groups/60/audit_events ``` @@ -197,7 +197,7 @@ GET /groups/:id/audit_events/:audit_event_id | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) | | `audit_event_id` | integer | yes | ID of the audit event | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://primary.example.com/api/v4/groups/60/audit_events/2 ``` diff --git a/doc/api/avatar.md b/doc/api/avatar.md index 376d8e930c7..fb664ccad82 100644 --- a/doc/api/avatar.md +++ b/doc/api/avatar.md @@ -28,7 +28,7 @@ Parameters: Example request: -```sh +```shell curl https://gitlab.example.com/api/v4/avatar?email=admin@example.com&size=32 ``` diff --git a/doc/api/award_emoji.md b/doc/api/award_emoji.md index 41dbedf1ee2..0b1593aba26 100644 --- a/doc/api/award_emoji.md +++ b/doc/api/award_emoji.md @@ -35,7 +35,7 @@ Parameters: Example request: -```sh +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/issues/80/award_emoji ``` @@ -98,7 +98,7 @@ Parameters: Example request: -```sh +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/issues/80/award_emoji/1 ``` @@ -141,7 +141,7 @@ Parameters: | `issue_iid`/`merge_request_iid`/`snippet_id` | integer | yes | ID (`iid` for merge requests/issues, `id` for snippets) of an awardable. | | `name` | string | yes | Name of the emoji without colons. | -```sh +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/issues/80/award_emoji?name=blowfish ``` @@ -187,7 +187,7 @@ Parameters: | `issue_iid`/`merge_request_iid`/`snippet_id` | integer | yes | ID (`iid` for merge requests/issues, `id` for snippets) of an awardable. | | `award_id` | integer | yes | ID of an award emoji. | -```sh +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/issues/80/award_emoji/344 ``` @@ -218,7 +218,7 @@ Parameters: Example request: -```sh +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/issues/80/notes/1/award_emoji ``` @@ -264,7 +264,7 @@ Parameters: Example request: -```sh +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/issues/80/notes/1/award_emoji/2 ``` @@ -308,7 +308,7 @@ Parameters: Example request: -```sh +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/issues/80/notes/1/award_emoji?name=rocket ``` @@ -355,6 +355,6 @@ Parameters: Example request: -```sh +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/issues/80/award_emoji/345 ``` diff --git a/doc/api/boards.md b/doc/api/boards.md index 9ebe1570a59..326c8476ffc 100644 --- a/doc/api/boards.md +++ b/doc/api/boards.md @@ -17,7 +17,7 @@ GET /projects/:id/boards | --------- | ---- | -------- | ----------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/boards ``` @@ -92,7 +92,7 @@ GET /projects/:id/boards/:board_id | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `board_id` | integer | yes | The ID of a board | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/boards/1 ``` @@ -166,7 +166,7 @@ POST /projects/:id/boards | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `name` | string | yes | The name of the new board | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/boards?name=newboard ``` @@ -247,7 +247,7 @@ PUT /projects/:id/boards/:board_id | `labels` | string | no | Comma-separated list of label names which the board should be scoped to | | `weight` | integer | no | The weight range from 0 to 9, to which the board should be scoped to | -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/boards/1?name=new_name&milestone_id=43&assignee_id=1&labels=Doing&weight=4 ``` @@ -321,7 +321,7 @@ DELETE /projects/:id/boards/:board_id | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `board_id` | integer | yes | The ID of a board | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/boards/1 ``` @@ -339,7 +339,7 @@ GET /projects/:id/boards/:board_id/lists | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `board_id` | integer | yes | The ID of a board | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/boards/1/lists ``` @@ -397,7 +397,7 @@ GET /projects/:id/boards/:board_id/lists/:list_id | `board_id` | integer | yes | The ID of a board | | `list_id`| integer | yes | The ID of a board's list | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/boards/1/lists/1 ``` @@ -439,7 +439,7 @@ that is, only one of them are accepted in a request. Check the [Issue Board docs](../user/project/issue_board.md#summary-of-features-per-tier) for more information regarding the required license for each list type. -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/boards/1/lists?label_id=5 ``` @@ -474,7 +474,7 @@ PUT /projects/:id/boards/:board_id/lists/:list_id | `list_id` | integer | yes | The ID of a board's list | | `position` | integer | yes | The position of the list | -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/boards/1/lists/1?position=2 ``` @@ -508,7 +508,7 @@ DELETE /projects/:id/boards/:board_id/lists/:list_id | `board_id` | integer | yes | The ID of a board | | `list_id` | integer | yes | The ID of a board's list | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/boards/1/lists/1 ``` diff --git a/doc/api/branches.md b/doc/api/branches.md index bba8876163e..2f9ca62ced6 100644 --- a/doc/api/branches.md +++ b/doc/api/branches.md @@ -25,7 +25,7 @@ Parameters: Example request: -```sh +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/repository/branches ``` @@ -81,7 +81,7 @@ Parameters: Example request: -```sh +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/repository/branches/master ``` @@ -142,7 +142,7 @@ Parameters: Example request: -```sh +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/repository/branches?branch=newbranch&ref=master ``` @@ -195,7 +195,7 @@ Parameters: Example request: -```sh +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/repository/branches/newbranch ``` @@ -218,6 +218,6 @@ Parameters: Example request: -```sh +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/repository/merged_branches ``` diff --git a/doc/api/broadcast_messages.md b/doc/api/broadcast_messages.md index 6a9a0ba745a..9a15e3ab89d 100644 --- a/doc/api/broadcast_messages.md +++ b/doc/api/broadcast_messages.md @@ -19,7 +19,7 @@ GET /broadcast_messages Example request: -```sh +```shell curl https://gitlab.example.com/api/v4/broadcast_messages ``` @@ -56,7 +56,7 @@ Parameters: Example request: -```sh +```shell curl https://gitlab.example.com/api/v4/broadcast_messages/1 ``` @@ -95,7 +95,7 @@ Parameters: Example request: -```sh +```shell curl --data "message=Deploy in progress&color=#cecece" --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/broadcast_messages ``` @@ -135,7 +135,7 @@ Parameters: Example request: -```sh +```shell curl --request PUT --data "message=Update message&color=#000" --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/broadcast_messages/1 ``` @@ -158,7 +158,7 @@ Example response: Delete a broadcast message. -```sh +```shell DELETE /broadcast_messages/:id ``` @@ -170,6 +170,6 @@ Parameters: Example request: -```sh +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/broadcast_messages/1 ``` diff --git a/doc/api/commits.md b/doc/api/commits.md index f4bb09843c8..8eb90d10536 100644 --- a/doc/api/commits.md +++ b/doc/api/commits.md @@ -19,7 +19,7 @@ GET /projects/:id/repository/commits | `with_stats` | boolean | no | Stats about each commit will be added to the response | | `first_parent` | boolean | no | Follow only the first parent commit upon seeing a merge commit | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/repository/commits" ``` @@ -94,7 +94,7 @@ POST /projects/:id/repository/commits | `last_commit_id` | string | no | Last known file commit id. Will be only considered in update, move and delete actions. | | `execute_filemode` | boolean | no | When `true/false` enables/disables the execute flag on the file. Only considered for `chmod` action. | -```bash +```shell PAYLOAD=$(cat << 'JSON' { "branch": "master", @@ -161,7 +161,7 @@ Example response: GitLab supports [form encoding](README.md#encoding-api-parameters-of-array-and-hash-types). The following is an example using Commit API with form encoding: -```bash +```shell curl --request POST \ --form "branch=master" \ --form "commit_message=some commit message" \ @@ -201,7 +201,7 @@ Parameters: | `sha` | string | yes | The commit hash or name of a repository branch or tag | | `stats` | boolean | no | Include commit stats. Default is true | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/repository/commits/master ``` @@ -257,7 +257,7 @@ Parameters: | `sha` | string | yes | The commit hash | | `type` | string | no | The scope of commits. Possible values `branch`, `tag`, `all`. Default is `all`. | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/repository/commits/5937ac0a7beb003549fc5fd26fc247adbce4a52e/refs?type=all" ``` @@ -291,7 +291,7 @@ Parameters: | `sha` | string | yes | The commit hash | | `branch` | string | yes | The name of the branch | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --form "branch=master" "https://gitlab.example.com/api/v4/projects/5/repository/commits/master/cherry_pick" ``` @@ -350,7 +350,7 @@ Parameters: | `sha` | string | yes | Commit SHA to revert | | `branch` | string | yes | Target branch name | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --form "branch=master" "https://gitlab.example.com/api/v4/projects/5/repository/commits/a738f717824ff53aebad8b090c1b79a14f2bd9e8/revert" ``` @@ -401,7 +401,7 @@ Parameters: | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | `sha` | string | yes | The commit hash or name of a repository branch or tag | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/repository/commits/master/diff" ``` @@ -437,7 +437,7 @@ Parameters: | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | `sha` | string | yes | The commit hash or name of a repository branch or tag | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/repository/commits/master/comments" ``` @@ -490,7 +490,7 @@ POST /projects/:id/repository/commits/:sha/comments | `line` | integer | no | The line number where the comment should be placed | | `line_type` | string | no | The line type. Takes `new` or `old` as arguments | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --form "note=Nice picture man\!" --form "path=dudeism.md" --form "line=11" --form "line_type=new" https://gitlab.example.com/api/v4/projects/17/repository/commits/18f3e63d05582537db6d183d9d557be09e1f90c8/comments ``` @@ -536,7 +536,7 @@ GET /projects/:id/repository/commits/:sha/statuses | `name` | string | no | Filter by [job name](../ci/yaml/README.md#introduction), e.g., `bundler:audit` | `all` | boolean | no | Return all statuses, not only the latest ones -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/17/repository/commits/18f3e63d05582537db6d183d9d557be09e1f90c8/statuses ``` @@ -613,7 +613,7 @@ POST /projects/:id/statuses/:sha | `coverage` | float | no | The total code coverage | `pipeline_id` | integer | no | The ID of the pipeline to set status. Use in case of several pipeline on same SHA. -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/17/statuses/18f3e63d05582537db6d183d9d557be09e1f90c8?state=success" ``` @@ -659,7 +659,7 @@ GET /projects/:id/repository/commits/:sha/merge_requests | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | `sha` | string | yes | The commit SHA -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/repository/commits/af5b13261899fb2c0db30abdd0af8b07cb44fdc5/merge_requests" ``` @@ -730,7 +730,7 @@ Parameters: | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | `sha` | string | yes | The commit hash or name of a repository branch or tag | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/repository/commits/da738facbc19eb2fc2cef57c49be0e6038570352/signature" ``` diff --git a/doc/api/container_registry.md b/doc/api/container_registry.md index 7e5e265351e..4baeec3653c 100644 --- a/doc/api/container_registry.md +++ b/doc/api/container_registry.md @@ -19,7 +19,7 @@ GET /projects/:id/registry/repositories | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) accessible by the authenticated user. | | `tags` | boolean | no | If the param is included as true, each repository will include an array of `"tags"` in the response. | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/registry/repositories" ``` @@ -59,7 +59,7 @@ GET /groups/:id/registry/repositories | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) accessible by the authenticated user. | | `tags` | boolean | no | If the param is included as true, each repository will include an array of `"tags"` in the response. | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/2/registry/repositories?tags=1" ``` @@ -125,7 +125,7 @@ DELETE /projects/:id/registry/repositories/:repository_id | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user. | | `repository_id` | integer | yes | The ID of registry repository. | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/registry/repositories/2" ``` @@ -144,7 +144,7 @@ GET /projects/:id/registry/repositories/:repository_id/tags | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) accessible by the authenticated user. | | `repository_id` | integer | yes | The ID of registry repository. | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/registry/repositories/2/tags" ``` @@ -179,7 +179,7 @@ GET /projects/:id/registry/repositories/:repository_id/tags/:tag_name | `repository_id` | integer | yes | The ID of registry repository. | | `tag_name` | string | yes | The name of tag. | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/registry/repositories/2/tags/v10.0.0" ``` @@ -212,7 +212,7 @@ DELETE /projects/:id/registry/repositories/:repository_id/tags/:tag_name | `repository_id` | integer | yes | The ID of registry repository. | | `tag_name` | string | yes | The name of tag. | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/registry/repositories/2/tags/v10.0.0" ``` @@ -260,18 +260,18 @@ Examples: 1. Remove tag names that are matching the regex (Git SHA), keep always at least 5, and remove ones that are older than 2 days: - ```bash + ```shell curl --request DELETE --data 'name_regex=[0-9a-z]{40}' --data 'keep_n=5' --data 'older_than=2d' --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/registry/repositories/2/tags" ``` 1. Remove all tags, but keep always the latest 5: - ```bash + ```shell curl --request DELETE --data 'name_regex=.*' --data 'keep_n=5' --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/registry/repositories/2/tags" ``` 1. Remove all tags that are older than 1 month: - ```bash + ```shell curl --request DELETE --data 'name_regex=.*' --data 'older_than=1month' --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/registry/repositories/2/tags" ``` diff --git a/doc/api/custom_attributes.md b/doc/api/custom_attributes.md index d270b804ad5..983b2381ae0 100644 --- a/doc/api/custom_attributes.md +++ b/doc/api/custom_attributes.md @@ -19,7 +19,7 @@ GET /projects/:id/custom_attributes | --------- | ---- | -------- | ----------- | | `id` | integer | yes | The ID of a resource | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/users/42/custom_attributes ``` @@ -53,7 +53,7 @@ GET /projects/:id/custom_attributes/:key | `id` | integer | yes | The ID of a resource | | `key` | string | yes | The key of the custom attribute | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/users/42/custom_attributes/location ``` @@ -83,7 +83,7 @@ PUT /projects/:id/custom_attributes/:key | `key` | string | yes | The key of the custom attribute | | `value` | string | yes | The value of the custom attribute | -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" --data "value=Greenland" https://gitlab.example.com/api/v4/users/42/custom_attributes/location ``` @@ -111,6 +111,6 @@ DELETE /projects/:id/custom_attributes/:key | `id` | integer | yes | The ID of a resource | | `key` | string | yes | The key of the custom attribute | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/users/42/custom_attributes/location ``` diff --git a/doc/api/dependencies.md b/doc/api/dependencies.md index 5296d4e316f..561645d7697 100644 --- a/doc/api/dependencies.md +++ b/doc/api/dependencies.md @@ -27,7 +27,7 @@ GET /projects/:id/dependencies?package_manager=yarn,bundler | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding). | | `package_manager` | string array | no | Returns dependencies belonging to specified package manager. Valid values: `bundler`, `composer`, `maven`, `npm`, `pip` or `yarn`. | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/4/dependencies ``` diff --git a/doc/api/deploy_keys.md b/doc/api/deploy_keys.md index 2e2e1bb5e1e..492777fb785 100644 --- a/doc/api/deploy_keys.md +++ b/doc/api/deploy_keys.md @@ -8,7 +8,7 @@ Get a list of all deploy keys across all projects of the GitLab instance. This e GET /deploy_keys ``` -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/deploy_keys" ``` @@ -43,7 +43,7 @@ GET /projects/:id/deploy_keys | --------- | ---- | -------- | ----------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/deploy_keys" ``` @@ -83,7 +83,7 @@ Parameters: | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `key_id` | integer | yes | The ID of the deploy key | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/deploy_keys/11" ``` @@ -117,7 +117,7 @@ POST /projects/:id/deploy_keys | `key` | string | yes | New deploy key | | `can_push` | boolean | no | Can deploy key push to the project's repository | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --header "Content-Type: application/json" --data '{"title": "My deploy key", "key": "ssh-rsa AAAA...", "can_push": "true"}' "https://gitlab.example.com/api/v4/projects/5/deploy_keys/" ``` @@ -147,7 +147,7 @@ PUT /projects/:id/deploy_keys/:key_id | `title` | string | no | New deploy key's title | | `can_push` | boolean | no | Can deploy key push to the project's repository | -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" --header "Content-Type: application/json" --data '{"title": "New deploy key", "can_push": true}' "https://gitlab.example.com/api/v4/projects/5/deploy_keys/11" ``` @@ -176,7 +176,7 @@ DELETE /projects/:id/deploy_keys/:key_id | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `key_id` | integer | yes | The ID of the deploy key | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/deploy_keys/13" ``` @@ -184,7 +184,7 @@ curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://git Enables a deploy key for a project so this can be used. Returns the enabled key, with a status code 201 when successful. -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/deploy_keys/13/enable ``` @@ -212,25 +212,25 @@ group, this can be achieved quite easily with the API. First, find the ID of the projects you're interested in, by either listing all projects: -```bash +```shell curl --header 'PRIVATE-TOKEN: <your_access_token>' https://gitlab.example.com/api/v4/projects ``` Or finding the ID of a group: -```bash +```shell curl --header 'PRIVATE-TOKEN: <your_access_token>' https://gitlab.example.com/api/v4/groups ``` Then listing all projects in that group (for example, group 1234): -```bash +```shell curl --header 'PRIVATE-TOKEN: <your_access_token>' https://gitlab.example.com/api/v4/groups/1234 ``` With those IDs, add the same deploy key to all: -```bash +```shell for project_id in 321 456 987; do curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --header "Content-Type: application/json" \ --data '{"title": "my key", "key": "ssh-rsa AAAA..."}' https://gitlab.example.com/api/v4/projects/${project_id}/deploy_keys diff --git a/doc/api/deployments.md b/doc/api/deployments.md index 3890a71f283..02c7e178aaf 100644 --- a/doc/api/deployments.md +++ b/doc/api/deployments.md @@ -26,7 +26,7 @@ The status attribute can be one of the following values: - failed - canceled -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/deployments" ``` @@ -186,7 +186,7 @@ GET /projects/:id/deployments/:deployment_id | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `deployment_id` | integer | yes | The ID of the deployment | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/deployments/1" ``` @@ -286,7 +286,7 @@ The status can be one of the following values: - failed - canceled -```bash +```shell curl --data "environment=production&sha=a91957a858320c0e17f3a0eca7cfacbff50ea29a&ref=master&tag=false&status=success" --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/deployments" ``` @@ -329,7 +329,7 @@ PUT /projects/:id/deployments/:deployment_id | `deployment_id` | integer | yes | The ID of the deployment to update | | `status` | string | yes | The new status of the deployment | -```bash +```shell curl --request PUT --data "status=success" --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/deployments/42" ``` @@ -372,6 +372,6 @@ GET /projects/:id/deployments/:deployment_id/merge_requests It supports the same parameters as the [Merge Requests API](./merge_requests.md#list-merge-requests) and will return a response using the same format: -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/deployments/42" ``` diff --git a/doc/api/discussions.md b/doc/api/discussions.md index 12dbba78291..285d1699a95 100644 --- a/doc/api/discussions.md +++ b/doc/api/discussions.md @@ -110,7 +110,7 @@ GET /projects/:id/issues/:issue_iid/discussions ] ``` -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/issues/11/discussions ``` @@ -130,7 +130,7 @@ Parameters: | `issue_iid` | integer | yes | The IID of an issue | | `discussion_id` | integer | yes | The ID of a discussion item | -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/issues/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7 ``` @@ -151,7 +151,7 @@ Parameters: | `body` | string | yes | The content of the thread | | `created_at` | string | no | Date time string, ISO 8601 formatted, e.g. 2016-03-11T03:45:40Z (requires admin or project/group owner rights) | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/issues/11/discussions?body=comment ``` @@ -177,7 +177,7 @@ Parameters: | `body` | string | yes | The content of the note/reply | | `created_at` | string | no | Date time string, ISO 8601 formatted, e.g. 2016-03-11T03:45:40Z (requires admin or project/group owner rights) | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/issues/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7/notes?body=comment ``` @@ -199,7 +199,7 @@ Parameters: | `note_id` | integer | yes | The ID of a thread note | | `body` | string | yes | The content of the note/reply | -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/issues/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7/notes/1108?body=comment ``` @@ -220,7 +220,7 @@ Parameters: | `discussion_id` | integer | yes | The ID of a discussion | | `note_id` | integer | yes | The ID of a discussion note | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/issues/11/discussions/636 ``` @@ -318,7 +318,7 @@ GET /projects/:id/snippets/:snippet_id/discussions ] ``` -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/snippets/11/discussions ``` @@ -338,7 +338,7 @@ Parameters: | `snippet_id` | integer | yes | The ID of an snippet | | `discussion_id` | integer | yes | The ID of a discussion item | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/snippets/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7 ``` @@ -360,7 +360,7 @@ Parameters: | `body` | string | yes | The content of a discussion | | `created_at` | string | no | Date time string, ISO 8601 formatted, e.g. 2016-03-11T03:45:40Z (requires admin or project/group owner rights) | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/snippets/11/discussions?body=comment ``` @@ -383,7 +383,7 @@ Parameters: | `body` | string | yes | The content of the note/reply | | `created_at` | string | no | Date time string, ISO 8601 formatted, e.g. 2016-03-11T03:45:40Z (requires admin or project/group owner rights) | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/snippets/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7/notes?body=comment ``` @@ -405,7 +405,7 @@ Parameters: | `note_id` | integer | yes | The ID of a thread note | | `body` | string | yes | The content of the note/reply | -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/snippets/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7/notes/1108?body=comment ``` @@ -426,7 +426,7 @@ Parameters: | `discussion_id` | integer | yes | The ID of a discussion | | `note_id` | integer | yes | The ID of a discussion note | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/snippets/11/discussions/636 ``` @@ -525,7 +525,7 @@ GET /groups/:id/epics/:epic_id/discussions ] ``` -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/epics/11/discussions ``` @@ -545,7 +545,7 @@ Parameters: | `epic_id` | integer | yes | The ID of an epic | | `discussion_id` | integer | yes | The ID of a discussion item | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/epics/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7 ``` @@ -567,7 +567,7 @@ Parameters: | `body` | string | yes | The content of the thread | | `created_at` | string | no | Date time string, ISO 8601 formatted, e.g. 2016-03-11T03:45:40Z (requires admin or project/group owner rights) | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/epics/11/discussions?body=comment ``` @@ -591,7 +591,7 @@ Parameters: | `body` | string | yes | The content of the note/reply | | `created_at` | string | no | Date time string, ISO 8601 formatted, e.g. 2016-03-11T03:45:40Z (requires admin or project/group owner rights) | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/epics/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7/notes?body=comment ``` @@ -613,7 +613,7 @@ Parameters: | `note_id` | integer | yes | The ID of a thread note | | `body` | string | yes | The content of note/reply | -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/epics/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7/notes/1108?body=comment ``` @@ -634,7 +634,7 @@ Parameters: | `discussion_id` | integer | yes | The ID of a thread | | `note_id` | integer | yes | The ID of a thread note | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/epics/11/discussions/636 ``` @@ -785,7 +785,7 @@ Diff comments contain also position: ] ``` -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/merge_requests/11/discussions ``` @@ -805,7 +805,7 @@ Parameters: | `merge_request_iid` | integer | yes | The IID of a merge request | | `discussion_id` | integer | yes | The ID of a discussion item | -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/merge_requests/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7 ``` @@ -840,7 +840,7 @@ Parameters: | `position[x]` | integer | no | X coordinate (for 'image' diff notes) | | `position[y]` | integer | no | Y coordinate (for 'image' diff notes) | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/merge_requests/11/discussions?body=comment ``` @@ -861,7 +861,7 @@ Parameters: | `discussion_id` | integer | yes | The ID of a thread | | `resolved` | boolean | yes | Resolve/unresolve the discussion | -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/merge_requests/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7?resolved=true ``` @@ -885,7 +885,7 @@ Parameters: | `body` | string | yes | The content of the note/reply | | `created_at` | string | no | Date time string, ISO 8601 formatted, e.g. 2016-03-11T03:45:40Z (requires admin or project/group owner rights) | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/merge_requests/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7/notes?body=comment ``` @@ -908,13 +908,13 @@ Parameters: | `body` | string | no | The content of the note/reply (exactly one of `body` or `resolved` must be set | | `resolved` | boolean | no | Resolve/unresolve the note (exactly one of `body` or `resolved` must be set | -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/merge_requests/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7/notes/1108?body=comment ``` Resolving a note: -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/merge_requests/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7/notes/1108?resolved=true ``` @@ -935,7 +935,7 @@ Parameters: | `discussion_id` | integer | yes | The ID of a thread | | `note_id` | integer | yes | The ID of a thread note | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/merge_requests/11/discussions/636 ``` @@ -1078,7 +1078,7 @@ Diff comments contain also position: ] ``` -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/commits/11/discussions ``` @@ -1098,7 +1098,7 @@ Parameters: | `commit_id` | integer | yes | The ID of a commit | | `discussion_id` | integer | yes | The ID of a discussion item | -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/commits/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7 ``` @@ -1133,7 +1133,7 @@ Parameters: | `position[x]` | integer | no | X coordinate (for 'image' diff notes) | | `position[y]` | integer | no | Y coordinate (for 'image' diff notes) | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/commits/11/discussions?body=comment ``` @@ -1156,7 +1156,7 @@ Parameters: | `body` | string | yes | The content of the note/reply | | `created_at` | string | no | Date time string, ISO 8601 formatted, e.g. 2016-03-11T03:45:40Z (requires admin or project/group owner rights) | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/commits/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7/notes?body=comment ``` @@ -1178,13 +1178,13 @@ Parameters: | `note_id` | integer | yes | The ID of a thread note | | `body` | string | no | The content of a note | -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/commits/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7/notes/1108?body=comment ``` Resolving a note: -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/commits/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7/notes/1108?resolved=true ``` @@ -1205,6 +1205,6 @@ Parameters: | `discussion_id` | integer | yes | The ID of a thread | | `note_id` | integer | yes | The ID of a thread note | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/commits/11/discussions/636 ``` diff --git a/doc/api/environments.md b/doc/api/environments.md index 3f46c11ed69..6817b904618 100644 --- a/doc/api/environments.md +++ b/doc/api/environments.md @@ -14,7 +14,7 @@ GET /projects/:id/environments | `name` | string | no | Return the environment with this name. Mutually exclusive with `search` | | `search` | string | no | Return list of environments matching the search criteria. Mutually exclusive with `name` | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/environments?name=review%2Ffix-foo ``` @@ -43,7 +43,7 @@ GET /projects/:id/environments/:environment_id | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `environment_id` | integer | yes | The ID of the environment | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/environments/1" ``` @@ -155,7 +155,7 @@ POST /projects/:id/environments | `name` | string | yes | The name of the environment | | `external_url` | string | no | Place to link to for this environment | -```bash +```shell curl --data "name=deploy&external_url=https://deploy.example.gitlab.com" --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/environments" ``` @@ -188,7 +188,7 @@ PUT /projects/:id/environments/:environments_id | `name` | string | no | The new name of the environment | | `external_url` | string | no | The new external_url | -```bash +```shell curl --request PUT --data "name=staging&external_url=https://staging.example.gitlab.com" --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/environments/1" ``` @@ -217,7 +217,7 @@ DELETE /projects/:id/environments/:environment_id | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `environment_id` | integer | yes | The ID of the environment | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/environments/1" ``` @@ -234,7 +234,7 @@ POST /projects/:id/environments/:environment_id/stop | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `environment_id` | integer | yes | The ID of the environment | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/environments/1/stop" ``` diff --git a/doc/api/epic_issues.md b/doc/api/epic_issues.md index 02317cc6c09..cea6da43add 100644 --- a/doc/api/epic_issues.md +++ b/doc/api/epic_issues.md @@ -19,7 +19,7 @@ GET /groups/:id/epics/:epic_iid/issues | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user | | `epic_iid` | integer/string | yes | The internal ID of the epic. | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/1/epics/5/issues/ ``` @@ -116,7 +116,7 @@ POST /groups/:id/epics/:epic_iid/issues/:issue_id | `epic_iid` | integer/string | yes | The internal ID of the epic. | | `issue_id` | integer/string | yes | The ID of the issue. | -```bash +```shell curl --header POST "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/1/epics/5/issues/55 ``` @@ -222,7 +222,7 @@ DELETE /groups/:id/epics/:epic_iid/issues/:epic_issue_id | `epic_iid` | integer/string | yes | The internal ID of the epic. | | `epic_issue_id` | integer/string | yes | The ID of the issue - epic association. | -```bash +```shell curl --header DELETE "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/1/epics/5/issues/11 ``` @@ -330,7 +330,7 @@ PUT /groups/:id/epics/:epic_iid/issues/:epic_issue_id | `move_before_id` | integer/string | no | The ID of the issue - epic association that should be placed before the link in the question. | | `move_after_id` | integer/string | no | The ID of the issue - epic association that should be placed after the link in the question. | -```bash +```shell curl --header PUT "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/1/epics/5/issues/11?move_before_id=20 ``` diff --git a/doc/api/epic_links.md b/doc/api/epic_links.md index e81dc88da81..4b88de6a37d 100644 --- a/doc/api/epic_links.md +++ b/doc/api/epic_links.md @@ -24,7 +24,7 @@ GET /groups/:id/epics/:epic_iid/epics | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user | | `epic_iid` | integer | yes | The internal ID of the epic. | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/1/epics/5/epics/ ``` @@ -79,7 +79,7 @@ POST /groups/:id/epics/:epic_iid/epics | `epic_iid` | integer | yes | The internal ID of the epic. | | `child_epic_id` | integer | yes | The global ID of the child epic. Internal ID can't be used because they can conflict with epics from other groups. | -```bash +```shell curl --header POST "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/1/epics/5/epics/6 ``` @@ -132,7 +132,7 @@ POST /groups/:id/epics/:epic_iid/epics | `epic_iid` | integer | yes | The internal ID of the (future parent) epic. | | `title` | string | yes | The title of a newly created epic. | -```bash +```shell curl --header POST "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/1/epics/5/epics?title=Newpic ``` @@ -167,7 +167,7 @@ PUT /groups/:id/epics/:epic_iid/epics/:child_epic_id | `move_before_id` | integer | no | The global ID of a sibling epic that should be placed before the child epic. | | `move_after_id` | integer | no | The global ID of a sibling epic that should be placed after the child epic. | -```bash +```shell curl --header PUT "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/1/epics/4/epics/5 ``` @@ -222,7 +222,7 @@ DELETE /groups/:id/epics/:epic_iid/epics/:child_epic_id | `epic_iid` | integer | yes | The internal ID of the epic. | | `child_epic_id` | integer | yes | The global ID of the child epic. Internal ID can't be used because they can conflict with epics from other groups. | -```bash +```shell curl --header DELETE "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/1/epics/4/epics/5 ``` diff --git a/doc/api/epics.md b/doc/api/epics.md index 109c12c1052..34b0bcba303 100644 --- a/doc/api/epics.md +++ b/doc/api/epics.md @@ -65,7 +65,7 @@ GET /groups/:id/epics?state=opened | `include_ancestor_groups` | boolean | no | Include epics from the requested group's ancestors. Default is `false` | | `include_descendant_groups` | boolean | no | Include epics from the requested group's descendants. Default is `true` | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/1/epics ``` @@ -169,7 +169,7 @@ GET /groups/:id/epics/:epic_iid | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user | | `epic_iid` | integer/string | yes | The internal ID of the epic. | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/1/epics/5 ``` @@ -244,7 +244,7 @@ POST /groups/:id/epics | `due_date_fixed` | string | no | The fixed due date of an epic (since 11.3) | | `parent_id` | integer/string | no | The id of a parent epic (since 11.11) | -```bash +```shell curl --header POST "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/1/epics?title=Epic&description=Epic%20description ``` @@ -319,7 +319,7 @@ PUT /groups/:id/epics/:epic_iid | `due_date_fixed` | string | no | The fixed due date of an epic (since 11.3) | | `state_event` | string | no | State event for an epic. Set `close` to close the epic and `reopen` to reopen it (since 11.4) | -```bash +```shell curl --header PUT "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/1/epics/5?title=New%20Title ``` @@ -381,7 +381,7 @@ DELETE /groups/:id/epics/:epic_iid | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user | | `epic_iid` | integer/string | yes | The internal ID of the epic. | -```bash +```shell curl --header DELETE "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/1/epics/5 ``` @@ -400,7 +400,7 @@ POST /groups/:id/epics/:epic_iid/todo | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user | | `epic_iid` | integer | yes | The internal ID of a group's epic | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/1/epics/5/todo ``` diff --git a/doc/api/error_tracking.md b/doc/api/error_tracking.md index 3c1fbb7dc7a..6efafd4189a 100644 --- a/doc/api/error_tracking.md +++ b/doc/api/error_tracking.md @@ -16,7 +16,7 @@ GET /projects/:id/error_tracking/settings | --------- | ------- | -------- | --------------------- | | `id` | integer | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/error_tracking/settings ``` diff --git a/doc/api/events.md b/doc/api/events.md index 1dc0b054ee6..f3963bcf970 100644 --- a/doc/api/events.md +++ b/doc/api/events.md @@ -71,7 +71,7 @@ Parameters: Example request: -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/events?target_type=issue&action=created&after=2017-01-31&before=2017-03-01&scope=all ``` @@ -143,7 +143,7 @@ Parameters: | `after` | date | no | Include only events created after a particular date. Please see [here for the supported format][date-formatting] | | `sort` | string | no | Sort events in `asc` or `desc` order by `created_at`. Default is `desc` | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/users/:id/events ``` @@ -276,7 +276,7 @@ Parameters: Example request: -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/:project_id/events?target_type=issue&action=created&after=2017-01-31&before=2017-03-01 ``` diff --git a/doc/api/feature_flag_specs.md b/doc/api/feature_flag_specs.md index 6a2cd047f85..e41bbea0e66 100644 --- a/doc/api/feature_flag_specs.md +++ b/doc/api/feature_flag_specs.md @@ -25,7 +25,7 @@ GET /projects/:id/feature_flag_scopes | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding). | | `environment` | string | yes | The [environment](../ci/environments.md) name | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/feature_flag_scopes?environment=production ``` @@ -93,7 +93,7 @@ GET /projects/:id/feature_flags/:name/scopes | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding). | | `name` | string | yes | The name of the feature flag. | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/feature_flags/new_live_trace/scopes ``` @@ -159,7 +159,7 @@ POST /projects/:id/feature_flags/:name/scopes | `active` | boolean | yes | Whether the spec is active. | | `strategies` | json | yes | The [strategies](../user/project/operations/feature_flags.md#feature-flag-strategies) of the feature flag spec. | -```bash +```shell curl https://gitlab.example.com/api/v4/projects/1/feature_flags/new_live_trace/scopes \ --header "PRIVATE-TOKEN: <your_access_token>" \ --header "Content-type: application/json" \ @@ -204,7 +204,7 @@ GET /projects/:id/feature_flags/:name/scopes/:environment_scope | `name` | string | yes | The name of the feature flag. | | `environment_scope` | string | yes | The URL-encoded [environment spec](../ci/environments.md#scoping-environments-with-specs) of the feature flag. | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/:id/feature_flags/new_live_trace/scopes/production ``` @@ -242,7 +242,7 @@ PUT /projects/:id/feature_flags/:name/scopes/:environment_scope | `active` | boolean | yes | Whether the spec is active. | | `strategies` | json | yes | The [strategies](../user/project/operations/feature_flags.md#feature-flag-strategies) of the feature flag spec. | -```bash +```shell curl https://gitlab.example.com/api/v4/projects/1/feature_flags/new_live_trace/scopes/production \ --header "PRIVATE-TOKEN: <your_access_token>" \ --header "Content-type: application/json" \ @@ -286,6 +286,6 @@ DELETE /projects/:id/feature_flags/:name/scopes/:environment_scope | `name` | string | yes | The name of the feature flag. | | `environment_scope` | string | yes | The URL-encoded [environment spec](../ci/environments.md#scoping-environments-with-specs) of the feature flag. | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" --request DELETE https://gitlab.example.com/api/v4/projects/1/feature_flags/new_live_trace/scopes/production ``` diff --git a/doc/api/feature_flags.md b/doc/api/feature_flags.md index def452d36fb..384708be5df 100644 --- a/doc/api/feature_flags.md +++ b/doc/api/feature_flags.md @@ -24,7 +24,7 @@ GET /projects/:id/feature_flags | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding). | | `scope` | string | no | The condition of feature flags, one of: `enabled`, `disabled`. | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/feature_flags ``` @@ -159,7 +159,7 @@ POST /projects/:id/feature_flags | `scopes:active` | boolean | no | Whether the spec is active. | | `scopes:strategies` | JSON | no | The [strategies](../user/project/operations/feature_flags.md#feature-flag-strategies) of the feature flag spec. | -```bash +```shell curl https://gitlab.example.com/api/v4/projects/1/feature_flags \ --header "PRIVATE-TOKEN: <your_access_token>" \ --header "Content-type: application/json" \ @@ -228,7 +228,7 @@ GET /projects/:id/feature_flags/:name | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding). | | `name` | string | yes | The name of the feature flag. | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/feature_flags/new_live_trace ``` @@ -303,6 +303,6 @@ DELETE /projects/:id/feature_flags/:name | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding). | | `name` | string | yes | The name of the feature flag. | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" --request DELETE https://gitlab.example.com/api/v4/projects/1/feature_flags/awesome_feature ``` diff --git a/doc/api/features.md b/doc/api/features.md index 8b5ea27007d..d3c585f67c9 100644 --- a/doc/api/features.md +++ b/doc/api/features.md @@ -13,7 +13,7 @@ Get a list of all persisted features, with its gate values. GET /features ``` -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/features ``` @@ -66,7 +66,7 @@ POST /features/:name Note that you can enable or disable a feature for a `feature_group`, a `user`, a `group`, and a `project` in a single API call. -```bash +```shell curl --data "value=30" --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/features/new_library ``` diff --git a/doc/api/geo_nodes.md b/doc/api/geo_nodes.md index 18c4dd1bc8f..83a00cf3f10 100644 --- a/doc/api/geo_nodes.md +++ b/doc/api/geo_nodes.md @@ -11,7 +11,7 @@ Creates a new Geo node. POST /geo_nodes ``` -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://primary.example.com/api/v4/geo_nodes \ --request POST \ -d "name=himynameissomething" \ @@ -72,7 +72,7 @@ Example response: GET /geo_nodes ``` -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://primary.example.com/api/v4/geo_nodes ``` @@ -139,7 +139,7 @@ Example response: GET /geo_nodes/:id ``` -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://primary.example.com/api/v4/geo_nodes/1 ``` @@ -286,7 +286,7 @@ Example response: GET /geo_nodes/status ``` -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://primary.example.com/api/v4/geo_nodes/status ``` @@ -445,7 +445,7 @@ In GitLab 12.0, deprecated fields `wikis_count` and `repositories_count` were re GET /geo_nodes/:id/status ``` -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://primary.example.com/api/v4/geo_nodes/2/status ``` @@ -523,7 +523,7 @@ GET /geo_nodes/current/failures This endpoint uses [Pagination](README.md#pagination). -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://primary.example.com/api/v4/geo_nodes/current/failures ``` diff --git a/doc/api/graphql/getting_started.md b/doc/api/graphql/getting_started.md index 57c0fcc659c..ee0642b185b 100644 --- a/doc/api/graphql/getting_started.md +++ b/doc/api/graphql/getting_started.md @@ -21,7 +21,7 @@ to use as a bearer token. Example: -```sh +```shell GRAPHQL_TOKEN=<your-token> curl 'https://gitlab.com/api/graphql' --header "Authorization: Bearer $GRAPHQL_TOKEN" --header "Content-Type: application/json" --request POST --data "{\"query\": \"query {currentUser {name}}\"}" ``` diff --git a/doc/api/group_badges.md b/doc/api/group_badges.md index 70179ecde29..d46f7198571 100644 --- a/doc/api/group_badges.md +++ b/doc/api/group_badges.md @@ -28,7 +28,7 @@ GET /groups/:id/badges | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user | | `name` | string | no | Name of the badges to return (case-sensitive). | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/:id/badges?name=Coverage ``` @@ -61,7 +61,7 @@ GET /groups/:id/badges/:badge_id | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user | | `badge_id` | integer | yes | The badge ID | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/:id/badges/:badge_id ``` @@ -92,7 +92,7 @@ POST /groups/:id/badges | `link_url` | string | yes | URL of the badge link | | `image_url` | string | yes | URL of the badge image | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --data "link_url=https://gitlab.com/gitlab-org/gitlab-foss/commits/master&image_url=https://shields.io/my/badge1&position=0" https://gitlab.example.com/api/v4/groups/:id/badges ``` @@ -124,7 +124,7 @@ PUT /groups/:id/badges/:badge_id | `link_url` | string | no | URL of the badge link | | `image_url` | string | no | URL of the badge image | -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/:id/badges/:badge_id ``` @@ -154,7 +154,7 @@ DELETE /groups/:id/badges/:badge_id | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user | | `badge_id` | integer | yes | The badge ID | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/:id/badges/:badge_id ``` @@ -172,7 +172,7 @@ GET /groups/:id/badges/render | `link_url` | string | yes | URL of the badge link| | `image_url` | string | yes | URL of the badge image | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/:id/badges/render?link_url=http%3A%2F%2Fexample.com%2Fci_status.svg%3Fproject%3D%25%7Bproject_path%7D%26ref%3D%25%7Bdefault_branch%7D&image_url=https%3A%2F%2Fshields.io%2Fmy%2Fbadge ``` diff --git a/doc/api/group_boards.md b/doc/api/group_boards.md index 444cb90a7e8..f4d45f8f402 100644 --- a/doc/api/group_boards.md +++ b/doc/api/group_boards.md @@ -17,7 +17,7 @@ GET /groups/:id/boards | --------- | ---- | -------- | ----------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/boards ``` @@ -135,7 +135,7 @@ GET /groups/:id/boards/:board_id | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user | | `board_id` | integer | yes | The ID of a board | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/boards/1 ``` @@ -249,7 +249,7 @@ POST /groups/:id/boards | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user | | `name` | string | yes | The name of the new board | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/boards?name=newboard ``` @@ -320,7 +320,7 @@ PUT /groups/:id/boards/:board_id | `labels` | string | no | Comma-separated list of label names which the board should be scoped to | | `weight` | integer | no | The weight range from 0 to 9, to which the board should be scoped to | -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/boards/1?name=new_name&milestone_id=44&assignee_id=1&labels=GroupLabel&weight=4 ``` @@ -381,7 +381,7 @@ DELETE /groups/:id/boards/:board_id | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user | | `board_id` | integer | yes | The ID of a board | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/boards/1 ``` @@ -399,7 +399,7 @@ GET /groups/:id/boards/:board_id/lists | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user | | `board_id` | integer | yes | The ID of a board | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/boards/1/lists ``` @@ -451,7 +451,7 @@ GET /groups/:id/boards/:board_id/lists/:list_id | `board_id` | integer | yes | The ID of a board | | `list_id` | integer | yes | The ID of a board's list | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/boards/1/lists/1 ``` @@ -483,7 +483,7 @@ POST /groups/:id/boards/:board_id/lists | `board_id` | integer | yes | The ID of a board | | `label_id` | integer | yes | The ID of a label | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/boards/1/lists?label_id=5 ``` @@ -516,7 +516,7 @@ PUT /groups/:id/boards/:board_id/lists/:list_id | `list_id` | integer | yes | The ID of a board's list | | `position` | integer | yes | The position of the list | -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/group/5/boards/1/lists/1?position=2 ``` @@ -548,6 +548,6 @@ DELETE /groups/:id/boards/:board_id/lists/:list_id | `board_id` | integer | yes | The ID of a board | | `list_id` | integer | yes | The ID of a board's list | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/boards/1/lists/1 ``` diff --git a/doc/api/group_clusters.md b/doc/api/group_clusters.md index 143f5762811..fd8b22b070b 100644 --- a/doc/api/group_clusters.md +++ b/doc/api/group_clusters.md @@ -22,7 +22,7 @@ Parameters: Example request: -```bash +```shell curl --header 'Private-Token: <your_access_token>' https://gitlab.example.com/api/v4/groups/26/clusters ``` @@ -90,7 +90,7 @@ Parameters: Example request: -```bash +```shell curl --header 'Private-Token: <your_access_token>' https://gitlab.example.com/api/v4/groups/26/clusters/18 ``` @@ -166,7 +166,7 @@ Parameters: Example request: -```bash +```shell curl --header 'Private-Token: <your_access_token>' https://gitlab.example.com/api/v4/groups/26/clusters/user \ -H "Accept: application/json" \ -H "Content-Type:application/json" \ @@ -237,7 +237,7 @@ through the ["Add existing cluster to group"](#add-existing-cluster-to-group) en Example request: -```bash +```shell curl --header 'Private-Token: <your_access_token>' https://gitlab.example.com/api/v4/groups/26/clusters/24 \ -H "Content-Type:application/json" \ --request PUT --data '{"name":"new-cluster-name","domain":"new-domain.com","api_url":"https://new-api-url.com"}' @@ -307,6 +307,6 @@ Parameters: Example request: -```bash +```shell curl --request DELETE --header 'Private-Token: <your_access_token>' https://gitlab.example.com/api/v4/groups/26/clusters/23 ``` diff --git a/doc/api/group_labels.md b/doc/api/group_labels.md index f41f3a0a402..2c5406bbc21 100644 --- a/doc/api/group_labels.md +++ b/doc/api/group_labels.md @@ -21,7 +21,7 @@ GET /groups/:id/labels | `with_counts` | boolean | no | Whether or not to include issue and merge request counts. Defaults to `false`. _([Introduced in GitLab 12.2](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/31543))_ | | `include_ancestor_groups` | boolean | no | Include ancestor groups. Defaults to `true`. | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/labels?with_counts=true ``` @@ -70,7 +70,7 @@ GET /groups/:id/labels/:label_id | `label_id` | integer or string | yes | The ID or title of a group's label. | | `include_ancestor_groups` | boolean | no | Include ancestor groups. Defaults to `true`. | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/labels/bug ``` @@ -106,7 +106,7 @@ POST /groups/:id/labels | `color` | string | yes | The color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the [CSS color names](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#Color_keywords) | | `description` | string | no | The description of the label, | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --header "Content-Type: application/json" --data '{"name": "Feature Proposal", "color": "#FFA500", "description": "Describes new ideas" }' https://gitlab.example.com/api/v4/groups/5/labels ``` @@ -143,7 +143,7 @@ PUT /groups/:id/labels/:label_id | `color` | string | no | The color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the [CSS color names](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#Color_keywords) | | `description` | string | no | The description of the label. | -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" --header "Content-Type: application/json" --data '{"new_name": "Feature Idea" }' https://gitlab.example.com/api/v4/groups/5/labels/Feature%20Proposal ``` @@ -179,7 +179,7 @@ DELETE /groups/:id/labels/:label_id | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user | | `label_id` | integer or string | yes | The ID or title of a group's label. | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/labels/bug ``` @@ -199,7 +199,7 @@ POST /groups/:id/labels/:label_id/subscribe | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user | | `label_id` | integer or string | yes | The ID or title of a group's label. | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/labels/9/subscribe ``` @@ -235,7 +235,7 @@ POST /groups/:id/labels/:label_id/unsubscribe | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user | | `label_id` | integer or string | yes | The ID or title of a group's label. | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/labels/9/unsubscribe ``` diff --git a/doc/api/group_milestones.md b/doc/api/group_milestones.md index a77f12de5a1..e469217db78 100644 --- a/doc/api/group_milestones.md +++ b/doc/api/group_milestones.md @@ -26,7 +26,7 @@ Parameters: | `title` | string | optional | Return only the milestones having the given `title` | | `search` | string | optional | Return only milestones with a title or description matching the provided string | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/milestones ``` diff --git a/doc/api/groups.md b/doc/api/groups.md index 411e5e5f8ca..f74aa4c200f 100644 --- a/doc/api/groups.md +++ b/doc/api/groups.md @@ -251,7 +251,7 @@ Parameters: | `with_custom_attributes` | boolean | no | Include [custom attributes](custom_attributes.md) in response (admins only). | | `with_projects` | boolean | no | Include details from projects that belong to the specified group (defaults to `true`). | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/4 ``` @@ -431,7 +431,7 @@ Additional response parameters: When adding the parameter `with_projects=false`, projects will not be returned. -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/4?with_projects=false ``` @@ -542,7 +542,7 @@ PUT /groups/:id | `shared_runners_minutes_limit` | integer | no | **(STARTER ONLY)** Pipeline minutes quota for this group. | | `extra_shared_runners_minutes_limit` | integer | no | **(STARTER ONLY)** Extra pipeline minutes quota for this group. | -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5?name=Experimental" ``` diff --git a/doc/api/import.md b/doc/api/import.md index 1deb26e8388..0f8a9bc71d1 100644 --- a/doc/api/import.md +++ b/doc/api/import.md @@ -15,7 +15,7 @@ POST /import/github | `new_name` | string | no | New repo name | | `target_namespace` | string | yes | Namespace to import repo into | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" --data "personal_access_token=abc123&repo_id=12345&target_namespace=root" https://gitlab.example.com/api/v4/import/github ``` diff --git a/doc/api/issue_links.md b/doc/api/issue_links.md index 7c7901d5551..941cc0b1347 100644 --- a/doc/api/issue_links.md +++ b/doc/api/issue_links.md @@ -69,7 +69,7 @@ POST /projects/:id/issues/:issue_iid/links | `target_issue_iid` | integer/string | yes | The internal ID of a target project's issue | | `link_type` | string | no | The type of the relation ("relates_to", "blocks", "is_blocked_by"), defaults to "relates_to"). Ignored unless `issue_link_types` feature flag is enabled. | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/4/issues/1/links?target_project_id=5&target_issue_iid=1" ``` diff --git a/doc/api/issues.md b/doc/api/issues.md index 3c28b55d1d6..68fcc55acf2 100644 --- a/doc/api/issues.md +++ b/doc/api/issues.md @@ -68,7 +68,7 @@ GET /issues?confidential=true | `confidential` | Boolean | no | Filter confidential or public issues. | | `not` | Hash | no | Return issues that do not match the parameters supplied. Accepts: `labels`, `milestone`, `author_id`, `author_username`, `assignee_id`, `assignee_username`, `my_reaction_emoji`, `search`, `in` | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/issues ``` @@ -223,7 +223,7 @@ GET /groups/:id/issues?confidential=true | `confidential` | Boolean | no | Filter confidential or public issues. | | `not` | Hash | no | Return issues that do not match the parameters supplied. Accepts: `labels`, `milestone`, `author_id`, `author_username`, `assignee_id`, `assignee_username`, `my_reaction_emoji`, `search`, `in` | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/4/issues ``` @@ -377,7 +377,7 @@ GET /projects/:id/issues?confidential=true | `confidential` | Boolean | no | Filter confidential or public issues. | | `not` | Hash | no | Return issues that do not match the parameters supplied. Accepts: `labels`, `milestone`, `author_id`, `author_username`, `assignee_id`, `assignee_username`, `my_reaction_emoji`, `search`, `in` | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/4/issues ``` @@ -505,7 +505,7 @@ GET /projects/:id/issues/:issue_iid | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `issue_iid` | integer | yes | The internal ID of a project's issue | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/4/issues/41 ``` @@ -658,7 +658,7 @@ POST /projects/:id/issues | `epic_id` **(ULTIMATE)** | integer | no | ID of the epic to add the issue to. Valid values are greater than or equal to 0. | | `epic_iid` **(ULTIMATE)** | integer | no | IID of the epic to add the issue to. Valid values are greater than or equal to 0. (deprecated, [will be removed in 13.0](https://gitlab.com/gitlab-org/gitlab/issues/35157)) | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/4/issues?title=Issues%20with%20auth&labels=bug ``` @@ -766,7 +766,7 @@ PUT /projects/:id/issues/:issue_iid | `epic_id` **(ULTIMATE)** | integer | no | ID of the epic to add the issue to. Valid values are greater than or equal to 0. | | `epic_iid` **(ULTIMATE)** | integer | no | IID of the epic to add the issue to. Valid values are greater than or equal to 0. (deprecated, [will be removed in 13.0](https://gitlab.com/gitlab-org/gitlab/issues/35157)) | -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/4/issues/85?state_event=close ``` @@ -867,7 +867,7 @@ DELETE /projects/:id/issues/:issue_iid | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `issue_iid` | integer | yes | The internal ID of a project's issue | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/4/issues/85 ``` @@ -890,7 +890,7 @@ POST /projects/:id/issues/:issue_iid/move | `issue_iid` | integer | yes | The internal ID of a project's issue | | `to_project_id` | integer | yes | The ID of the new project | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" --form to_project_id=5 https://gitlab.example.com/api/v4/projects/4/issues/85/move ``` @@ -996,7 +996,7 @@ POST /projects/:id/issues/:issue_iid/subscribe | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `issue_iid` | integer | yes | The internal ID of a project's issue | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/issues/93/subscribe ``` @@ -1102,7 +1102,7 @@ POST /projects/:id/issues/:issue_iid/unsubscribe | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `issue_iid` | integer | yes | The internal ID of a project's issue | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/issues/93/unsubscribe ``` @@ -1173,7 +1173,7 @@ POST /projects/:id/issues/:issue_iid/todo | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `issue_iid` | integer | yes | The internal ID of a project's issue | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/issues/93/todo ``` @@ -1288,7 +1288,7 @@ POST /projects/:id/issues/:issue_iid/time_estimate | `issue_iid` | integer | yes | The internal ID of a project's issue | | `duration` | string | yes | The duration in human format. e.g: 3h30m | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/issues/93/time_estimate?duration=3h30m ``` @@ -1316,7 +1316,7 @@ POST /projects/:id/issues/:issue_iid/reset_time_estimate | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `issue_iid` | integer | yes | The internal ID of a project's issue | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/issues/93/reset_time_estimate ``` @@ -1345,7 +1345,7 @@ POST /projects/:id/issues/:issue_iid/add_spent_time | `issue_iid` | integer | yes | The internal ID of a project's issue | | `duration` | string | yes | The duration in human format. e.g: 3h30m | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/issues/93/add_spent_time?duration=1h ``` @@ -1373,7 +1373,7 @@ POST /projects/:id/issues/:issue_iid/reset_spent_time | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `issue_iid` | integer | yes | The internal ID of a project's issue | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/issues/93/reset_spent_time ``` @@ -1399,7 +1399,7 @@ GET /projects/:id/issues/:issue_iid/time_stats | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `issue_iid` | integer | yes | The internal ID of a project's issue | -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/issues/93/time_stats ``` @@ -1427,7 +1427,7 @@ GET /projects/:id/issues/:issue_id/related_merge_requests | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `issue_iid` | integer | yes | The internal ID of a project's issue | -```sh +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/issues/11/related_merge_requests ``` @@ -1583,7 +1583,7 @@ GET /projects/:id/issues/:issue_iid/closed_by | `id` | integer | yes | The ID of a project | | `issue_iid` | integer | yes | The internal ID of a project issue | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/issues/11/closed_by ``` @@ -1656,7 +1656,7 @@ GET /projects/:id/issues/:issue_iid/participants | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `issue_iid` | integer | yes | The internal ID of a project's issue | -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/issues/93/participants ``` @@ -1700,7 +1700,7 @@ GET /projects/:id/issues/:issue_iid/user_agent_detail | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `issue_iid` | integer | yes | The internal ID of a project's issue | -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/issues/93/user_agent_detail ``` diff --git a/doc/api/issues_statistics.md b/doc/api/issues_statistics.md index d7edb296be2..2c391166088 100644 --- a/doc/api/issues_statistics.md +++ b/doc/api/issues_statistics.md @@ -45,7 +45,7 @@ GET /issues_statistics?confidential=true | `updated_before` | datetime | no | Return issues updated on or before the given time | | `confidential` | Boolean | no | Filter confidential or public issues. | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/issues_statistics ``` @@ -101,7 +101,7 @@ GET /groups/:id/issues_statistics?confidential=true | `updated_before` | datetime | no | Return issues updated on or before the given time | | `confidential` | Boolean | no | Filter confidential or public issues. | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/4/issues_statistics ``` @@ -157,7 +157,7 @@ GET /projects/:id/issues_statistics?confidential=true | `updated_before` | datetime | no | Return issues updated on or before the given time | | `confidential` | Boolean | no | Filter confidential or public issues. | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/4/issues_statistics ``` diff --git a/doc/api/jobs.md b/doc/api/jobs.md index 5f661ac4c76..b9efb20d140 100644 --- a/doc/api/jobs.md +++ b/doc/api/jobs.md @@ -13,7 +13,7 @@ GET /projects/:id/jobs | `id` | integer/string | yes | ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user. | | `scope` | string **or** array of strings | no | Scope of jobs to show. Either one of or an array of the following: `created`, `pending`, `running`, `failed`, `success`, `canceled`, `skipped`, or `manual`. All jobs are returned if `scope` is not provided. | -```sh +```shell curl --globoff --header "PRIVATE-TOKEN: <your_access_token>" 'https://gitlab.example.com/api/v4/projects/1/jobs?scope[]=pending&scope[]=running' ``` @@ -148,7 +148,7 @@ GET /projects/:id/pipelines/:pipeline_id/jobs | `pipeline_id` | integer | yes | ID of a pipeline. | | `scope` | string **or** array of strings | no | Scope of jobs to show. Either one of or an array of the following: `created`, `pending`, `running`, `failed`, `success`, `canceled`, `skipped`, or `manual`. All jobs are returned if `scope` is not provided. | -```sh +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" 'https://gitlab.example.com/api/v4/projects/1/pipelines/6/jobs?scope[]=pending&scope[]=running' ``` @@ -282,7 +282,7 @@ GET /projects/:id/jobs/:job_id | `id` | integer/string | yes | ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user. | | `job_id` | integer | yes | ID of a job. | -```sh +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/jobs/8" ``` @@ -363,7 +363,7 @@ GET /projects/:id/jobs/:job_id/artifacts Example request using the `PRIVATE-TOKEN` header: -```sh +```shell curl --output artifacts.zip --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/jobs/42/artifacts" ``` @@ -429,7 +429,7 @@ Parameters Example request using the `PRIVATE-TOKEN` header: -```sh +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/jobs/artifacts/master/download?job=test" ``` @@ -490,7 +490,7 @@ Parameters Example request: -```sh +```shell curl --location --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/jobs/5/artifacts/some/release/file.pdf" ``` @@ -525,7 +525,7 @@ Parameters: Example request: -```sh +```shell curl --location --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/jobs/artifacts/master/raw/some/release/file.pdf?job=pdf" ``` @@ -550,7 +550,7 @@ GET /projects/:id/jobs/:job_id/trace | id | integer/string | yes | ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user. | | job_id | integer | yes | ID of a job. | -```sh +```shell curl --location --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/jobs/8/trace" ``` @@ -574,7 +574,7 @@ POST /projects/:id/jobs/:job_id/cancel | `id` | integer/string | yes | ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user. | | `job_id` | integer | yes | ID of a job. | -```sh +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/jobs/1/cancel" ``` @@ -623,7 +623,7 @@ POST /projects/:id/jobs/:job_id/retry | `id` | integer/string | yes | ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user. | | `job_id` | integer | yes | ID of a job. | -```sh +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/jobs/1/retry" ``` @@ -676,7 +676,7 @@ Parameters Example of request -```sh +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/jobs/1/erase" ``` @@ -730,7 +730,7 @@ Parameters Example request: -```sh +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/jobs/1/artifacts/keep" ``` @@ -784,7 +784,7 @@ DELETE /projects/:id/jobs/:job_id/artifacts Example request: -```sh +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/jobs/1/artifacts" ``` @@ -806,7 +806,7 @@ POST /projects/:id/jobs/:job_id/play | `id` | integer/string | yes | ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user. | | `job_id` | integer | yes | ID of a job. | -```sh +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/jobs/1/play" ``` diff --git a/doc/api/keys.md b/doc/api/keys.md index e05b1191715..05933e5a1d1 100644 --- a/doc/api/keys.md +++ b/doc/api/keys.md @@ -14,7 +14,7 @@ GET /keys/:id Example request: -```sh +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" 'https://gitlab.example.com/api/v4/keys/1 ``` @@ -72,7 +72,7 @@ GET /keys Example request: -```sh +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" 'https://gitlab.example.com/api/v4/keys?fingerprint=ba:81:59:68:d7:6c:cd:02:02:bf:6a:9b:55:4e:af:d1' ``` @@ -80,7 +80,7 @@ If using sha256 fingerprint API calls, make sure that the fingerprint is URL-enc For example, `/` is represented by `%2F` and `:` is represented by`%3A`: -```sh +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" 'https://gitlab.example.com/api/v4/keys?fingerprint=SHA256%3AnUhzNyftwADy8AH3wFY31tAKs7HufskYTte2aXo%2FlCg ``` @@ -138,7 +138,7 @@ fingerprint you get additional information about the projects using that key. Example request: -```sh +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" 'https://gitlab.example.com/api/v4/keys?fingerprint=SHA256%3AnUhzNyftwADy8AH3wFY31tAKs7HufskYTte2aXo%2FlCg ``` diff --git a/doc/api/labels.md b/doc/api/labels.md index ac5156e8c20..f8757b71339 100644 --- a/doc/api/labels.md +++ b/doc/api/labels.md @@ -17,7 +17,7 @@ GET /projects/:id/labels | `with_counts` | boolean | no | Whether or not to include issue and merge request counts. Defaults to `false`. _([Introduced in GitLab 12.2](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/31543))_ | | `include_ancestor_groups` | boolean | no | Include ancestor groups. Defaults to `true`. | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/labels?with_counts=true ``` @@ -112,7 +112,7 @@ GET /projects/:id/labels/:label_id | `label_id` | integer or string | yes | The ID or title of a group's label. | | `include_ancestor_groups` | boolean | no | Include ancestor groups. Defaults to `true`. | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/labels/bug ``` @@ -151,7 +151,7 @@ POST /projects/:id/labels | `description` | string | no | The description of the label | | `priority` | integer | no | The priority of the label. Must be greater or equal than zero or `null` to remove the priority. | -```bash +```shell curl --data "name=feature&color=#5843AD" --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/labels" ``` @@ -187,7 +187,7 @@ DELETE /projects/:id/labels/:label_id | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `label_id` | integer or string | yes | The ID or title of a group's label. | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/labels/bug" ``` @@ -211,7 +211,7 @@ PUT /projects/:id/labels/:label_id | `description` | string | no | The new description of the label | | `priority` | integer | no | The new priority of the label. Must be greater or equal than zero or `null` to remove the priority. | -```bash +```shell curl --request PUT --data "new_name=docs&color=#8E44AD&description=Documentation" --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/labels/documentation" ``` @@ -251,7 +251,7 @@ PUT /projects/:id/labels/:label_id/promote | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `label_id` | integer or string | yes | The ID or title of a group's label. | -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/labels/documentation/promote" ``` @@ -288,7 +288,7 @@ POST /projects/:id/labels/:label_id/subscribe | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `label_id` | integer or string | yes | The ID or title of a project's label | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/labels/1/subscribe ``` @@ -326,6 +326,6 @@ POST /projects/:id/labels/:label_id/unsubscribe | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `label_id` | integer or string | yes | The ID or title of a project's label | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/labels/1/unsubscribe ``` diff --git a/doc/api/license.md b/doc/api/license.md index c56a5fee95a..2be26e1bddf 100644 --- a/doc/api/license.md +++ b/doc/api/license.md @@ -101,7 +101,7 @@ POST /license | --------- | ---- | -------- | ----------- | | `license` | string | yes | The license string | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/license?license=eyJkYXRhIjoiMHM5Q...S01Udz09XG4ifQ==" ``` @@ -145,7 +145,7 @@ DELETE /license/:id | --------- | ---- | -------- | ----------- | | `id` | integer | yes | ID of the GitLab license. | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/license/:id" ``` diff --git a/doc/api/lint.md b/doc/api/lint.md index 80750992c51..c24d891a7e2 100644 --- a/doc/api/lint.md +++ b/doc/api/lint.md @@ -12,7 +12,7 @@ POST /ci/lint | ---------- | ------- | -------- | -------- | | `content` | string | yes | the `.gitlab-ci.yaml` content| -```bash +```shell curl --header "Content-Type: application/json" https://gitlab.example.com/api/v4/ci/lint --data '{"content": "{ \"image\": \"ruby:2.6\", \"services\": [\"postgres\"], \"before_script\": [\"bundle install\", \"bundle exec rake db:create\"], \"variables\": {\"DB_NAME\": \"postgres\"}, \"types\": [\"test\", \"deploy\", \"notify\"], \"rspec\": { \"script\": \"rake spec\", \"tags\": [\"ruby\", \"postgres\"], \"only\": [\"branches\"]}}"}' ``` diff --git a/doc/api/managed_licenses.md b/doc/api/managed_licenses.md index 1af7567626f..34b1e5dc6dc 100644 --- a/doc/api/managed_licenses.md +++ b/doc/api/managed_licenses.md @@ -12,7 +12,7 @@ GET /projects/:id/managed_licenses | --------- | ------- | -------- | --------------------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/managed_licenses ``` @@ -46,7 +46,7 @@ GET /projects/:id/managed_licenses/:managed_license_id | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `managed_license_id` | integer/string | yes | The ID or URL-encoded name of the license belonging to the project | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/managed_licenses/6" ``` @@ -74,7 +74,7 @@ POST /projects/:id/managed_licenses | `name` | string | yes | The name of the managed license | | `approval_status` | string | yes | The approval status. "approved" or "blacklisted" | -```bash +```shell curl --data "name=MIT&approval_status=blacklisted" --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/managed_licenses" ``` @@ -101,7 +101,7 @@ DELETE /projects/:id/managed_licenses/:managed_license_id | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `managed_license_id` | integer/string | yes | The ID or URL-encoded name of the license belonging to the project | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/managed_licenses/4" ``` @@ -121,7 +121,7 @@ PATCH /projects/:id/managed_licenses/:managed_license_id | `managed_license_id` | integer/string | yes | The ID or URL-encoded name of the license belonging to the project | | `approval_status` | string | yes | The approval status. "approved" or "blacklisted" | -```bash +```shell curl --request PATCH --data "approval_status=blacklisted" --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/managed_licenses/6" ``` diff --git a/doc/api/markdown.md b/doc/api/markdown.md index f4ad1de9ad8..5f6aa72903b 100644 --- a/doc/api/markdown.md +++ b/doc/api/markdown.md @@ -16,7 +16,7 @@ POST /api/v4/markdown | `gfm` | boolean | no (optional) | Render text using GitLab Flavored Markdown. Default is `false` | | `project` | string | no (optional) | Use `project` as a context when creating references using GitLab Flavored Markdown. [Authentication](README.html#authentication) is required if a project is not public. | -```bash +```shell curl --header Content-Type:application/json --data '{"text":"Hello world! :tada:", "gfm":true, "project":"group_example/project_example"}' https://gitlab.example.com/api/v4/markdown ``` diff --git a/doc/api/members.md b/doc/api/members.md index 50dcf86c972..a81a9097c3f 100644 --- a/doc/api/members.md +++ b/doc/api/members.md @@ -28,7 +28,7 @@ GET /projects/:id/members | `query` | string | no | A query string to search for members | | `user_ids` | array of integers | no | Filter the results on the given user IDs | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/:id/members curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/:id/members ``` @@ -77,7 +77,7 @@ GET /projects/:id/members/all | `query` | string | no | A query string to search for members | | `user_ids` | array of integers | no | Filter the results on the given user IDs | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/:id/members/all curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/:id/members/all ``` @@ -133,7 +133,7 @@ GET /projects/:id/members/:user_id | `id` | integer/string | yes | The ID or [URL-encoded path of the project or group](README.md#namespaced-path-encoding) owned by the authenticated user | | `user_id` | integer | yes | The user ID of the member | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/:id/members/:user_id curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/:id/members/:user_id ``` @@ -169,7 +169,7 @@ GET /projects/:id/members/all/:user_id | `id` | integer/string | yes | The ID or [URL-encoded path of the project or group](README.md#namespaced-path-encoding) owned by the authenticated user | | `user_id` | integer | yes | The user ID of the member | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/:id/members/all/:user_id curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/:id/members/all/:user_id ``` @@ -205,7 +205,7 @@ POST /projects/:id/members | `access_level` | integer | yes | A valid access level | | `expires_at` | string | no | A date string in the format YEAR-MONTH-DAY | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --data "user_id=1&access_level=30" https://gitlab.example.com/api/v4/groups/:id/members curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --data "user_id=1&access_level=30" https://gitlab.example.com/api/v4/projects/:id/members ``` @@ -241,7 +241,7 @@ PUT /projects/:id/members/:user_id | `access_level` | integer | yes | A valid access level | | `expires_at` | string | no | A date string in the format YEAR-MONTH-DAY | -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/:id/members/:user_id?access_level=40 curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/:id/members/:user_id?access_level=40 ``` @@ -275,7 +275,7 @@ DELETE /projects/:id/members/:user_id | `id` | integer/string | yes | The ID or [URL-encoded path of the project or group](README.md#namespaced-path-encoding) owned by the authenticated user | | `user_id` | integer | yes | The user ID of the member | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/:id/members/:user_id curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/:id/members/:user_id ``` diff --git a/doc/api/merge_request_context_commits.md b/doc/api/merge_request_context_commits.md index 4b8edf657e4..a4659204127 100644 --- a/doc/api/merge_request_context_commits.md +++ b/doc/api/merge_request_context_commits.md @@ -27,15 +27,7 @@ Parameters: "authored_date": "2017-04-11T10:08:59.000Z", "committer_name": "Luke \"Jared\" Bennett", "committer_email": "lbennett@gitlab.com", - "committed_date": "2017-04-11T10:08:59.000Z", - "author": null, - "author_gravatar_url": "https://www.gravatar.com/avatar/2acf1fb99417a2b3971def5a294abbeb?s=80&d=identicon", - "commit_url": "http://127.0.0.1:3000/gitlab-org/gitlab-test/commit/4a24d82dbca5c11c61556f3b35ca472b7463187e", - "commit_path": "/gitlab-org/gitlab-test/commit/4a24d82dbca5c11c61556f3b35ca472b7463187e", - "description_html": "", - "title_html": "Update README.md to include `Usage in testing and development`", - "signature_html": null, - "pipeline_status_path": null + "committed_date": "2017-04-11T10:08:59.000Z" } ] ``` diff --git a/doc/api/merge_requests.md b/doc/api/merge_requests.md index 127a510aae6..266f419e9be 100644 --- a/doc/api/merge_requests.md +++ b/doc/api/merge_requests.md @@ -1272,7 +1272,7 @@ DELETE /projects/:id/merge_requests/:merge_request_iid | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `merge_request_iid` | integer | yes | The internal ID of the merge request | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/4/merge_requests/85 ``` @@ -1630,7 +1630,7 @@ PUT /projects/:id/merge_requests/:merge_request_iid/rebase | `merge_request_iid` | integer | yes | The internal ID of the merge request | | `skip_ci` | boolean | no | Set to `true` to skip creating a CI pipeline | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/76/merge_requests/1/rebase ``` @@ -1692,7 +1692,7 @@ GET /projects/:id/merge_requests/:merge_request_iid/closes_issues | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `merge_request_iid` | integer | yes | The internal ID of the merge request | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/76/merge_requests/1/closes_issues ``` @@ -1768,7 +1768,7 @@ POST /projects/:id/merge_requests/:merge_request_iid/subscribe | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `merge_request_iid` | integer | yes | The internal ID of the merge request | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/merge_requests/17/subscribe ``` @@ -1919,7 +1919,7 @@ POST /projects/:id/merge_requests/:merge_request_iid/unsubscribe | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `merge_request_iid` | integer | yes | The internal ID of the merge request | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/merge_requests/17/unsubscribe ``` @@ -2070,7 +2070,7 @@ POST /projects/:id/merge_requests/:merge_request_iid/todo | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `merge_request_iid` | integer | yes | The internal ID of the merge request | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/merge_requests/27/todo ``` @@ -2187,7 +2187,7 @@ GET /projects/:id/merge_requests/:merge_request_iid/versions | `id` | String | yes | The ID of the project | | `merge_request_iid` | integer | yes | The internal ID of the merge request | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/merge_requests/1/versions ``` @@ -2229,7 +2229,7 @@ GET /projects/:id/merge_requests/:merge_request_iid/versions/:version_id | `merge_request_iid` | integer | yes | The internal ID of the merge request | | `version_id` | integer | yes | The ID of the merge request diff version | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/merge_requests/1/versions/1 ``` @@ -2297,7 +2297,7 @@ POST /projects/:id/merge_requests/:merge_request_iid/time_estimate | `merge_request_iid` | integer | yes | The internal ID of the merge request | | `duration` | string | yes | The duration in human format. e.g: 3h30m | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/merge_requests/93/time_estimate?duration=3h30m ``` @@ -2325,7 +2325,7 @@ POST /projects/:id/merge_requests/:merge_request_iid/reset_time_estimate | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `merge_request_iid` | integer | yes | The internal ID of a project's merge_request | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/merge_requests/93/reset_time_estimate ``` @@ -2354,7 +2354,7 @@ POST /projects/:id/merge_requests/:merge_request_iid/add_spent_time | `merge_request_iid` | integer | yes | The internal ID of the merge request | | `duration` | string | yes | The duration in human format. e.g: 3h30m | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/merge_requests/93/add_spent_time?duration=1h ``` @@ -2382,7 +2382,7 @@ POST /projects/:id/merge_requests/:merge_request_iid/reset_spent_time | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `merge_request_iid` | integer | yes | The internal ID of a project's merge_request | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/merge_requests/93/reset_spent_time ``` @@ -2408,7 +2408,7 @@ GET /projects/:id/merge_requests/:merge_request_iid/time_stats | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `merge_request_iid` | integer | yes | The internal ID of the merge request | -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/merge_requests/93/time_stats ``` diff --git a/doc/api/milestones.md b/doc/api/milestones.md index f3a1b7323ec..43faf04a709 100644 --- a/doc/api/milestones.md +++ b/doc/api/milestones.md @@ -24,7 +24,7 @@ Parameters: | `title` | string | optional | Return only the milestones having the given `title` | | `search` | string | optional | Return only milestones with a title or description matching the provided string | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/milestones ``` diff --git a/doc/api/namespaces.md b/doc/api/namespaces.md index 2b6eddf78a1..872385b8b5e 100644 --- a/doc/api/namespaces.md +++ b/doc/api/namespaces.md @@ -18,7 +18,7 @@ GET /namespaces Example request: -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/namespaces ``` @@ -84,7 +84,7 @@ GET /namespaces?search=foobar Example request: -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/namespaces?search=twitter ``` @@ -118,7 +118,7 @@ GET /namespaces/:id Example request: -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/namespaces/2 ``` @@ -138,7 +138,7 @@ Example response: Example request: -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/namespaces/group1 ``` diff --git a/doc/api/notes.md b/doc/api/notes.md index 2cace425ff2..abf1be171c9 100644 --- a/doc/api/notes.md +++ b/doc/api/notes.md @@ -79,7 +79,7 @@ GET /projects/:id/issues/:issue_iid/notes?sort=asc&order_by=updated_at ] ``` -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/issues/11/notes ``` @@ -97,7 +97,7 @@ Parameters: - `issue_iid` (required) - The IID of a project issue - `note_id` (required) - The ID of an issue note -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/issues/11/notes/1 ``` @@ -116,7 +116,7 @@ Parameters: - `body` (required) - The content of a note. Limited to 1,000,000 characters. - `created_at` (optional) - Date time string, ISO 8601 formatted, e.g. 2016-03-11T03:45:40Z (requires admin or project/group owner rights) -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/issues/11/notes?body=note ``` @@ -135,7 +135,7 @@ Parameters: - `note_id` (required) - The ID of a note - `body` (required) - The content of a note. Limited to 1,000,000 characters. -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/issues/11/notes?body=note ``` @@ -155,7 +155,7 @@ Parameters: | `issue_iid` | integer | yes | The IID of an issue | | `note_id` | integer | yes | The ID of a note | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/issues/11/notes/636 ``` @@ -177,7 +177,7 @@ GET /projects/:id/snippets/:snippet_id/notes?sort=asc&order_by=updated_at | `sort` | string | no | Return snippet notes sorted in `asc` or `desc` order. Default is `desc` | `order_by` | string | no | Return snippet notes ordered by `created_at` or `updated_at` fields. Default is `created_at` -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/snippets/11/notes ``` @@ -214,7 +214,7 @@ Parameters: } ``` -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/snippets/11/notes/11 ``` @@ -234,7 +234,7 @@ Parameters: - `body` (required) - The content of a note. Limited to 1,000,000 characters. - `created_at` (optional) - Date time string, ISO 8601 formatted, e.g. 2016-03-11T03:45:40Z -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/snippet/11/notes?body=note ``` @@ -253,7 +253,7 @@ Parameters: - `note_id` (required) - The ID of a note - `body` (required) - The content of a note. Limited to 1,000,000 characters. -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/snippets/11/notes?body=note ``` @@ -273,7 +273,7 @@ Parameters: | `snippet_id` | integer | yes | The ID of a snippet | | `note_id` | integer | yes | The ID of a note | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/snippets/52/notes/1659 ``` @@ -295,7 +295,7 @@ GET /projects/:id/merge_requests/:merge_request_iid/notes?sort=asc&order_by=upda | `sort` | string | no | Return merge request notes sorted in `asc` or `desc` order. Default is `desc` | `order_by` | string | no | Return merge request notes ordered by `created_at` or `updated_at` fields. Default is `created_at` -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/merge_requests/11/notes ``` @@ -336,7 +336,7 @@ Parameters: } ``` -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/merge_requests/11/notes/1 ``` @@ -372,7 +372,7 @@ Parameters: - `note_id` (required) - The ID of a note - `body` (required) - The content of a note. Limited to 1,000,000 characters. -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/merge_requests/11/notes?body=note ``` @@ -392,7 +392,7 @@ Parameters: | `merge_request_iid` | integer | yes | The IID of a merge request | | `note_id` | integer | yes | The ID of a note | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/merge_requests/7/notes/1602 ``` @@ -414,7 +414,7 @@ GET /groups/:id/epics/:epic_id/notes?sort=asc&order_by=updated_at | `sort` | string | no | Return epic notes sorted in `asc` or `desc` order. Default is `desc` | | `order_by` | string | no | Return epic notes ordered by `created_at` or `updated_at` fields. Default is `created_at` | -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/epics/11/notes ``` @@ -453,7 +453,7 @@ Parameters: } ``` -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/epics/11/notes/1 ``` @@ -474,7 +474,7 @@ Parameters: | `epic_id` | integer | yes | The ID of an epic | | `body` | string | yes | The content of a note. Limited to 1,000,000 characters. | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/snippet/11/notes?body=note ``` @@ -495,7 +495,7 @@ Parameters: | `note_id` | integer | yes | The ID of a note | | `body` | string | yes | The content of a note. Limited to 1,000,000 characters. | -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/snippet/11/notes?body=note ``` @@ -515,6 +515,6 @@ Parameters: | `epic_id` | integer | yes | The ID of an epic | | `note_id` | integer | yes | The ID of a note | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/epics/52/notes/1659 ``` diff --git a/doc/api/notification_settings.md b/doc/api/notification_settings.md index 1bd9ea7bcfd..b6b74c8ee96 100644 --- a/doc/api/notification_settings.md +++ b/doc/api/notification_settings.md @@ -41,7 +41,7 @@ Get current notification settings and email address. GET /notification_settings ``` -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/notification_settings ``` @@ -62,7 +62,7 @@ Update current notification settings and email address. PUT /notification_settings ``` -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/notification_settings?level=watch ``` @@ -104,7 +104,7 @@ GET /groups/:id/notification_settings GET /projects/:id/notification_settings ``` -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/notification_settings curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/8/notification_settings ``` @@ -130,7 +130,7 @@ PUT /groups/:id/notification_settings PUT /projects/:id/notification_settings ``` -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/notification_settings?level=watch curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/8/notification_settings?level=custom&new_note=true ``` diff --git a/doc/api/oauth2.md b/doc/api/oauth2.md index 6b49a39b83a..9030feb13a7 100644 --- a/doc/api/oauth2.md +++ b/doc/api/oauth2.md @@ -175,7 +175,7 @@ the following parameters: Example cURL request: -```sh +```shell echo 'grant_type=password&username=<your_username>&password=<your_password>' > auth.txt curl --data "@auth.txt" --request POST https://gitlab.example.com/oauth/token ``` diff --git a/doc/api/packages.md b/doc/api/packages.md index cadd5f0dc75..798c83e65d4 100644 --- a/doc/api/packages.md +++ b/doc/api/packages.md @@ -19,7 +19,7 @@ GET /projects/:id/packages | --------- | ---- | -------- | ----------- | | `id` | integer/string | yes | ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/:id/packages ``` @@ -62,7 +62,7 @@ GET /groups/:id/packages | `id` | integer/string | yes | ID or [URL-encoded path of the group](README.md#namespaced-path-encoding). | | `exclude_subgroups` | boolean | false | If the param is included as true, packages from projects from subgroups are not listed. Default is `false`. | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/:id/packages?exclude_subgroups=true ``` @@ -139,7 +139,7 @@ GET /projects/:id/packages/:package_id | `id` | integer/string | yes | ID or [URL-encoded path of the project](README.md#namespaced-path-encoding). | | `package_id` | integer | yes | ID of a package. | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/:id/packages/:package_id ``` @@ -190,7 +190,7 @@ GET /projects/:id/packages/:package_id/package_files | `id` | integer/string | yes | ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) | | `package_id` | integer | yes | ID of a package. | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/packages/4/package_files ``` @@ -245,7 +245,7 @@ DELETE /projects/:id/packages/:package_id | `id` | integer/string | yes | ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) | | `package_id` | integer | yes | ID of a package. | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/:id/packages/:package_id ``` diff --git a/doc/api/pages.md b/doc/api/pages.md index 0babca61650..a529dfe26ae 100644 --- a/doc/api/pages.md +++ b/doc/api/pages.md @@ -16,6 +16,6 @@ DELETE /projects/:id/pages | --------- | -------------- | -------- | ---------------------------------------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | -```bash +```shell curl --request 'DELETE' --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/2/pages ``` diff --git a/doc/api/pages_domains.md b/doc/api/pages_domains.md index 9d482781cde..311d0eee722 100644 --- a/doc/api/pages_domains.md +++ b/doc/api/pages_domains.md @@ -12,7 +12,7 @@ Get a list of all pages domains. The user must have admin permissions. GET /pages/domains ``` -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/pages/domains ``` @@ -43,7 +43,7 @@ GET /projects/:id/pages/domains | --------- | -------------- | -------- | ---------------------------------------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/pages/domains ``` @@ -80,7 +80,7 @@ GET /projects/:id/pages/domains/:domain | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `domain` | string | yes | The custom domain indicated by the user | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/pages/domains/www.domain.example ``` @@ -91,7 +91,7 @@ curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/ap } ``` -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/pages/domains/ssl.domain.example ``` @@ -125,15 +125,15 @@ POST /projects/:id/pages/domains | `certificate` | file/string | no | The certificate in PEM format with intermediates following in most specific to least specific order.| | `key` | file/string | no | The certificate key in PEM format. | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --form "domain=ssl.domain.example" --form "certificate=@/path/to/cert.pem" --form "key=@/path/to/key.pem" https://gitlab.example.com/api/v4/projects/5/pages/domains ``` -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --form "domain=ssl.domain.example" --form "certificate=$CERT_PEM" --form "key=$KEY_PEM" https://gitlab.example.com/api/v4/projects/5/pages/domains ``` -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --form "domain=ssl.domain.example" --form "auto_ssl_enabled=true" https://gitlab.example.com/api/v4/projects/5/pages/domains ``` @@ -169,11 +169,11 @@ PUT /projects/:id/pages/domains/:domain ### Adding certificate -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" --form "certificate=@/path/to/cert.pem" --form "key=@/path/to/key.pem" https://gitlab.example.com/api/v4/projects/5/pages/domains/ssl.domain.example ``` -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" --form "certificate=$CERT_PEM" --form "key=$KEY_PEM" https://gitlab.example.com/api/v4/projects/5/pages/domains/ssl.domain.example ``` @@ -193,7 +193,7 @@ curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" --form "certifi ### Enabling Let's Encrypt integration for Pages custom domains -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" --form "auto_ssl_enabled=true" https://gitlab.example.com/api/v4/projects/5/pages/domains/ssl.domain.example ``` @@ -209,7 +209,7 @@ curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" --form "auto_ss To remove the SSL certificate attached to the Pages domain, run: -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" --form "certificate=" --form "key=" https://gitlab.example.com/api/v4/projects/5/pages/domains/ssl.domain.example ``` @@ -234,6 +234,6 @@ DELETE /projects/:id/pages/domains/:domain | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `domain` | string | yes | The custom domain indicated by the user | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/pages/domains/ssl.domain.example ``` diff --git a/doc/api/pipeline_schedules.md b/doc/api/pipeline_schedules.md index 59e89c3d256..f859a01cd37 100644 --- a/doc/api/pipeline_schedules.md +++ b/doc/api/pipeline_schedules.md @@ -15,7 +15,7 @@ GET /projects/:id/pipeline_schedules | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `scope` | string | no | The scope of pipeline schedules, one of: `active`, `inactive` | -```sh +```shell curl --header "PRIVATE-TOKEN: k5ESFgWY2Qf5xEvDcFxZ" "https://gitlab.example.com/api/v4/projects/29/pipeline_schedules" ``` @@ -56,7 +56,7 @@ GET /projects/:id/pipeline_schedules/:pipeline_schedule_id | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `pipeline_schedule_id` | integer | yes | The pipeline schedule id | -```sh +```shell curl --header "PRIVATE-TOKEN: k5ESFgWY2Qf5xEvDcFxZ" "https://gitlab.example.com/api/v4/projects/29/pipeline_schedules/13" ``` @@ -112,7 +112,7 @@ POST /projects/:id/pipeline_schedules | `cron_timezone` | string | no | The timezone supported by `ActiveSupport::TimeZone` (e.g. `Pacific Time (US & Canada)`) (default: `'UTC'`) | | `active` | boolean | no | The activation of pipeline schedule. If false is set, the pipeline schedule will deactivated initially (default: `true`) | -```sh +```shell curl --request POST --header "PRIVATE-TOKEN: k5ESFgWY2Qf5xEvDcFxZ" --form description="Build packages" --form ref="master" --form cron="0 1 * * 5" --form cron_timezone="UTC" --form active="true" "https://gitlab.example.com/api/v4/projects/29/pipeline_schedules" ``` @@ -157,7 +157,7 @@ PUT /projects/:id/pipeline_schedules/:pipeline_schedule_id | `cron_timezone` | string | no | The timezone supported by `ActiveSupport::TimeZone` (e.g. `Pacific Time (US & Canada)`) or `TZInfo::Timezone` (e.g. `America/Los_Angeles`) | | `active` | boolean | no | The activation of pipeline schedule. If false is set, the pipeline schedule will deactivated initially. | -```sh +```shell curl --request PUT --header "PRIVATE-TOKEN: k5ESFgWY2Qf5xEvDcFxZ" --form cron="0 2 * * *" "https://gitlab.example.com/api/v4/projects/29/pipeline_schedules/13" ``` @@ -202,7 +202,7 @@ POST /projects/:id/pipeline_schedules/:pipeline_schedule_id/take_ownership | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `pipeline_schedule_id` | integer | yes | The pipeline schedule id | -```sh +```shell curl --request POST --header "PRIVATE-TOKEN: hf2CvZXB9w8Uc5pZKpSB" "https://gitlab.example.com/api/v4/projects/29/pipeline_schedules/13/take_ownership" ``` @@ -247,7 +247,7 @@ DELETE /projects/:id/pipeline_schedules/:pipeline_schedule_id | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `pipeline_schedule_id` | integer | yes | The pipeline schedule id | -```sh +```shell curl --request DELETE --header "PRIVATE-TOKEN: k5ESFgWY2Qf5xEvDcFxZ" "https://gitlab.example.com/api/v4/projects/29/pipeline_schedules/13" ``` @@ -299,7 +299,7 @@ POST /projects/:id/pipeline_schedules/:pipeline_schedule_id/variables | `value` | string | yes | The `value` of a variable | | `variable_type` | string | no | The type of a variable. Available types are: `env_var` (default) and `file` | -```sh +```shell curl --request POST --header "PRIVATE-TOKEN: k5ESFgWY2Qf5xEvDcFxZ" --form "key=NEW_VARIABLE" --form "value=new value" "https://gitlab.example.com/api/v4/projects/29/pipeline_schedules/13/variables" ``` @@ -327,7 +327,7 @@ PUT /projects/:id/pipeline_schedules/:pipeline_schedule_id/variables/:key | `value` | string | yes | The `value` of a variable | | `variable_type` | string | no | The type of a variable. Available types are: `env_var` (default) and `file` | -```sh +```shell curl --request PUT --header "PRIVATE-TOKEN: k5ESFgWY2Qf5xEvDcFxZ" --form "value=updated value" "https://gitlab.example.com/api/v4/projects/29/pipeline_schedules/13/variables/NEW_VARIABLE" ``` @@ -353,7 +353,7 @@ DELETE /projects/:id/pipeline_schedules/:pipeline_schedule_id/variables/:key | `pipeline_schedule_id` | integer | yes | The pipeline schedule id | | `key` | string | yes | The `key` of a variable | -```sh +```shell curl --request DELETE --header "PRIVATE-TOKEN: k5ESFgWY2Qf5xEvDcFxZ" "https://gitlab.example.com/api/v4/projects/29/pipeline_schedules/13/variables/NEW_VARIABLE" ``` diff --git a/doc/api/project_badges.md b/doc/api/project_badges.md index 0cf22808036..df3a0b9f5af 100644 --- a/doc/api/project_badges.md +++ b/doc/api/project_badges.md @@ -25,7 +25,7 @@ GET /projects/:id/badges | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `name` | string | no | Name of the badges to return (case-sensitive). | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/:id/badges ``` @@ -67,7 +67,7 @@ GET /projects/:id/badges/:badge_id | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `badge_id` | integer | yes | The badge ID | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/:id/badges/:badge_id ``` @@ -98,7 +98,7 @@ POST /projects/:id/badges | `link_url` | string | yes | URL of the badge link | | `image_url` | string | yes | URL of the badge image | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --data "link_url=https://gitlab.com/gitlab-org/gitlab-foss/commits/master&image_url=https://shields.io/my/badge1&position=0" https://gitlab.example.com/api/v4/projects/:id/badges ``` @@ -130,7 +130,7 @@ PUT /projects/:id/badges/:badge_id | `link_url` | string | no | URL of the badge link | | `image_url` | string | no | URL of the badge image | -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/:id/badges/:badge_id ``` @@ -160,7 +160,7 @@ DELETE /projects/:id/badges/:badge_id | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `badge_id` | integer | yes | The badge ID | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/:id/badges/:badge_id ``` @@ -178,7 +178,7 @@ GET /projects/:id/badges/render | `link_url` | string | yes | URL of the badge link| | `image_url` | string | yes | URL of the badge image | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/:id/badges/render?link_url=http%3A%2F%2Fexample.com%2Fci_status.svg%3Fproject%3D%25%7Bproject_path%7D%26ref%3D%25%7Bdefault_branch%7D&image_url=https%3A%2F%2Fshields.io%2Fmy%2Fbadge ``` diff --git a/doc/api/project_clusters.md b/doc/api/project_clusters.md index 1aa225d30ab..b52f96d0f2e 100644 --- a/doc/api/project_clusters.md +++ b/doc/api/project_clusters.md @@ -21,7 +21,7 @@ Parameters: Example request: -```bash +```shell curl --header 'Private-Token: <your_access_token>' https://gitlab.example.com/api/v4/projects/26/clusters ``` @@ -77,7 +77,7 @@ Example response: Gets a single project cluster. -```bash +```shell GET /projects/:id/clusters/:cluster_id ``` @@ -90,7 +90,7 @@ Parameters: Example request: -```bash +```shell curl --header 'Private-Token: <your_access_token>' https://gitlab.example.com/api/v4/projects/26/clusters/18 ``` @@ -168,7 +168,7 @@ Example response: Adds an existing Kubernetes cluster to the project. -```bash +```shell POST /projects/:id/clusters/user ``` @@ -190,7 +190,7 @@ Parameters: Example request: -```bash +```shell curl --header 'Private-Token: <your_access_token>' https://gitlab.example.com/api/v4/projects/26/clusters/user \ -H "Accept: application/json" \ -H "Content-Type:application/json" \ @@ -261,7 +261,7 @@ Example response: Updates an existing project cluster. -```bash +```shell PUT /projects/:id/clusters/:cluster_id ``` @@ -287,7 +287,7 @@ through the ["Add existing cluster to project"](#add-existing-cluster-to-project Example request: -```bash +```shell curl --header 'Private-Token: <your_access_token>' https://gitlab.example.com/api/v4/projects/26/clusters/24 \ -H "Content-Type:application/json" \ -X PUT --data '{"name":"new-cluster-name","domain":"new-domain.com","api_url":"https://new-api-url.com"}' @@ -381,6 +381,6 @@ Parameters: Example request: -```bash +```shell curl --request DELETE --header 'Private-Token: <your_access_token>' https://gitlab.example.com/api/v4/projects/26/clusters/23 ``` diff --git a/doc/api/project_import_export.md b/doc/api/project_import_export.md index cd02d423a9f..b239c59bc66 100644 --- a/doc/api/project_import_export.md +++ b/doc/api/project_import_export.md @@ -28,7 +28,7 @@ POST /projects/:id/export | `upload[url]` | string | yes | The URL to upload the project | | `upload[http_method]` | string | no | The HTTP method to upload the exported project. Only `PUT` and `POST` methods allowed. Default is `PUT` | -```sh +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/export \ --data "upload[http_method]=PUT" \ --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" @@ -52,7 +52,7 @@ GET /projects/:id/export | --------- | -------------- | -------- | ---------------------------------------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | -```sh +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/export ``` @@ -93,11 +93,11 @@ GET /projects/:id/export/download | --------- | -------------- | -------- | ---------------------------------------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | -```sh +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" --remote-header-name --remote-name https://gitlab.example.com/api/v4/projects/5/export/download ``` -```sh +```shell ls *export.tar.gz 2017-12-05_22-11-148_namespace_project_export.tar.gz ``` @@ -124,7 +124,7 @@ cURL to post data using the header `Content-Type: multipart/form-data`. The `file=` parameter must point to a file on your file system and be preceded by `@`. For example: -```sh +```shell 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 ``` @@ -174,7 +174,7 @@ GET /projects/:id/import | --------- | -------------- | -------- | ---------------------------------------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | -```sh +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/import ``` diff --git a/doc/api/project_snippets.md b/doc/api/project_snippets.md index 7a6c90701ba..3f40845fddc 100644 --- a/doc/api/project_snippets.md +++ b/doc/api/project_snippets.md @@ -83,7 +83,7 @@ Parameters: Example request: -```bash +```shell curl --request POST https://gitlab.com/api/v4/projects/:id/snippets \ --header "PRIVATE-TOKEN: <your access token>" \ --header "Content-Type: application/json" \ @@ -122,7 +122,7 @@ Parameters: Example request: -```bash +```shell curl --request PUT https://gitlab.com/api/v4/projects/:id/snippets \ --header "PRIVATE-TOKEN: <your_access_token>" \ --header "Content-Type: application/json" \ @@ -156,7 +156,7 @@ Parameters: Example request: -```bash +```shell curl --request DELETE https://gitlab.com/api/v4/projects/:id/snippets \ --header "PRIVATE-TOKEN: <your_access_token>" ``` @@ -176,7 +176,7 @@ Parameters: Example request: -```bash +```shell curl --request GET https://gitlab.com/api/v4/projects/:id/snippets/:snippet_id/raw \ --header "PRIVATE-TOKEN: <your_access_token>" ``` @@ -198,7 +198,7 @@ GET /projects/:id/snippets/:snippet_id/user_agent_detail Example request: -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/snippets/2/user_agent_detail ``` diff --git a/doc/api/projects.md b/doc/api/projects.md index ad1cc4ea1b7..59d4a37f02c 100644 --- a/doc/api/projects.md +++ b/doc/api/projects.md @@ -552,7 +552,7 @@ GET /users/:user_id/starred_projects | `with_merge_requests_enabled` | boolean | no | Limit by enabled merge requests feature. | | `min_access_level` | integer | no | Limit by current user minimal [access level](members.md). | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/users/5/starred_projects" ``` @@ -1236,7 +1236,7 @@ GET /projects/:id/forks | `with_merge_requests_enabled` | boolean | no | Limit by enabled merge requests feature | | `min_access_level` | integer | no | Limit by current user minimal [access level](members.md) | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/forks" ``` @@ -1320,7 +1320,7 @@ POST /projects/:id/star | --------- | ---- | -------- | ----------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/star" ``` @@ -1410,7 +1410,7 @@ POST /projects/:id/unstar | --------- | ---- | -------- | ----------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/unstar" ``` @@ -1500,7 +1500,7 @@ GET /projects/:id/starrers | --------- | ---- | -------- | ----------- | | `search` | string | no | Search for specific users. | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/starrers" ``` @@ -1541,7 +1541,7 @@ Get languages used in a project with percentage value. GET /projects/:id/languages ``` -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/languages" ``` @@ -1569,7 +1569,7 @@ POST /projects/:id/archive | --------- | ---- | -------- | ----------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/archive" ``` @@ -1678,7 +1678,7 @@ POST /projects/:id/unarchive | --------- | ---- | -------- | ----------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/unarchive" ``` @@ -1823,7 +1823,7 @@ cURL to post data using the header `Content-Type: multipart/form-data`. The `file=` parameter must point to a file on your filesystem and be preceded by `@`. For example: -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --form "file=@dk.png" https://gitlab.example.com/api/v4/projects/5/uploads ``` @@ -1869,7 +1869,7 @@ DELETE /projects/:id/share/:group_id | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) | | `group_id` | integer | yes | The ID of the group | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/share/17 ``` @@ -2037,7 +2037,7 @@ GET /projects | `order_by` | string | no | Return requests ordered by `id`, `name`, `created_at` or `last_activity_at` fields | | `sort` | string | no | Return requests sorted in `asc` or `desc` order | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects?search=test ``` @@ -2196,7 +2196,7 @@ POST /projects/:id/mirror/pull | --------- | ---- | -------- | ----------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/:id/mirror/pull ``` diff --git a/doc/api/protected_branches.md b/doc/api/protected_branches.md index e6844536c33..d95aa1323f7 100644 --- a/doc/api/protected_branches.md +++ b/doc/api/protected_branches.md @@ -25,7 +25,7 @@ GET /projects/:id/protected_branches | --------- | ---- | -------- | ----------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" 'https://gitlab.example.com/api/v4/projects/5/protected_branches' ``` @@ -99,7 +99,7 @@ GET /projects/:id/protected_branches/:name | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `name` | string | yes | The name of the branch or wildcard | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" 'https://gitlab.example.com/api/v4/projects/5/protected_branches/master' ``` @@ -163,7 +163,7 @@ branches using a wildcard protected branch. POST /projects/:id/protected_branches ``` -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" 'https://gitlab.example.com/api/v4/projects/5/protected_branches?name=*-stable&push_access_level=30&merge_access_level=30&unprotect_access_level=40' ``` @@ -249,7 +249,7 @@ Example response: Elements in the `allowed_to_push` / `allowed_to_merge` / `allowed_to_unprotect` array should take the form `{user_id: integer}`, `{group_id: integer}` or `{access_level: integer}`. Each user must have access to the project and each group must [have this project shared](../user/project/members/share_project_with_groups.md). These access levels allow [more granular control over protected branch access](../user/project/protected_branches.md#restricting-push-and-merge-access-to-certain-users-starter) and were [added to the API in](https://gitlab.com/gitlab-org/gitlab/merge_requests/3516) in GitLab 10.3 EE. -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" 'https://gitlab.example.com/api/v4/projects/5/protected_branches?name=*-stable&allowed_to_push%5B%5D%5Buser_id%5D=1' ``` @@ -295,7 +295,7 @@ Unprotects the given protected branch or wildcard protected branch. DELETE /projects/:id/protected_branches/:name ``` -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" 'https://gitlab.example.com/api/v4/projects/5/protected_branches/*-stable' ``` @@ -312,7 +312,7 @@ Update the "code owner approval required" option for the given protected branch PATCH /projects/:id/protected_branches/:name ``` -```bash +```shell curl --request PATCH --header "PRIVATE-TOKEN: <your_access_token>" 'https://gitlab.example.com/api/v4/projects/5/protected_branches/feature-branch' ``` diff --git a/doc/api/protected_tags.md b/doc/api/protected_tags.md index fb6fa040244..a5490094a44 100644 --- a/doc/api/protected_tags.md +++ b/doc/api/protected_tags.md @@ -25,7 +25,7 @@ GET /projects/:id/protected_tags | --------- | ---- | -------- | ----------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" 'https://gitlab.example.com/api/v4/projects/5/protected_tags' ``` @@ -60,7 +60,7 @@ GET /projects/:id/protected_tags/:name | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `name` | string | yes | The name of the tag or wildcard | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" 'https://gitlab.example.com/api/v4/projects/5/protected_tags/release-1-0' ``` @@ -87,7 +87,7 @@ tags using a wildcard protected tag. POST /projects/:id/protected_tags ``` -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" 'https://gitlab.example.com/api/v4/projects/5/protected_tags?name=*-stable&create_access_level=30' ``` @@ -119,7 +119,7 @@ Unprotects the given protected tag or wildcard protected tag. DELETE /projects/:id/protected_tags/:name ``` -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" 'https://gitlab.example.com/api/v4/projects/5/protected_tags/*-stable' ``` diff --git a/doc/api/releases/index.md b/doc/api/releases/index.md index b5e24188043..e24dea3c278 100644 --- a/doc/api/releases/index.md +++ b/doc/api/releases/index.md @@ -19,7 +19,7 @@ GET /projects/:id/releases Example request: -```sh +```shell curl --header "PRIVATE-TOKEN: gDybLx3yrUK_HLp3qPjS" "https://gitlab.example.com/api/v4/projects/24/releases" ``` @@ -202,7 +202,7 @@ GET /projects/:id/releases/:tag_name Example request: -```sh +```shell curl --header "PRIVATE-TOKEN: gDybLx3yrUK_HLp3qPjS" "https://gitlab.example.com/api/v4/projects/24/releases/v0.1" ``` @@ -322,7 +322,7 @@ POST /projects/:id/releases Example request: -```sh +```shell curl --header 'Content-Type: application/json' --header "PRIVATE-TOKEN: gDybLx3yrUK_HLp3qPjS" \ --data '{ "name": "New release", "tag_name": "v0.3", "description": "Super nice release", "milestones": ["v1.0", "v1.0-rc"], "assets": { "links": [{ "name": "hoge", "url": "https://google.com" }] } }' \ --request POST https://gitlab.example.com/api/v4/projects/24/releases @@ -445,7 +445,7 @@ PUT /projects/:id/releases/:tag_name Example request: -```sh +```shell curl --header 'Content-Type: application/json' --request PUT --data '{"name": "new name", "milestones": ["v1.2"]}' --header "PRIVATE-TOKEN: gDybLx3yrUK_HLp3qPjS" "https://gitlab.example.com/api/v4/projects/24/releases/v0.1" ``` @@ -544,7 +544,7 @@ DELETE /projects/:id/releases/:tag_name Example request: -```sh +```shell curl --request DELETE --header "PRIVATE-TOKEN: gDybLx3yrUK_HLp3qPjS" "https://gitlab.example.com/api/v4/projects/24/releases/v0.1" ``` diff --git a/doc/api/releases/links.md b/doc/api/releases/links.md index 3392cf765c1..2a9e0ccb664 100644 --- a/doc/api/releases/links.md +++ b/doc/api/releases/links.md @@ -20,7 +20,7 @@ GET /projects/:id/releases/:tag_name/assets/links Example request: -```sh +```shell curl --header "PRIVATE-TOKEN: gDybLx3yrUK_HLp3qPjS" "https://gitlab.example.com/api/v4/projects/24/releases/v0.1/assets/links" ``` @@ -59,7 +59,7 @@ GET /projects/:id/releases/:tag_name/assets/links/:link_id Example request: -```sh +```shell curl --header "PRIVATE-TOKEN: gDybLx3yrUK_HLp3qPjS" "https://gitlab.example.com/api/v4/projects/24/releases/v0.1/assets/links/1" ``` @@ -91,7 +91,7 @@ POST /projects/:id/releases/:tag_name/assets/links Example request: -```sh +```shell curl --request POST \ --header "PRIVATE-TOKEN: gDybLx3yrUK_HLp3qPjS" \ --data name="awesome-v0.2.dmg" \ @@ -131,7 +131,7 @@ You have to specify at least one of `name` or `url` Example request: -```sh +```shell curl --request PUT --data name="new name" --header "PRIVATE-TOKEN: gDybLx3yrUK_HLp3qPjS" "https://gitlab.example.com/api/v4/projects/24/releases/v0.1/assets/links/1" ``` @@ -162,7 +162,7 @@ DELETE /projects/:id/releases/:tag_name/assets/links/:link_id Example request: -```sh +```shell curl --request DELETE --header "PRIVATE-TOKEN: gDybLx3yrUK_HLp3qPjS" "https://gitlab.example.com/api/v4/projects/24/releases/v0.1/assets/links/1" ``` diff --git a/doc/api/repositories.md b/doc/api/repositories.md index faa30043423..3e34e1522e4 100644 --- a/doc/api/repositories.md +++ b/doc/api/repositories.md @@ -121,7 +121,7 @@ Parameters: - `id` (required) - The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user - `sha` (optional) - The commit SHA to download. A tag, branch reference, or SHA can be used. This defaults to the tip of the default branch if not specified. For example: -```sh +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.com/api/v4/projects/<project_id>/repository/archive?sha=<commit_sha> ``` @@ -227,7 +227,7 @@ GET /projects/:id/repository/merge_base | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) | | `refs` | array | yes | The refs to find the common ancestor of, multiple refs can be passed | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/repository/merge_base?refs[]=304d257dcb821665ab5110318fc58a007bd104ed&refs[]=0031876facac3f2b2702a0e53a26e89939a42209" ``` diff --git a/doc/api/repository_files.md b/doc/api/repository_files.md index d2ad4558641..a4e63fbe21d 100644 --- a/doc/api/repository_files.md +++ b/doc/api/repository_files.md @@ -24,7 +24,7 @@ without authentication if the repository is publicly accessible. GET /projects/:id/repository/files/:file_path ``` -```bash +```shell curl --request GET --header 'PRIVATE-TOKEN: <your_access_token>' 'https://gitlab.example.com/api/v4/projects/13083/repository/files/app%2Fmodels%2Fkey%2Erb?ref=master' ``` @@ -59,7 +59,7 @@ In addition to the `GET` method, you can also use `HEAD` to get just file metada HEAD /projects/:id/repository/files/:file_path ``` -```bash +```shell curl --head --header 'PRIVATE-TOKEN: <your_access_token>' 'https://gitlab.example.com/api/v4/projects/13083/repository/files/app%2Fmodels%2Fkey%2Erb?ref=master' ``` @@ -88,7 +88,7 @@ Allows you to receive blame information. Each blame range contains lines and cor GET /projects/:id/repository/files/:file_path/blame ``` -```bash +```shell curl --request GET --header 'PRIVATE-TOKEN: <your_access_token>' 'https://gitlab.example.com/api/v4/projects/13083/repository/files/path%2Fto%2Ffile.rb/blame?ref=master' ``` @@ -128,7 +128,7 @@ Parameters: NOTE: **Note:** `HEAD` method return just file metadata as in [Get file from repository](repository_files.md#get-file-from-repository). -```bash +```shell curl --head --header 'PRIVATE-TOKEN: <your_access_token>' 'https://gitlab.example.com/api/v4/projects/13083/repository/files/path%2Fto%2Ffile.rb/blame?ref=master' ``` @@ -155,7 +155,7 @@ X-Gitlab-Size: 1476 GET /projects/:id/repository/files/:file_path/raw ``` -```bash +```shell curl --request GET --header 'PRIVATE-TOKEN: <your_access_token>' 'https://gitlab.example.com/api/v4/projects/13083/repository/files/app%2Fmodels%2Fkey%2Erb/raw?ref=master' ``` @@ -175,7 +175,7 @@ This allows you to create a single file. For creating multiple files with a sing POST /projects/:id/repository/files/:file_path ``` -```bash +```shell curl --request POST --header 'PRIVATE-TOKEN: <your_access_token>' --header "Content-Type: application/json" \ --data '{"branch": "master", "author_email": "author@example.com", "author_name": "Firstname Lastname", \ "content": "some content", "commit_message": "create a new file"}' \ @@ -210,7 +210,7 @@ This allows you to update a single file. For updating multiple files with a sing PUT /projects/:id/repository/files/:file_path ``` -```bash +```shell curl --request PUT --header 'PRIVATE-TOKEN: <your_access_token>' --header "Content-Type: application/json" \ --data '{"branch": "master", "author_email": "author@example.com", "author_name": "Firstname Lastname", \ "content": "some content", "commit_message": "update file"}' \ @@ -256,7 +256,7 @@ This allows you to delete a single file. For deleting multiple files with a sing DELETE /projects/:id/repository/files/:file_path ``` -```bash +```shell curl --request DELETE --header 'PRIVATE-TOKEN: <your_access_token>' --header "Content-Type: application/json" \ --data '{"branch": "master", "author_email": "author@example.com", "author_name": "Firstname Lastname", \ "commit_message": "delete file"}' \ diff --git a/doc/api/repository_submodules.md b/doc/api/repository_submodules.md index 556a351ac1d..59f6131fc96 100644 --- a/doc/api/repository_submodules.md +++ b/doc/api/repository_submodules.md @@ -21,7 +21,7 @@ PUT /projects/:id/repository/submodules/:submodule | `commit_sha` | string | yes | Full commit SHA to update the submodule to | | `commit_message` | string | no | Commit message. If no message is provided, a default one will be set | -```sh +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/repository/submodules/lib%2Fmodules%2Fexample" --data "branch=master&commit_sha=3ddec28ea23acc5caa5d8331a6ecb2a65fc03e88&commit_message=Update submodule reference" ``` diff --git a/doc/api/resource_label_events.md b/doc/api/resource_label_events.md index 7ad4d78014c..4753b2e3c90 100644 --- a/doc/api/resource_label_events.md +++ b/doc/api/resource_label_events.md @@ -64,7 +64,7 @@ GET /projects/:id/issues/:issue_iid/resource_label_events ] ``` -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/issues/11/resource_label_events ``` @@ -84,7 +84,7 @@ Parameters: | `issue_iid` | integer | yes | The IID of an issue | | `resource_label_event_id` | integer | yes | The ID of a label event | -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/issues/11/resource_label_events/1 ``` @@ -150,7 +150,7 @@ GET /groups/:id/epics/:epic_id/resource_label_events ] ``` -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/1/epics/11/resource_label_events ``` @@ -170,7 +170,7 @@ Parameters: | `epic_id` | integer | yes | The ID of an epic | | `resource_label_event_id` | integer | yes | The ID of a label event | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/1/epics/11/resource_label_events/107 ``` @@ -236,7 +236,7 @@ GET /projects/:id/merge_requests/:merge_request_iid/resource_label_events ] ``` -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/merge_requests/11/resource_label_events ``` @@ -256,6 +256,6 @@ Parameters: | `merge_request_iid` | integer | yes | The IID of a merge request | | `resource_label_event_id` | integer | yes | The ID of a label event | -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/merge_requests/11/resource_label_events/120 ``` diff --git a/doc/api/scim.md b/doc/api/scim.md index cf9d8ebbec2..be36f0e8053 100644 --- a/doc/api/scim.md +++ b/doc/api/scim.md @@ -31,7 +31,7 @@ Pagination follows the [SCIM spec](https://tools.ietf.org/html/rfc7644#section-3 Example request: -```sh +```shell curl 'https://example.gitlab.com/api/scim/v2/groups/test_group/Users?filter=id%20eq%20"0b1d561c-21ff-4092-beab-8154b17f82f2"' --header "Authorization: Bearer <your_scim_token>" --header "Content-Type: application/scim+json" ``` @@ -82,7 +82,7 @@ Parameters: Example request: -```sh +```shell curl 'https://example.gitlab.com/api/scim/v2/groups/test_group/Users/f0b1d561c-21ff-4092-beab-8154b17f82f2' --header "Authorization: Bearer <your_scim_token>" --header "Content-Type: application/scim+json" ``` @@ -126,7 +126,7 @@ Parameters: Example request: -```sh +```shell curl --verbose --request POST 'https://example.gitlab.com/api/scim/v2/groups/test_group/Users' --data '{"externalId":"test_uid","active":null,"userName":"username","emails":[{"primary":true,"type":"work","value":"name@example.com"}],"name":{"formatted":"Test User","familyName":"User","givenName":"Test"},"schemas":["urn:ietf:params:scim:schemas:core:2.0:User"],"meta":{"resourceType":"User"}}' --header "Authorization: Bearer <your_scim_token>" --header "Content-Type: application/scim+json" ``` @@ -180,7 +180,7 @@ Parameters: Example request: -```sh +```shell curl --verbose --request PATCH 'https://example.gitlab.com/api/scim/v2/groups/test_group/Users/f0b1d561c-21ff-4092-beab-8154b17f82f2' --data '{ "Operations": [{"op":"Add","path":"name.formatted","value":"New Name"}] }' --header "Authorization: Bearer <your_scim_token>" --header "Content-Type: application/scim+json" ``` @@ -203,7 +203,7 @@ Parameters: Example request: -```sh +```shell curl --verbose --request DELETE 'https://example.gitlab.com/api/scim/v2/groups/test_group/Users/f0b1d561c-21ff-4092-beab-8154b17f82f2' --header "Authorization: Bearer <your_scim_token>" --header "Content-Type: application/scim+json" ``` diff --git a/doc/api/search.md b/doc/api/search.md index 46209fb753f..bac259651f8 100644 --- a/doc/api/search.md +++ b/doc/api/search.md @@ -25,7 +25,7 @@ The response depends on the requested scope. ### Scope: projects -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/search?scope=projects&search=flight ``` @@ -56,7 +56,7 @@ Example response: ### Scope: issues -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/search?scope=issues&search=file ``` @@ -121,7 +121,7 @@ Example response: ### Scope: merge_requests -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/search?scope=merge_requests&search=file ``` @@ -199,7 +199,7 @@ Example response: ### Scope: milestones -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/search?scope=milestones&search=release ``` @@ -224,7 +224,7 @@ Example response: ### Scope: snippet_titles -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/search?scope=snippet_titles&search=sample ``` @@ -255,7 +255,7 @@ Example response: ### Scope: snippet_blobs -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/search?scope=snippet_blobs&search=test ``` @@ -288,7 +288,7 @@ Example response: This scope is available only if [Elasticsearch](../integration/elasticsearch.md) is enabled. -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/search?scope=wiki_blobs&search=bye ``` @@ -316,7 +316,7 @@ Example response: This scope is available only if [Elasticsearch](../integration/elasticsearch.md) is enabled. -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/search?scope=commits&search=bye ``` @@ -359,7 +359,7 @@ to use a filter simply include it in your query like so: `a query filename:some_ You may use wildcards (`*`) to use glob matching. -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/search?scope=blobs&search=installation ``` @@ -385,7 +385,7 @@ Example response: ### Scope: users -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/search?scope=users&search=doe ``` @@ -428,7 +428,7 @@ The response depends on the requested scope. ### Scope: projects -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/3/search?scope=projects&search=flight ``` @@ -459,7 +459,7 @@ Example response: ### Scope: issues -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/3/search?scope=issues&search=file ``` @@ -524,7 +524,7 @@ Example response: ### Scope: merge_requests -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/3/search?scope=merge_requests&search=file ``` @@ -602,7 +602,7 @@ Example response: ### Scope: milestones -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/3/search?scope=milestones&search=release ``` @@ -629,7 +629,7 @@ Example response: This scope is available only if [Elasticsearch](../integration/elasticsearch.md) is enabled. -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/6/search?scope=wiki_blobs&search=bye ``` @@ -657,7 +657,7 @@ Example response: This scope is available only if [Elasticsearch](../integration/elasticsearch.md) is enabled. -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/6/search?scope=commits&search=bye ``` @@ -700,7 +700,7 @@ to use a filter simply include it in your query like so: `a query filename:some_ You may use wildcards (`*`) to use glob matching. -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/6/search?scope=blobs&search=installation ``` @@ -726,7 +726,7 @@ Example response: ### Scope: users -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/3/search?scope=users&search=doe ``` @@ -768,7 +768,7 @@ The response depends on the requested scope. ### Scope: issues -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/12/search?scope=issues&search=file ``` @@ -833,7 +833,7 @@ Example response: ### Scope: merge_requests -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/6/search?scope=merge_requests&search=file ``` @@ -911,7 +911,7 @@ Example response: ### Scope: milestones -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/12/search?scope=milestones&search=release ``` @@ -936,7 +936,7 @@ Example response: ### Scope: notes -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/6/search?scope=notes&search=maxime ``` @@ -985,7 +985,7 @@ results: might be found in both the filename and content, or might appear multiple times in the content. -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/6/search?scope=wiki_blobs&search=bye ``` @@ -1011,7 +1011,7 @@ Example response: ### Scope: commits -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/6/search?scope=commits&search=bye ``` @@ -1058,7 +1058,7 @@ Blobs searches are performed on both filenames and contents. Search results: might be found in both the filename and content, or might appear multiple times in the content. -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/6/search?scope=blobs&search=installation&ref=feature ``` @@ -1084,7 +1084,7 @@ Example response: ### Scope: users -```bash +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/6/search?scope=users&search=doe ``` diff --git a/doc/api/settings.md b/doc/api/settings.md index ed07bbc575d..51680be88e8 100644 --- a/doc/api/settings.md +++ b/doc/api/settings.md @@ -14,7 +14,7 @@ of the GitLab instance. GET /application/settings ``` -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/application/settings ``` @@ -94,7 +94,7 @@ Use an API call to modify GitLab instance PUT /application/settings ``` -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/application/settings?signup_enabled=false&default_project_visibility=internal ``` diff --git a/doc/api/sidekiq_metrics.md b/doc/api/sidekiq_metrics.md index 95449d1ff77..76aa04077c7 100644 --- a/doc/api/sidekiq_metrics.md +++ b/doc/api/sidekiq_metrics.md @@ -14,7 +14,7 @@ latency. GET /sidekiq/queue_metrics ``` -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/sidekiq/queue_metrics ``` @@ -39,7 +39,7 @@ List information about all the Sidekiq workers registered to process your queues GET /sidekiq/process_metrics ``` -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/sidekiq/process_metrics ``` @@ -81,7 +81,7 @@ List information about the jobs that Sidekiq has performed. GET /sidekiq/job_stats ``` -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/sidekiq/job_stats ``` @@ -106,7 +106,7 @@ List all the currently available information about Sidekiq. GET /sidekiq/compound_metrics ``` -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/sidekiq/compound_metrics ``` diff --git a/doc/api/snippets.md b/doc/api/snippets.md index b953c3c094a..5d9cc42d147 100644 --- a/doc/api/snippets.md +++ b/doc/api/snippets.md @@ -27,7 +27,7 @@ GET /snippets Example request: -```sh +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/snippets ``` @@ -94,7 +94,7 @@ Parameters: Example request: -```sh +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/snippets/1 ``` @@ -138,7 +138,7 @@ Parameters: Example request: -```sh +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/snippets/1/raw ``` @@ -171,7 +171,7 @@ Parameters: Example request: -```sh +```shell curl --request POST \ --data '{"title": "This is a snippet", "content": "Hello world", "description": "Hello World snippet", "file_name": "test.txt", "visibility": "internal" }' \ --header 'Content-Type: application/json' \ @@ -227,7 +227,7 @@ Parameters: Example request: -```sh +```shell curl --request PUT \ --data '{"title": "foo", "content": "bar"}' \ --header 'Content-Type: application/json' \ @@ -275,7 +275,7 @@ Parameters: Example request: -```sh +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/snippets/1" ``` @@ -303,7 +303,7 @@ Parameters: Example request: -```sh +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/snippets/public?per_page=2&page=1 ``` @@ -366,7 +366,7 @@ GET /snippets/:id/user_agent_detail Example request: -```sh +```shell curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/snippets/1/user_agent_detail ``` diff --git a/doc/api/statistics.md b/doc/api/statistics.md index 5078b2f26d4..c7713ab2dae 100644 --- a/doc/api/statistics.md +++ b/doc/api/statistics.md @@ -12,7 +12,7 @@ These statistics are approximate. GET /application/statistics ``` -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/application/statistics ``` diff --git a/doc/api/suggestions.md b/doc/api/suggestions.md index 188989bc94e..f95ab82848a 100644 --- a/doc/api/suggestions.md +++ b/doc/api/suggestions.md @@ -15,7 +15,7 @@ PUT /suggestions/:id/apply | --------- | ---- | -------- | ----------- | | `id` | integer/string | yes | The ID of a suggestion | -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/suggestions/5/apply ``` diff --git a/doc/api/system_hooks.md b/doc/api/system_hooks.md index b09b11dfd2a..1e34adc5320 100644 --- a/doc/api/system_hooks.md +++ b/doc/api/system_hooks.md @@ -17,7 +17,7 @@ GET /hooks Example request: -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/hooks ``` @@ -58,7 +58,7 @@ POST /hooks Example request: -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/hooks?url=https://gitlab.example.com/hook" ``` @@ -91,7 +91,7 @@ GET /hooks/:id Example request: -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/hooks/2 ``` @@ -122,6 +122,6 @@ DELETE /hooks/:id Example request: -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/hooks/2 ``` diff --git a/doc/api/tags.md b/doc/api/tags.md index 11291065edc..a796b758328 100644 --- a/doc/api/tags.md +++ b/doc/api/tags.md @@ -68,7 +68,7 @@ Parameters: | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `tag_name` | string | yes | The name of the tag | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/repository/tags/v1.0.0 ``` @@ -116,7 +116,7 @@ Parameters: - `message` (optional) - Creates annotated tag. - `release_description` (optional) - Add release notes to the Git tag and store it in the GitLab database. -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/repository/tags?tag_name=test&ref=master" ``` diff --git a/doc/api/templates/dockerfiles.md b/doc/api/templates/dockerfiles.md index ee271c31b49..4453d3692c7 100644 --- a/doc/api/templates/dockerfiles.md +++ b/doc/api/templates/dockerfiles.md @@ -16,7 +16,7 @@ Get all Dockerfile templates. GET /templates/dockerfiles ``` -```bash +```shell curl https://gitlab.example.com/api/v4/templates/dockerfiles ``` @@ -107,7 +107,7 @@ GET /templates/dockerfiles/:key | ---------- | ------ | -------- | ----------- | | `key` | string | yes | The key of the Dockerfile template | -```bash +```shell curl https://gitlab.example.com/api/v4/templates/dockerfiles/Binary ``` diff --git a/doc/api/templates/gitignores.md b/doc/api/templates/gitignores.md index 45820b24f10..3acd666ad66 100644 --- a/doc/api/templates/gitignores.md +++ b/doc/api/templates/gitignores.md @@ -18,7 +18,7 @@ GET /templates/gitignores Example request: -```bash +```shell curl https://gitlab.example.com/api/v4/templates/gitignores ``` @@ -123,7 +123,7 @@ GET /templates/gitignores/:key Example request: -```bash +```shell curl https://gitlab.example.com/api/v4/templates/gitignores/Ruby ``` diff --git a/doc/api/templates/gitlab_ci_ymls.md b/doc/api/templates/gitlab_ci_ymls.md index b8fdb9e233c..c88aee4d9a7 100644 --- a/doc/api/templates/gitlab_ci_ymls.md +++ b/doc/api/templates/gitlab_ci_ymls.md @@ -18,7 +18,7 @@ GET /templates/gitlab_ci_ymls Example request: -```bash +```shell curl https://gitlab.example.com/api/v4/templates/gitlab_ci_ymls ``` @@ -123,7 +123,7 @@ GET /templates/gitlab_ci_ymls/:key Example request: -```bash +```shell curl https://gitlab.example.com/api/v4/templates/gitlab_ci_ymls/Ruby ``` diff --git a/doc/api/templates/licenses.md b/doc/api/templates/licenses.md index 92466c73bd3..0b95e4d8065 100644 --- a/doc/api/templates/licenses.md +++ b/doc/api/templates/licenses.md @@ -21,7 +21,7 @@ GET /templates/licenses | --------- | ------- | -------- | --------------------- | | `popular` | boolean | no | If passed, returns only popular licenses | -```bash +```shell curl https://gitlab.example.com/api/v4/templates/licenses?popular=1 ``` @@ -124,7 +124,7 @@ GET /templates/licenses/:key If you omit the `fullname` parameter but authenticate your request, the name of the authenticated user will be used to replace the copyright holder placeholder. -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/templates/licenses/mit?project=My+Cool+Project ``` diff --git a/doc/api/todos.md b/doc/api/todos.md index b708b4391a2..5b92f4fb5f1 100644 --- a/doc/api/todos.md +++ b/doc/api/todos.md @@ -22,7 +22,7 @@ Parameters: | `state` | string | no | The state of the todo. Can be either `pending` or `done` | | `type` | string | no | The type of a todo. Can be either `Issue` or `MergeRequest` | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/todos ``` @@ -194,7 +194,7 @@ Parameters: | --------- | ---- | -------- | ----------- | | `id` | integer | yes | The ID of a todo | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/todos/130/mark_as_done ``` @@ -284,7 +284,7 @@ Marks all pending todos for the current user as done. It returns the HTTP status POST /todos/mark_as_done ``` -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/todos/mark_as_done ``` diff --git a/doc/api/users.md b/doc/api/users.md index 3f9ccc24054..e71278696de 100644 --- a/doc/api/users.md +++ b/doc/api/users.md @@ -554,7 +554,7 @@ Get the status of the currently signed in user. GET /user/status ``` -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/user/status" ``` @@ -580,7 +580,7 @@ GET /users/:id_or_username/status | ---------------- | ------ | -------- | ----------- | | `id_or_username` | string | yes | The id or username of the user to get a status of | -```bash +```shell curl "https://gitlab.example.com/users/janedoe/status" ``` @@ -609,7 +609,7 @@ PUT /user/status When both parameters `emoji` and `message` are empty, the status will be cleared. -```bash +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" --data "emoji=coffee" --data "message=I crave coffee" https://gitlab.example.com/api/v4/user/status ``` @@ -635,7 +635,7 @@ Get the counts (same as in top right menu) of the currently signed in user. GET /user_counts ``` -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/user_counts" ``` @@ -799,7 +799,7 @@ Get a list of currently authenticated user's GPG keys. GET /user/gpg_keys ``` -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/user/gpg_keys ``` @@ -829,7 +829,7 @@ Parameters: | --------- | ------- | -------- | ----------- | | `key_id` | integer | yes | The ID of the GPG key | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/user/gpg_keys/1 ``` @@ -857,7 +857,7 @@ Parameters: | --------- | ------ | -------- | ----------- | | key | string | yes | The new GPG key | -```bash +```shell curl --data "key=-----BEGIN PGP PUBLIC KEY BLOCK-----\r\n\r\nxsBNBFV..." --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/user/gpg_keys ``` @@ -887,7 +887,7 @@ Parameters: | --------- | ------- | -------- | ----------- | | `key_id` | integer | yes | The ID of the GPG key | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/user/gpg_keys/1 ``` @@ -907,7 +907,7 @@ Parameters: | --------- | ------- | -------- | ----------- | | `id` | integer | yes | The ID of the user | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/users/2/gpg_keys ``` @@ -938,7 +938,7 @@ Parameters: | `id` | integer | yes | The ID of the user | | `key_id` | integer | yes | The ID of the GPG key | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/users/2/gpg_keys/1 ``` @@ -967,7 +967,7 @@ Parameters: | `id` | integer | yes | The ID of the user | | `key_id` | integer | yes | The ID of the GPG key | -```bash +```shell curl --data "key=-----BEGIN PGP PUBLIC KEY BLOCK-----\r\n\r\nxsBNBFV..." --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/users/2/gpg_keys ``` @@ -998,7 +998,7 @@ Parameters: | `id` | integer | yes | The ID of the user | | `key_id` | integer | yes | The ID of the GPG key | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/users/2/gpg_keys/1 ``` @@ -1386,7 +1386,7 @@ Parameters: | --------- | ---- | -------- | ----------- | | `from` | string | no | Date string in the format YEAR-MONTH-DAY, e.g. `2016-03-11`. Defaults to 6 months ago. | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/user/activities ``` @@ -1441,7 +1441,7 @@ Returns: - `403 Forbidden` when not requested by an admin. - `400 Bad Request` when requested type is not supported. -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/users/<user_id>/memberships ``` diff --git a/doc/api/version.md b/doc/api/version.md index ac19178b7ad..a89b8878298 100644 --- a/doc/api/version.md +++ b/doc/api/version.md @@ -9,7 +9,7 @@ authenticated users. GET /version ``` -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/version ``` diff --git a/doc/api/visual_review_discussions.md b/doc/api/visual_review_discussions.md index 385c1bf201d..a1076e09fc8 100644 --- a/doc/api/visual_review_discussions.md +++ b/doc/api/visual_review_discussions.md @@ -35,6 +35,6 @@ Parameters: | `position[x]` | integer | no | X coordinate (Only stored for `image` diff notes) | | `position[y]` | integer | no | Y coordinate (Only stored for `image` diff notes) | -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/merge_requests/11/visual_review_discussions?body=comment ``` diff --git a/doc/api/vulnerability_findings.md b/doc/api/vulnerability_findings.md index 3d3f12aeef5..18b9fb6c630 100644 --- a/doc/api/vulnerability_findings.md +++ b/doc/api/vulnerability_findings.md @@ -55,7 +55,7 @@ GET /projects/:id/vulnerability_findings?pipeline_id=42 | `confidence` | string array | no | Returns vulnerability findings belonging to specified confidence level: `undefined`, `ignore`, `unknown`, `experimental`, `low`, `medium`, `high`, or `confirmed`. Defaults to all. | | `pipeline_id` | integer/string | no | Returns vulnerability findings belonging to specified pipeline. | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/4/vulnerability_findings ``` diff --git a/doc/api/wikis.md b/doc/api/wikis.md index 035a89d80a5..57e5621277f 100644 --- a/doc/api/wikis.md +++ b/doc/api/wikis.md @@ -17,7 +17,7 @@ GET /projects/:id/wikis | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) | | `with_content` | boolean | no | Include pages' content | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/wikis?with_content=1 ``` @@ -58,7 +58,7 @@ GET /projects/:id/wikis/:slug | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) | | `slug` | string | yes | The slug (a unique string) of the wiki page | -```bash +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/wikis/home ``` @@ -88,7 +88,7 @@ POST /projects/:id/wikis | `title` | string | yes | The title of the wiki page | | `format` | string | no | The format of the wiki page. Available formats are: `markdown` (default), `rdoc`, `asciidoc` and `org` | -```bash +```shell curl --data "format=rdoc&title=Hello&content=Hello world" --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/wikis" ``` @@ -119,7 +119,7 @@ PUT /projects/:id/wikis/:slug | `format` | string | no | The format of the wiki page. Available formats are: `markdown` (default), `rdoc`, `asciidoc` and `org` | | `slug` | string | yes | The slug (a unique string) of the wiki page | -```bash +```shell curl --request PUT --data "format=rdoc&content=documentation&title=Docs" --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/wikis/foo" ``` @@ -147,7 +147,7 @@ DELETE /projects/:id/wikis/:slug | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) | | `slug` | string | yes | The slug (a unique string) of the wiki page | -```bash +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/wikis/foo" ``` @@ -175,7 +175,7 @@ cURL to post data using the header `Content-Type: multipart/form-data`. The `file=` parameter must point to a file on your filesystem and be preceded by `@`. For example: -```bash +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --form "file=@dk.png" https://gitlab.example.com/api/v4/projects/1/wikis/attachments ``` |