diff options
Diffstat (limited to 'doc/api')
-rw-r--r-- | doc/api/README.md | 12 | ||||
-rw-r--r-- | doc/api/epic_links.md | 10 | ||||
-rw-r--r-- | doc/api/feature_flags.md | 8 | ||||
-rw-r--r-- | doc/api/issues_statistics.md | 2 | ||||
-rw-r--r-- | doc/api/members.md | 2 | ||||
-rw-r--r-- | doc/api/oauth2.md | 14 | ||||
-rw-r--r-- | doc/api/packages.md | 10 | ||||
-rw-r--r-- | doc/api/pipeline_schedules.md | 18 | ||||
-rw-r--r-- | doc/api/pipelines.md | 28 | ||||
-rw-r--r-- | doc/api/project_aliases.md | 18 | ||||
-rw-r--r-- | doc/api/project_badges.md | 12 | ||||
-rw-r--r-- | doc/api/project_clusters.md | 4 | ||||
-rw-r--r-- | doc/api/project_level_variables.md | 20 | ||||
-rw-r--r-- | doc/api/project_snippets.md | 14 | ||||
-rw-r--r-- | doc/api/project_statistics.md | 2 | ||||
-rw-r--r-- | doc/api/project_templates.md | 5 | ||||
-rw-r--r-- | doc/api/projects.md | 76 | ||||
-rw-r--r-- | doc/api/protected_branches.md | 12 | ||||
-rw-r--r-- | doc/api/protected_environments.md | 2 | ||||
-rw-r--r-- | doc/api/protected_tags.md | 10 |
20 files changed, 139 insertions, 140 deletions
diff --git a/doc/api/README.md b/doc/api/README.md index a261e1e7dc6..639d5067dd7 100644 --- a/doc/api/README.md +++ b/doc/api/README.md @@ -260,7 +260,7 @@ returned with status code `404`: Example of a valid API call and a request using cURL with sudo request, providing a username: -``` +```plaintext GET /projects?private_token=<your_access_token>&sudo=username ``` @@ -271,7 +271,7 @@ curl --header "Private-Token: <your_access_token>" --header "Sudo: username" "ht Example of a valid API call and a request using cURL with sudo request, providing an ID: -``` +```plaintext GET /projects?private_token=<your_access_token>&sudo=23 ``` @@ -444,7 +444,7 @@ URL-encoded. For example, `/` is represented by `%2F`: -``` +```plaintext GET /api/v4/projects/diaspora%2Fdiaspora ``` @@ -460,7 +460,7 @@ URL-encoded. For example, `/` is represented by `%2F`: -``` +```plaintext GET /api/v4/projects/1/branches/my%2Fbranch/commits ``` @@ -604,13 +604,13 @@ to a [W3 recommendation](http://www.w3.org/Addressing/URL/4_URI_Recommentations. causes a `+` to be interpreted as a space. For example, in an ISO 8601 date, you may want to pass a time in Mountain Standard Time, such as: -``` +```plaintext 2017-10-17T23:11:13.000+05:30 ``` The correct encoding for the query parameter would be: -``` +```plaintext 2017-10-17T23:11:13.000%2B05:30 ``` diff --git a/doc/api/epic_links.md b/doc/api/epic_links.md index 0e2fb2653c4..5df91e106eb 100644 --- a/doc/api/epic_links.md +++ b/doc/api/epic_links.md @@ -15,7 +15,7 @@ Epics are available only in the [Ultimate/Gold tier](https://about.gitlab.com/pr Gets all child epics of an epic. -``` +```plaintext GET /groups/:id/epics/:epic_iid/epics ``` @@ -69,7 +69,7 @@ Example response: Creates an association between two epics, designating one as the parent epic and the other as the child epic. A parent epic can have multiple child epics. If the new child epic already belonged to another epic, it is unassigned from that previous parent. -``` +```plaintext POST /groups/:id/epics/:epic_iid/epics ``` @@ -122,7 +122,7 @@ Example response: Creates a a new epic and associates it with provided parent epic. The response is LinkedEpic object. -``` +```plaintext POST /groups/:id/epics/:epic_iid/epics ``` @@ -155,7 +155,7 @@ Example response: ## Re-order a child epic -``` +```plaintext PUT /groups/:id/epics/:epic_iid/epics/:child_epic_id ``` @@ -212,7 +212,7 @@ Example response: Unassigns a child epic from a parent epic. -``` +```plaintext DELETE /groups/:id/epics/:epic_iid/epics/:child_epic_id ``` diff --git a/doc/api/feature_flags.md b/doc/api/feature_flags.md index 384708be5df..f95eb31c84c 100644 --- a/doc/api/feature_flags.md +++ b/doc/api/feature_flags.md @@ -15,7 +15,7 @@ are [paginated](README.md#pagination). Gets all feature flags of the requested project. -``` +```plaintext GET /projects/:id/feature_flags ``` @@ -145,7 +145,7 @@ Example response: Creates a new feature flag. -``` +```plaintext POST /projects/:id/feature_flags ``` @@ -219,7 +219,7 @@ Example response: Gets a single feature flag. -``` +```plaintext GET /projects/:id/feature_flags/:name ``` @@ -294,7 +294,7 @@ Example response: Deletes a feature flag. -``` +```plaintext DELETE /projects/:id/feature_flags/:name ``` diff --git a/doc/api/issues_statistics.md b/doc/api/issues_statistics.md index b24e385c3de..cb8379aba64 100644 --- a/doc/api/issues_statistics.md +++ b/doc/api/issues_statistics.md @@ -123,7 +123,7 @@ Example response: Gets issues count statistics for given project. -``` +```plaintext GET /projects/:id/issues_statistics GET /projects/:id/issues_statistics?labels=foo GET /projects/:id/issues_statistics?labels=foo,bar diff --git a/doc/api/members.md b/doc/api/members.md index 47f2d694006..69c52a54a8d 100644 --- a/doc/api/members.md +++ b/doc/api/members.md @@ -4,7 +4,7 @@ The access levels are defined in the `Gitlab::Access` module. Currently, these levels are recognized: -``` +```plaintext 10 => Guest access 20 => Reporter access 30 => Developer access diff --git a/doc/api/oauth2.md b/doc/api/oauth2.md index 1991ad4bd14..50452b61c99 100644 --- a/doc/api/oauth2.md +++ b/doc/api/oauth2.md @@ -112,7 +112,7 @@ easily accessible, therefore secrets can leak easily. To request the access token, you should redirect the user to the `/oauth/authorize` endpoint using `token` response type: -``` +```plaintext https://gitlab.example.com/oauth/authorize?client_id=APP_ID&redirect_uri=REDIRECT_URI&response_type=token&state=YOUR_UNIQUE_STATE_HASH&scope=REQUESTED_SCOPES ``` @@ -124,7 +124,7 @@ would request `read_user` and `profile` scopes). The redirect will include a fragment with `access_token` as well as token details in GET parameters, for example: -``` +```plaintext http://myapp.com/oauth/redirect#access_token=ABCDExyz123&state=YOUR_UNIQUE_STATE_HASH&token_type=bearer&expires_in=3600 ``` @@ -182,7 +182,7 @@ curl --data "@auth.txt" --request POST https://gitlab.example.com/oauth/token Then, you'll receive the access token back in the response: -``` +```json { "access_token": "1f0af717251950dbd4d73154fdf0a474a5c5119adad999683f5b450c460726aa", "token_type": "bearer", @@ -192,7 +192,7 @@ Then, you'll receive the access token back in the response: For testing, you can use the `oauth2` Ruby gem: -``` +```ruby client = OAuth2::Client.new('the_client_id', 'the_client_secret', :site => "http://example.com") access_token = client.password.get_token('user@example.com', 'secret') puts access_token.token @@ -203,13 +203,13 @@ puts access_token.token The `access token` allows you to make requests to the API on behalf of a user. You can pass the token either as GET parameter: -``` +```plaintext GET https://gitlab.example.com/api/v4/user?access_token=OAUTH-TOKEN ``` or you can put the token to the Authorization header: -``` +```shell curl --header "Authorization: Bearer OAUTH-TOKEN" https://gitlab.example.com/api/v4/user ``` @@ -222,7 +222,7 @@ You must supply the access token, either: - As a parameter: - ``` + ```plaintext GET https://gitlab.example.com/oauth/token/info?access_token=<OAUTH-TOKEN> ``` diff --git a/doc/api/packages.md b/doc/api/packages.md index e04cb44538a..097f9dff84e 100644 --- a/doc/api/packages.md +++ b/doc/api/packages.md @@ -11,7 +11,7 @@ This is the API docs of [GitLab Packages](../administration/packages/index.md). Get a list of project packages. All package types are included in results. When accessed without authentication, only packages of public projects are returned. -``` +```plaintext GET /projects/:id/packages ``` @@ -56,7 +56,7 @@ By default, the `GET` request will return 20 results, since the API is [paginate Get a list of project packages at the group level. When accessed without authentication, only packages of public projects are returned. -``` +```plaintext GET /groups/:id/packages ``` @@ -135,7 +135,7 @@ The `_links` object contains the following properties: Get a single project package. -``` +```plaintext GET /projects/:id/packages/:package_id ``` @@ -186,7 +186,7 @@ The `_links` object contains the following properties: Get a list of package files of a single package. -``` +```plaintext GET /projects/:id/packages/:package_id/package_files ``` @@ -241,7 +241,7 @@ By default, the `GET` request will return 20 results, since the API is [paginate Deletes a project package. -``` +```plaintext DELETE /projects/:id/packages/:package_id ``` diff --git a/doc/api/pipeline_schedules.md b/doc/api/pipeline_schedules.md index 3624921fde7..9ff641fc552 100644 --- a/doc/api/pipeline_schedules.md +++ b/doc/api/pipeline_schedules.md @@ -6,7 +6,7 @@ You can read more about [pipeline schedules](../user/project/pipelines/schedules Get a list of the pipeline schedules of a project. -``` +```plaintext GET /projects/:id/pipeline_schedules ``` @@ -47,7 +47,7 @@ curl --header "PRIVATE-TOKEN: k5ESFgWY2Qf5xEvDcFxZ" "https://gitlab.example.com/ Get the pipeline schedule of a project. -``` +```plaintext GET /projects/:id/pipeline_schedules/:pipeline_schedule_id ``` @@ -99,7 +99,7 @@ curl --header "PRIVATE-TOKEN: k5ESFgWY2Qf5xEvDcFxZ" "https://gitlab.example.com/ Create a new pipeline schedule of a project. -``` +```plaintext POST /projects/:id/pipeline_schedules ``` @@ -143,7 +143,7 @@ curl --request POST --header "PRIVATE-TOKEN: k5ESFgWY2Qf5xEvDcFxZ" --form descri Updates the pipeline schedule of a project. Once the update is done, it will be rescheduled automatically. -``` +```plaintext PUT /projects/:id/pipeline_schedules/:pipeline_schedule_id ``` @@ -193,7 +193,7 @@ curl --request PUT --header "PRIVATE-TOKEN: k5ESFgWY2Qf5xEvDcFxZ" --form cron="0 Update the owner of the pipeline schedule of a project. -``` +```plaintext POST /projects/:id/pipeline_schedules/:pipeline_schedule_id/take_ownership ``` @@ -238,7 +238,7 @@ curl --request POST --header "PRIVATE-TOKEN: hf2CvZXB9w8Uc5pZKpSB" "https://gitl Delete the pipeline schedule of a project. -``` +```plaintext DELETE /projects/:id/pipeline_schedules/:pipeline_schedule_id ``` @@ -317,7 +317,7 @@ Example response: Create a new variable of a pipeline schedule. -``` +```plaintext POST /projects/:id/pipeline_schedules/:pipeline_schedule_id/variables ``` @@ -345,7 +345,7 @@ curl --request POST --header "PRIVATE-TOKEN: k5ESFgWY2Qf5xEvDcFxZ" --form "key=N Updates the variable of a pipeline schedule. -``` +```plaintext PUT /projects/:id/pipeline_schedules/:pipeline_schedule_id/variables/:key ``` @@ -373,7 +373,7 @@ curl --request PUT --header "PRIVATE-TOKEN: k5ESFgWY2Qf5xEvDcFxZ" --form "value= Delete the variable of a pipeline schedule. -``` +```plaintext DELETE /projects/:id/pipeline_schedules/:pipeline_schedule_id/variables/:key ``` diff --git a/doc/api/pipelines.md b/doc/api/pipelines.md index a3835045e5c..67d9348ba92 100644 --- a/doc/api/pipelines.md +++ b/doc/api/pipelines.md @@ -4,7 +4,7 @@ > [Introduced][ce-5837] in GitLab 8.11 -``` +```plaintext GET /projects/:id/pipelines ``` @@ -23,7 +23,7 @@ GET /projects/:id/pipelines | `order_by`| string | no | Order pipelines by `id`, `status`, `ref`, `updated_at` or `user_id` (default: `id`) | | `sort` | string | no | Sort pipelines in `asc` or `desc` order (default: `desc`) | -``` +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/pipelines" ``` @@ -56,7 +56,7 @@ Example of response > [Introduced][ce-5837] in GitLab 8.11 -``` +```plaintext GET /projects/:id/pipelines/:pipeline_id ``` @@ -65,7 +65,7 @@ GET /projects/:id/pipelines/:pipeline_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_id` | integer | yes | The ID of a pipeline | -``` +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/pipelines/46" ``` @@ -101,7 +101,7 @@ Example of response ### Get variables of a pipeline -``` +```plaintext GET /projects/:id/pipelines/:pipeline_id/variables ``` @@ -110,7 +110,7 @@ GET /projects/:id/pipelines/:pipeline_id/variables | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `pipeline_id` | integer | yes | The ID of a pipeline | -``` +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/pipelines/46/variables" ``` @@ -134,7 +134,7 @@ Example of response > [Introduced][ce-7209] in GitLab 8.14 -``` +```plaintext POST /projects/:id/pipeline ``` @@ -144,7 +144,7 @@ POST /projects/:id/pipeline | `ref` | string | yes | Reference to commit | | `variables` | array | no | An array containing the variables available in the pipeline, matching the structure `[{ 'key' => 'UPLOAD_TO_S3', 'variable_type' => 'file', 'value' => 'true' }]` | -``` +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/pipeline?ref=master" ``` @@ -182,7 +182,7 @@ Example of response > [Introduced][ce-5837] in GitLab 8.11 -``` +```plaintext POST /projects/:id/pipelines/:pipeline_id/retry ``` @@ -191,7 +191,7 @@ POST /projects/:id/pipelines/:pipeline_id/retry | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `pipeline_id` | integer | yes | The ID of a pipeline | -``` +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/pipelines/46/retry" ``` @@ -229,7 +229,7 @@ Response: > [Introduced][ce-5837] in GitLab 8.11 -``` +```plaintext POST /projects/:id/pipelines/:pipeline_id/cancel ``` @@ -238,7 +238,7 @@ POST /projects/:id/pipelines/:pipeline_id/cancel | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `pipeline_id` | integer | yes | The ID of a pipeline | -``` +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/pipelines/46/cancel" ``` @@ -276,7 +276,7 @@ Response: > [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/22988) in GitLab 11.6. -``` +```plaintext DELETE /projects/:id/pipelines/:pipeline_id ``` @@ -285,7 +285,7 @@ DELETE /projects/:id/pipelines/:pipeline_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_id` | integer | yes | The ID of a pipeline | -``` +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" --request "DELETE" "https://gitlab.example.com/api/v4/projects/1/pipelines/46" ``` diff --git a/doc/api/project_aliases.md b/doc/api/project_aliases.md index da8d7600c7c..59c0ffee76d 100644 --- a/doc/api/project_aliases.md +++ b/doc/api/project_aliases.md @@ -8,11 +8,11 @@ All methods require administrator authorization. Get a list of all project aliases: -``` +```plaintext GET /project_aliases ``` -``` +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/project_aliases" ``` @@ -37,7 +37,7 @@ Example response: Get details of a project alias: -``` +```plaintext GET /project_aliases/:name ``` @@ -45,7 +45,7 @@ GET /project_aliases/:name |-----------|--------|----------|-----------------------| | `name` | string | yes | The name of the alias | -``` +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/project_aliases/gitlab" ``` @@ -64,7 +64,7 @@ Example response: Add a new alias for a project. Responds with a 201 when successful, 400 when there are validation errors (e.g. alias already exists): -``` +```plaintext POST /project_aliases ``` @@ -73,13 +73,13 @@ POST /project_aliases | `project_id` | integer/string | yes | The ID or path of the project. | | `name` | string | yes | The name of the alias. Must be unique. | -``` +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/project_aliases" --form "project_id=1" --form "name=gitlab" ``` or -``` +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/project_aliases" --form "project_id=gitlab-org/gitlab" --form "name=gitlab" ``` @@ -98,7 +98,7 @@ Example response: Removes a project aliases. Responds with a 204 when project alias exists, 404 when it doesn't: -``` +```plaintext DELETE /project_aliases/:name ``` @@ -106,6 +106,6 @@ DELETE /project_aliases/:name |-----------|--------|----------|-----------------------| | `name` | string | yes | The name of the alias | -``` +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/project_aliases/gitlab" ``` diff --git a/doc/api/project_badges.md b/doc/api/project_badges.md index 77c5d6cf37e..2e335d80947 100644 --- a/doc/api/project_badges.md +++ b/doc/api/project_badges.md @@ -16,7 +16,7 @@ Badges support placeholders that will be replaced in real time in both the link Gets a list of a project's badges and its group badges. -``` +```plaintext GET /projects/:id/badges ``` @@ -58,7 +58,7 @@ Example response: Gets a badge of a project. -``` +```plaintext GET /projects/:id/badges/:badge_id ``` @@ -88,7 +88,7 @@ Example response: Adds a badge to a project. -``` +```plaintext POST /projects/:id/badges ``` @@ -119,7 +119,7 @@ Example response: Updates a badge of a project. -``` +```plaintext PUT /projects/:id/badges/:badge_id ``` @@ -151,7 +151,7 @@ Example response: Removes a badge from a project. Only project's badges will be removed by using this endpoint. -``` +```plaintext DELETE /projects/:id/badges/:badge_id ``` @@ -168,7 +168,7 @@ curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitl Returns how the `link_url` and `image_url` final URLs would be after resolving the placeholder interpolation. -``` +```plaintext GET /projects/:id/badges/render ``` diff --git a/doc/api/project_clusters.md b/doc/api/project_clusters.md index 78d32acd0d2..448d5966135 100644 --- a/doc/api/project_clusters.md +++ b/doc/api/project_clusters.md @@ -9,7 +9,7 @@ User will need at least maintainer access to use these endpoints. Returns a list of project clusters. -``` +```plaintext GET /projects/:id/clusters ``` @@ -368,7 +368,7 @@ Example response: Deletes an existing project cluster. -``` +```plaintext DELETE /projects/:id/clusters/:cluster_id ``` diff --git a/doc/api/project_level_variables.md b/doc/api/project_level_variables.md index d4bda992f7c..fbeba9d6c7d 100644 --- a/doc/api/project_level_variables.md +++ b/doc/api/project_level_variables.md @@ -4,7 +4,7 @@ Get list of a project's variables. -``` +```plaintext GET /projects/:id/variables ``` @@ -12,7 +12,7 @@ GET /projects/:id/variables |-----------|---------|----------|---------------------| | `id` | integer/string | yes | The ID of a project or [urlencoded NAMESPACE/PROJECT_NAME of the project](README.md#namespaced-path-encoding) owned by the authenticated user | -``` +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/variables" ``` @@ -35,7 +35,7 @@ curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/a Get the details of a project's specific variable. -``` +```plaintext GET /projects/:id/variables/:key ``` @@ -44,7 +44,7 @@ GET /projects/:id/variables/:key | `id` | integer/string | yes | The ID of a project or [urlencoded NAMESPACE/PROJECT_NAME of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `key` | string | yes | The `key` of a variable | -``` +```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/variables/TEST_VARIABLE_1" ``` @@ -62,7 +62,7 @@ curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/a Create a new variable. -``` +```plaintext POST /projects/:id/variables ``` @@ -76,7 +76,7 @@ POST /projects/:id/variables | `masked` | boolean | no | Whether the variable is masked | | `environment_scope` | string | no | The `environment_scope` of the variable | -``` +```shell curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/variables" --form "key=NEW_VARIABLE" --form "value=new value" ``` @@ -95,7 +95,7 @@ curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitla Update a project's variable. -``` +```plaintext PUT /projects/:id/variables/:key ``` @@ -109,7 +109,7 @@ PUT /projects/:id/variables/:key | `masked` | boolean | no | Whether the variable is masked | | `environment_scope` | string | no | The `environment_scope` of the variable | -``` +```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/variables/NEW_VARIABLE" --form "value=updated value" ``` @@ -128,7 +128,7 @@ curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab Remove a project's variable. -``` +```plaintext DELETE /projects/:id/variables/:key ``` @@ -137,6 +137,6 @@ DELETE /projects/:id/variables/:key | `id` | integer/string | yes | The ID of a project or [urlencoded NAMESPACE/PROJECT_NAME of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `key` | string | yes | The `key` of a variable | -``` +```shell curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/variables/VARIABLE_1" ``` diff --git a/doc/api/project_snippets.md b/doc/api/project_snippets.md index b734273b5f6..39df2925a1e 100644 --- a/doc/api/project_snippets.md +++ b/doc/api/project_snippets.md @@ -23,7 +23,7 @@ visibility setting keep this setting. You can read more about the change in the Get a list of project snippets. -``` +```plaintext GET /projects/:id/snippets ``` @@ -35,7 +35,7 @@ Parameters: Get a single project snippet. -``` +```plaintext GET /projects/:id/snippets/:snippet_id ``` @@ -68,7 +68,7 @@ Parameters: Creates a new project snippet. The user must have permission to create new snippets. -``` +```plaintext POST /projects/:id/snippets ``` @@ -106,7 +106,7 @@ curl --request POST https://gitlab.com/api/v4/projects/:id/snippets \ Updates an existing project snippet. The user must have permission to change an existing snippet. -``` +```plaintext PUT /projects/:id/snippets/:snippet_id ``` @@ -145,7 +145,7 @@ curl --request PUT https://gitlab.com/api/v4/projects/:id/snippets/:snippet_id \ Deletes an existing project snippet. This returns a `204 No Content` status code if the operation was successfully or `404` if the resource was not found. -``` +```plaintext DELETE /projects/:id/snippets/:snippet_id ``` @@ -165,7 +165,7 @@ curl --request DELETE https://gitlab.com/api/v4/projects/:id/snippets/:snippet_i Returns the raw project snippet as plain text. -``` +```plaintext GET /projects/:id/snippets/:snippet_id/raw ``` @@ -187,7 +187,7 @@ curl https://gitlab.com/api/v4/projects/:id/snippets/:snippet_id/raw \ Available only for admins. -``` +```plaintext GET /projects/:id/snippets/:snippet_id/user_agent_detail ``` diff --git a/doc/api/project_statistics.md b/doc/api/project_statistics.md index 2732fa47fa0..d96d3de6a73 100644 --- a/doc/api/project_statistics.md +++ b/doc/api/project_statistics.md @@ -8,7 +8,7 @@ Retrieving the statistics requires write access to the repository. Currently only HTTP fetches statistics are returned. Fetches statistics includes both clones and pulls count and are HTTP only, SSH fetches are not included. -``` +```plaintext GET /projects/:id/statistics ``` diff --git a/doc/api/project_templates.md b/doc/api/project_templates.md index d6ad77de429..4062df24525 100644 --- a/doc/api/project_templates.md +++ b/doc/api/project_templates.md @@ -21,7 +21,7 @@ in GitLab 11.5 ## Get all templates of a particular type -``` +```plaintext GET /projects/:id/templates/:type ``` @@ -87,7 +87,7 @@ Example response (licenses): ## Get one template of a particular type -``` +```plaintext GET /projects/:id/templates/:type/:key ``` @@ -106,7 +106,6 @@ Example response (Dockerfile): "name": "Binary", "content": "# This file is a template, and might need editing before it works on your project.\n# This Dockerfile installs a compiled binary into a bare system.\n# You must either commit your compiled binary into source control (not recommended)\n# or build the binary first as part of a CI/CD pipeline.\n\nFROM buildpack-deps:jessie\n\nWORKDIR /usr/local/bin\n\n# Change `app` to whatever your binary is called\nAdd app .\nCMD [\"./app\"]\n" } - ``` Example response (license): diff --git a/doc/api/projects.md b/doc/api/projects.md index a0243be1907..905eb01b0ad 100644 --- a/doc/api/projects.md +++ b/doc/api/projects.md @@ -35,7 +35,7 @@ There are currently three options for `merge_method` to choose from: Get a list of all visible projects across GitLab for the authenticated user. When accessed without authentication, only public projects with "simple" fields are returned. -``` +```plaintext GET /projects ``` @@ -298,7 +298,7 @@ the `approvals_before_merge` parameter: You can filter by [custom attributes](custom_attributes.md) with: -``` +```plaintext GET /projects?custom_attributes[key]=value&custom_attributes[other_key]=other_value ``` @@ -315,7 +315,7 @@ Note that keyset pagination only supports `order_by=id`. Other sorting options a Get a list of visible projects owned by the given user. When accessed without authentication, only public projects are returned. -``` +```plaintext GET /users/:user_id/projects ``` @@ -530,7 +530,7 @@ This endpoint supports [keyset pagination](README.md#keyset-based-pagination) fo Get a list of visible projects owned by the given user. When accessed without authentication, only public projects are returned. -``` +```plaintext GET /users/:user_id/starred_projects ``` @@ -740,7 +740,7 @@ Example response: Get a specific project. This endpoint can be accessed without authentication if the project is publicly accessible. -``` +```plaintext GET /projects/:id ``` @@ -955,7 +955,7 @@ If the project is a fork, and you provide a valid token to authenticate, the Get the users list of a project. -``` +```plaintext GET /projects/:id/users ``` @@ -993,7 +993,7 @@ Please refer to the [Events API documentation](events.md#list-a-projects-visible Creates a new project owned by the authenticated user. -``` +```plaintext POST /projects ``` @@ -1061,7 +1061,7 @@ where `password` is a public access key with the `api` scope enabled. Creates a new project owned by the specified user. Available only for admins. -``` +```plaintext POST /projects/user/:user_id ``` @@ -1128,7 +1128,7 @@ where `password` is a public access key with the `api` scope enabled. Updates an existing project. -``` +```plaintext PUT /projects/:id ``` @@ -1200,7 +1200,7 @@ The forking operation for a project is asynchronous and is completed in a background job. The request will return immediately. To determine whether the fork of the project has completed, query the `import_status` for the new project. -``` +```plaintext POST /projects/:id/fork ``` @@ -1217,7 +1217,7 @@ POST /projects/:id/fork List the projects accessible to the calling user that have an established, forked relationship with the specified project -``` +```plaintext GET /projects/:id/forks ``` @@ -1315,7 +1315,7 @@ Example responses: Stars a given project. Returns status code `304` if the project is already starred. -``` +```plaintext POST /projects/:id/star ``` @@ -1405,7 +1405,7 @@ Example response: Unstars a given project. Returns status code `304` if the project is not starred. -``` +```plaintext POST /projects/:id/unstar ``` @@ -1495,7 +1495,7 @@ Example response: List the users who starred the specified project. -``` +```plaintext GET /projects/:id/starrers ``` @@ -1540,7 +1540,7 @@ Example responses: Get languages used in a project with percentage value. -``` +```plaintext GET /projects/:id/languages ``` @@ -1564,7 +1564,7 @@ Example response: Archives the project if the user is either admin or the project owner of this project. This action is idempotent, thus archiving an already archived project will not change the project. -``` +```plaintext POST /projects/:id/archive ``` @@ -1673,7 +1673,7 @@ Example response: Unarchives the project if the user is either admin or the project owner of this project. This action is idempotent, thus unarchiving a non-archived project will not change the project. -``` +```plaintext POST /projects/:id/unarchive ``` @@ -1786,7 +1786,7 @@ This endpoint either: deletion happens after number of days specified in [instance settings](../user/admin_area/settings/visibility_and_access_controls.md#default-deletion-adjourned-period-premium-only). -``` +```plaintext DELETE /projects/:id ``` @@ -1800,7 +1800,7 @@ DELETE /projects/:id Restores project marked for deletion. -``` +```plaintext POST /projects/:id/restore ``` @@ -1812,7 +1812,7 @@ POST /projects/:id/restore Uploads a file to the specified project to be used in an issue or merge request description, or a comment. -``` +```plaintext POST /projects/:id/uploads ``` @@ -1848,7 +1848,7 @@ In Markdown contexts, the link is automatically expanded when the format in Allow to share project with group. -``` +```plaintext POST /projects/:id/share ``` @@ -1863,7 +1863,7 @@ POST /projects/:id/share Unshare the project from the group. Returns `204` and no content on success. -``` +```plaintext DELETE /projects/:id/share/:group_id ``` @@ -1885,7 +1885,7 @@ These are different for [System Hooks](system_hooks.md) that are system wide. Get a list of project hooks. -``` +```plaintext GET /projects/:id/hooks ``` @@ -1897,7 +1897,7 @@ GET /projects/:id/hooks Get a specific hook for a project. -``` +```plaintext GET /projects/:id/hooks/:hook_id ``` @@ -1930,7 +1930,7 @@ GET /projects/:id/hooks/:hook_id Adds a hook to a specified project. -``` +```plaintext POST /projects/:id/hooks ``` @@ -1955,7 +1955,7 @@ POST /projects/:id/hooks Edits a hook for a specified project. -``` +```plaintext PUT /projects/:id/hooks/:hook_id ``` @@ -1982,7 +1982,7 @@ PUT /projects/:id/hooks/:hook_id Removes a hook from a project. This is an idempotent method and can be called multiple times. Either the hook is available or not. -``` +```plaintext DELETE /projects/:id/hooks/:hook_id ``` @@ -2000,7 +2000,7 @@ Allows modification of the forked relationship between existing projects. Availa ### Create a forked from/to relation between existing projects -``` +```plaintext POST /projects/:id/fork/:forked_from_id ``` @@ -2011,7 +2011,7 @@ POST /projects/:id/fork/:forked_from_id ### Delete an existing forked from relationship -``` +```plaintext DELETE /projects/:id/fork ``` @@ -2025,7 +2025,7 @@ Search for projects by name which are accessible to the authenticated user. This endpoint can be accessed without authentication if the project is publicly accessible. -``` +```plaintext GET /projects ``` @@ -2043,7 +2043,7 @@ curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/ap > Introduced in GitLab 9.0. -``` +```plaintext POST /projects/:id/housekeeping ``` @@ -2057,7 +2057,7 @@ POST /projects/:id/housekeeping Get the push rules of a project. -``` +```plaintext GET /projects/:id/push_rule ``` @@ -2101,7 +2101,7 @@ the `commit_committer_check` and `reject_unsigned_commits` parameters: Adds a push rule to a specified project. -``` +```plaintext POST /projects/:id/push_rule ``` @@ -2124,7 +2124,7 @@ POST /projects/:id/push_rule Edits a push rule for a specified project. -``` +```plaintext PUT /projects/:id/push_rule ``` @@ -2150,7 +2150,7 @@ PUT /projects/:id/push_rule Removes a push rule from a project. This is an idempotent method and can be called multiple times. Either the push rule is available or not. -``` +```plaintext DELETE /projects/:id/push_rule ``` @@ -2162,7 +2162,7 @@ DELETE /projects/:id/push_rule > Introduced in GitLab 11.1. -``` +```plaintext PUT /projects/:id/transfer ``` @@ -2186,7 +2186,7 @@ Read more in the [Project members](members.md) documentation. > Introduced in [GitLab Starter](https://about.gitlab.com/pricing/) 10.3. -``` +```plaintext POST /projects/:id/mirror/pull ``` @@ -2219,7 +2219,7 @@ format. If a repository is corrupted to the point where `git clone` does not work, the snapshot may allow some of the data to be retrieved. -``` +```plaintext GET /projects/:id/snapshot ``` diff --git a/doc/api/protected_branches.md b/doc/api/protected_branches.md index e59d7130356..de862109055 100644 --- a/doc/api/protected_branches.md +++ b/doc/api/protected_branches.md @@ -6,7 +6,7 @@ The access levels are defined in the `ProtectedRefAccess.allowed_access_levels` method. Currently, these levels are recognized: -``` +```plaintext 0 => No access 30 => Developer access 40 => Maintainer access @@ -17,7 +17,7 @@ The access levels are defined in the `ProtectedRefAccess.allowed_access_levels` Gets a list of protected branches from a project. -``` +```plaintext GET /projects/:id/protected_branches ``` @@ -91,7 +91,7 @@ Example response: Gets a single protected branch or wildcard protected branch. -``` +```plaintext GET /projects/:id/protected_branches/:name ``` @@ -160,7 +160,7 @@ Example response: Protects a single repository branch or several project repository branches using a wildcard protected branch. -``` +```plaintext POST /projects/:id/protected_branches ``` @@ -292,7 +292,7 @@ Example response: Unprotects the given protected branch or wildcard protected branch. -``` +```plaintext DELETE /projects/:id/protected_branches/:name ``` @@ -309,7 +309,7 @@ curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" 'https://git Update the "code owner approval required" option for the given protected branch protected branch. -``` +```plaintext PATCH /projects/:id/protected_branches/:name ``` diff --git a/doc/api/protected_environments.md b/doc/api/protected_environments.md index 852a5ae6e71..dea1382af29 100644 --- a/doc/api/protected_environments.md +++ b/doc/api/protected_environments.md @@ -7,7 +7,7 @@ The access levels are defined in the `ProtectedEnvironment::DeployAccessLevel::ALLOWED_ACCESS_LEVELS` method. Currently, these levels are recognized: -``` +```plaintext 30 => Developer access 40 => Maintainer access 60 => Admin access diff --git a/doc/api/protected_tags.md b/doc/api/protected_tags.md index a5490094a44..1d844a2c5c4 100644 --- a/doc/api/protected_tags.md +++ b/doc/api/protected_tags.md @@ -6,7 +6,7 @@ Currently, these levels are recognized: -``` +```plaintext 0 => No access 30 => Developer access 40 => Maintainer access @@ -17,7 +17,7 @@ Currently, these levels are recognized: Gets a list of protected tags from a project. This function takes pagination parameters `page` and `per_page` to restrict the list of protected tags. -``` +```plaintext GET /projects/:id/protected_tags ``` @@ -51,7 +51,7 @@ Example response: Gets a single protected tag or wildcard protected tag. The pagination parameters `page` and `per_page` can be used to restrict the list of protected tags. -``` +```plaintext GET /projects/:id/protected_tags/:name ``` @@ -83,7 +83,7 @@ Example response: Protects a single repository tag or several project repository tags using a wildcard protected tag. -``` +```plaintext POST /projects/:id/protected_tags ``` @@ -115,7 +115,7 @@ Example response: Unprotects the given protected tag or wildcard protected tag. -``` +```plaintext DELETE /projects/:id/protected_tags/:name ``` |