@@ -1467,8 +1467,10 @@ After creating and configuring Gitaly Cluster:
1.[Schedule repository storage moves for all projects on a storage shard](../../api/project_repository_storage_moves.md#schedule-repository-storage-moves-for-all-projects-on-a-storage-shard) using the API. For example:
```shell
curl --request POST --header"Private-Token: <your_access_token>"--header"Content-Type: application/json"\
1.[Query the most recent repository moves](../../api/project_repository_storage_moves.md#retrieve-all-project-repository-storage-moves)
...
...
@@ -1500,8 +1502,10 @@ After creating and configuring Gitaly Cluster:
1.[Schedule repository storage moves for all snippets on a storage shard](../../api/snippet_repository_storage_moves.md#schedule-repository-storage-moves-for-all-snippets-on-a-storage-shard) using the API. For example:
```shell
curl --request POST --header"PRIVATE-TOKEN: <your_access_token>"--header"Content-Type: application/json"\
1.[Query the most recent repository moves](../../api/snippet_repository_storage_moves.md#retrieve-all-snippet-repository-storage-moves)
...
...
@@ -1525,8 +1529,10 @@ After creating and configuring Gitaly Cluster:
1.[Schedule repository storage moves for all groups on a storage shard](../../api/group_repository_storage_moves.md#schedule-repository-storage-moves-for-all-groups-on-a-storage-shard) using the API.
```shell
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --header "Content-Type: application/json" \
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"
curl --request POST --header"PRIVATE-TOKEN: <your_access_token>"\
curl --data"message=Deploy in progress&color=#cecece"--header"PRIVATE-TOKEN: <your_access_token>""https://gitlab.example.com/api/v4/broadcast_messages"
curl --data"message=Deploy in progress&color=#cecece"\
| `message` | string | no | A custom commit message to use for the new commit. [Introduced in GitLab 14.0](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/62481)
```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"
curl --request POST --header"PRIVATE-TOKEN: <your_access_token>"\
| `dry_run` | boolean | no | Does not commit any changes. Default is false. [Introduced in GitLab 13.3](https://gitlab.com/gitlab-org/gitlab/-/issues/231032) |
```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"
curl --request POST --header"PRIVATE-TOKEN: <your_access_token>"--form"branch=master"\
@@ -90,7 +90,8 @@ GET /groups/:id/registry/repositories
| `tags_count` | boolean | no | If the parameter is included as true, each repository includes `"tags_count"` in the response ([Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/32141) in GitLab 13.1). |
@@ -90,7 +90,8 @@ PUT /projects/:id/custom_attributes/:key
| `value` | string | yes | The value of the custom attribute |
```shell
curl --request PUT --header"PRIVATE-TOKEN: <your_access_token>"--data"value=Greenland""https://gitlab.example.com/api/v4/users/42/custom_attributes/location"
curl --request PUT --header"PRIVATE-TOKEN: <your_access_token>"\
@@ -197,7 +198,8 @@ PUT /projects/:id/environments/:environments_id
| `external_url` | string | no | The new `external_url` |
```shell
curl --request PUT --data"name=staging&external_url=https://staging.gitlab.example.com"--header"PRIVATE-TOKEN: <your_access_token>""https://gitlab.example.com/api/v4/projects/1/environments/1"
curl --request PUT --data"name=staging&external_url=https://staging.gitlab.example.com"\
| `image_url` | string | yes | URL of the badge image |
```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"
curl --request POST --header"PRIVATE-TOKEN: <your_access_token>"\
@@ -90,7 +91,9 @@ The `file=` parameter must point to a file on your file system and be preceded
by `@`. For example:
```shell
curl --request POST --header"PRIVATE-TOKEN: <your_access_token>"--form"name=imported-group"--form"path=imported-group"--form"file=@/path/to/file""https://gitlab.example.com/api/v4/groups/import"
curl --request POST --header"PRIVATE-TOKEN: <your_access_token>"\
| `environment_scope`**(PREMIUM)** | string | no | The [environment scope](../ci/variables/README.md#limit-the-environment-scope-of-a-cicd-variable) of a variable |
```shell
curl --request POST --header"PRIVATE-TOKEN: <your_access_token>""https://gitlab.example.com/api/v4/groups/1/variables"--form"key=NEW_VARIABLE"--form"value=new value"
curl --request POST --header"PRIVATE-TOKEN: <your_access_token>"\
@@ -125,7 +126,8 @@ PUT /groups/:id/variables/:key
| `environment_scope`**(PREMIUM)** | string | no | The [environment scope](../ci/variables/README.md#limit-the-environment-scope-of-a-cicd-variable) of a variable |
```shell
curl --request PUT --header"PRIVATE-TOKEN: <your_access_token>""https://gitlab.example.com/api/v4/groups/1/variables/NEW_VARIABLE"--form"value=updated value"
curl --request PUT --header"PRIVATE-TOKEN: <your_access_token>"\
@@ -851,7 +853,8 @@ The `projects` and `shared_projects` attributes in the response are deprecated a
To get the details of all projects within a group, use either the [list a group's projects](#list-a-groups-projects) or the [list a group's shared projects](#list-a-groups-shared-projects) endpoint.
```shell
curl --request PUT --header"PRIVATE-TOKEN: <your_access_token>""https://gitlab.example.com/api/v4/groups/5?name=Experimental"
curl --request PUT --header"PRIVATE-TOKEN: <your_access_token>"\
| `invite_source` | string | no | The source of the invitation that starts the member creation process. See [this issue](https://gitlab.com/gitlab-org/gitlab/-/issues/327120). |
```shell
curl --request POST --header"PRIVATE-TOKEN: <your_access_token>"--data"email=test@example.com&access_level=30""https://gitlab.example.com/api/v4/groups/:id/invitations"
curl --request POST --header"PRIVATE-TOKEN: <your_access_token>"--data"email=test@example.com&access_level=30""https://gitlab.example.com/api/v4/projects/:id/invitations"
curl --request POST --header"PRIVATE-TOKEN: <your_access_token>"\
@@ -222,7 +222,8 @@ PUT /projects/:id/labels/:label_id
| `priority` | integer | no | The new priority of the label. Must be greater or equal than zero or `null` to remove the priority. |
```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"
curl --request PUT --data"new_name=docs&color=#8E44AD&description=Documentation"\
| `invite_source` | string | no | The source of the invitation that starts the member creation process. See [this issue](https://gitlab.com/gitlab-org/gitlab/-/issues/327120). |
```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"
curl --request POST --header"PRIVATE-TOKEN: <your_access_token>"\
@@ -134,19 +134,24 @@ POST /projects/:id/pages/domains
Create a new Pages domain with a certificate from a `.pem` file:
```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"
curl --request POST --header"PRIVATE-TOKEN: <your_access_token>"\
Create a new Pages domain by using a variable containing the certificate:
```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"
curl --request POST --header"PRIVATE-TOKEN: <your_access_token>"\
Create a new Pages domain with an [automatic certificate](../user/project/pages/custom_domains_ssl_tls_certification/lets_encrypt_integration.md#enabling-lets-encrypt-integration-for-your-custom-domain):
```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"
curl --request POST --header"PRIVATE-TOKEN: <your_access_token>"--form"domain=ssl.domain.example"\
@@ -184,13 +189,15 @@ PUT /projects/:id/pages/domains/:domain
Add a certificate for a Pages domain from a `.pem` file:
```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"
curl --request PUT --header"PRIVATE-TOKEN: <your_access_token>"--form"certificate=@/path/to/cert.pem"\
Add a certificate for a Pages domain by using a variable containing the certificate:
```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"
curl --request PUT --header"PRIVATE-TOKEN: <your_access_token>"--form"certificate=$CERT_PEM"\
### Enabling Let's Encrypt integration for Pages custom domains
```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"
curl --request PUT --header"PRIVATE-TOKEN: <your_access_token>"\
To remove the SSL certificate attached to the Pages domain, run:
```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"
curl --request PUT --header"PRIVATE-TOKEN: <your_access_token>"--form"certificate="\
| `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"
curl --request POST --header"PRIVATE-TOKEN: <your_access_token>"\
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"
curl --request POST --header"PRIVATE-TOKEN: <your_access_token>"\
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&name=mybadge""https://gitlab.example.com/api/v4/projects/:id/badges"
curl --request POST --header"PRIVATE-TOKEN: <your_access_token>"\
@@ -144,7 +145,8 @@ The `file=` parameter must point to a file on your file system and be preceded
by `@`. For example:
```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"
curl --request POST --header"PRIVATE-TOKEN: <your_access_token>"--form"path=api-project"\
cURL doesn't support posting a file from a remote server. Importing a project from a remote server can be accomplished through something like the following:
@@ -539,7 +539,8 @@ PUT /projects/:id/releases/:tag_name
Example request:
```shell
curl --header'Content-Type: application/json'--request PUT --data'{"name": "new name", "milestones": ["v1.2"]}'--header"PRIVATE-TOKEN: <your_access_token>""https://gitlab.example.com/api/v4/projects/24/releases/v0.1"
curl --header'Content-Type: application/json'--request PUT --data'{"name": "new name", "milestones": ["v1.2"]}'\
@@ -71,7 +71,8 @@ POST /projects/:id/remote_mirrors
Example request:
```shell
curl --request POST --data"url=https://username:token@example.com/gitlab/example.git"--header"PRIVATE-TOKEN: <your_access_token>""https://gitlab.example.com/api/v4/projects/42/remote_mirrors"
curl --request POST --data"url=https://username:token@example.com/gitlab/example.git"\
| `maximum_timeout` | integer | no | Maximum timeout set when this runner handles the job |
```shell
curl --request PUT --header"PRIVATE-TOKEN: <your_access_token>""https://gitlab.example.com/api/v4/runners/6"--form"description=test-1-20150125-test"--form"tag_list=ruby,mysql,tag1,tag2"
curl --request PUT --header"PRIVATE-TOKEN: <your_access_token>""https://gitlab.example.com/api/v4/runners/6"\
| `runner_id` | integer | yes | The ID of a runner |
```shell
curl --request POST --header"PRIVATE-TOKEN: <your_access_token>""https://gitlab.example.com/api/v4/projects/9/runners"--form"runner_id=9"
curl --request POST --header"PRIVATE-TOKEN: <your_access_token>""https://gitlab.example.com/api/v4/projects/9/runners"\
--form"runner_id=9"
```
Example response:
...
...
@@ -567,7 +570,9 @@ POST /runners
| `maximum_timeout` | integer | no | Maximum timeout set when this runner handles the job |
```shell
curl --request POST "https://gitlab.example.com/api/v4/runners"--form"token=<registration_token>"--form"description=test-1-20150125-test"--form"tag_list=ruby,mysql,tag1,tag2"
curl --request POST "https://gitlab.example.com/api/v4/runners"\
When both parameters `emoji` and `message` are empty, the status is cleared. When the `clear_status_after` parameter is missing from the request, the previously set value for `"clear_status_after` is cleared.
```shell
curl --request PUT --header"PRIVATE-TOKEN: <your_access_token>"--data"clear_status_after=1_day"--data"emoji=coffee"--data"message=I crave coffee""https://gitlab.example.com/api/v4/user/status"
curl --request PUT --header"PRIVATE-TOKEN: <your_access_token>"--data"clear_status_after=1_day"--data"emoji=coffee"\
@@ -1589,7 +1592,8 @@ POST /users/:user_id/impersonation_tokens
| `scopes` | array | yes | The array of scopes of the impersonation token (`api`, `read_user`) |
```shell
curl --request POST --header"PRIVATE-TOKEN: <your_access_token>"--data"name=mytoken"--data"expires_at=2017-04-04"--data"scopes[]=api""https://gitlab.example.com/api/v4/users/42/impersonation_tokens"
curl --request POST --header"PRIVATE-TOKEN: <your_access_token>"--data"name=mytoken"--data"expires_at=2017-04-04"\
@@ -1653,7 +1657,8 @@ POST /users/:user_id/personal_access_tokens
| `scopes` | array | yes | The array of scopes of the personal access token (`api`, `read_user`, `read_api`, `read_repository`, `write_repository`) |
```shell
curl --request POST --header"PRIVATE-TOKEN: <your_access_token>"--data"name=mytoken"--data"expires_at=2017-04-04"--data"scopes[]=api""https://gitlab.example.com/api/v4/users/42/personal_access_tokens"
curl --request POST --header"PRIVATE-TOKEN: <your_access_token>"--data"name=mytoken"--data"expires_at=2017-04-04"\
| `slug` | string | yes | URL-encoded slug (a unique string) of the wiki page, such as `dir%2Fpage_name` |
```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"
curl --request PUT --data"format=rdoc&content=documentation&title=Docs"\
@@ -87,7 +88,8 @@ Alternatively, you can use the API to protect an environment:
1. Use the API to add the group to the project as a reporter:
```shell
$ curl --request POST --header"PRIVATE-TOKEN: <your_access_token>"--request POST "https://gitlab.com/api/v4/projects/22034114/share?group_id=9899826&group_access=20"
$ curl --request POST --header"PRIVATE-TOKEN: <your_access_token>"\
--request POST "https://gitlab.com/api/v4/projects/22034114/share?group_id=9899826&group_access=20"
@@ -150,7 +150,8 @@ This example creates a new group. Be aware of the use of single (`'`) and double
(`"`) quotes.
```shell
curl --request POST --header"PRIVATE-TOKEN: <your_access_token>"--header"Content-Type: application/json"--data'{"path": "my-group", "name": "My group"}'"https://gitlab.example.com/api/v4/groups"
curl --request POST --header"PRIVATE-TOKEN: <your_access_token>"--header"Content-Type: application/json"\
--data'{"path": "my-group", "name": "My group"}'"https://gitlab.example.com/api/v4/groups"
```
For readability, you can also set up the `--data` by using the following format:
...
...
@@ -172,7 +173,8 @@ Instead of using JSON or URL-encoding data, you can use `multipart/form-data` wh
properly handles data encoding:
```shell
curl --request POST --header"PRIVATE-TOKEN: <your_access_token>"--form"title=ssh-key"--form"key=ssh-rsa AAAAB3NzaC1yc2EA...""https://gitlab.example.com/api/v4/users/25/keys"
curl --request POST --header"PRIVATE-TOKEN: <your_access_token>"--form"title=ssh-key"\
The above example is run by and administrator and will add an SSH public key
...
...
@@ -198,5 +200,6 @@ exclude specific users when requesting a list of users for a project, you would
do something like this:
```shell
curl --request PUT --header"PRIVATE-TOKEN: <your_access_token>"--data"skip_users[]=<user_id>"--data"skip_users[]=<user_id>""https://gitlab.example.com/api/v4/projects/<project_id>/users"
curl --request PUT --header"PRIVATE-TOKEN: <your_access_token>"--data"skip_users[]=<user_id>"\
After this, if your index is in read-only mode, switch back to read-write:
```shell
curl --request PUT localhost:9200/gitlab-production/_settings --header'Content-Type: application/json'--data'{
"settings": {
"index.blocks.write": false
} }'
curl --request PUT localhost:9200/gitlab-production/_settings --header'Content-Type: application/json'\
--data'{
"settings": {
"index.blocks.write": false
} }'
```
1. After the indexing has completed, enable [**Search with Elasticsearch enabled**](#enabling-advanced-search).
...
...
@@ -730,21 +734,23 @@ However, some larger installations may wish to tune the merge policy settings:
- Consider reducing the `index.merge.policy.max_merged_segment` size from the default 5 GB to maybe 2 GB or 3 GB. Merging only happens when a segment has at least 50% deletions. Smaller segment sizes will allow merging to happen more frequently.
```shell
curl --request PUT localhost:9200/gitlab-production/_settings ---header'Content-Type: application/json'--data'{
"index" : {
"merge.policy.max_merged_segment": "2gb"
}
}'
curl --request PUT localhost:9200/gitlab-production/_settings ---header'Content-Type: application/json'\
--data'{
"index" : {
"merge.policy.max_merged_segment": "2gb"
}
}'
```
- You can also adjust `index.merge.policy.reclaim_deletes_weight`, which controls how aggressively deletions are targeted. But this can lead to costly merge decisions, so we recommend not changing this unless you understand the tradeoffs.
```shell
curl --request PUT localhost:9200/gitlab-production/_settings ---header'Content-Type: application/json'--data'{
"index" : {
"merge.policy.reclaim_deletes_weight": "3.0"
}
}'
curl --request PUT localhost:9200/gitlab-production/_settings ---header'Content-Type: application/json'\
--data'{
"index" : {
"merge.policy.reclaim_deletes_weight": "3.0"
}
}'
```
- Do not do a [force merge](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-forcemerge.html"Force Merge") to remove deleted documents. A warning in the [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-forcemerge.html"Force Merge") states that this can lead to very large segments that may never get reclaimed, and can also cause significant performance or availability issues.
...
...
@@ -917,11 +923,12 @@ Setting the number of replicas to `0` is discouraged (this is not allowed in the
If you have a **hard requirement to have a green status for your single node Elasticsearch cluster**, please make sure you understand the risks outlined in the previous paragraph and then run the following query to set the number of replicas to `0`(the cluster will no longer try to create any shard replicas):
```shell
curl --request PUT localhost:9200/gitlab-production/_settings --header'Content-Type: application/json'--data'{
"index" : {
"number_of_replicas" : 0
}
}'
curl --request PUT localhost:9200/gitlab-production/_settings --header'Content-Type: application/json'\
--data'{
"index" : {
"number_of_replicas" : 0
}
}'
```
### `health check timeout: no Elasticsearch node available` error in Sidekiq
- Select all tags, keep at least 1 tag per image, clean up any tag older than 14 days, run once a month, preserve any images with the name `master` and the policy is enabled:
```shell
curl --request PUT --header'Content-Type: application/json;charset=UTF-8'--header"PRIVATE-TOKEN: <your_access_token>"--data-binary'{"container_expiration_policy_attributes":{"cadence":"1month","enabled":true,"keep_n":1,"older_than":"14d","name_regex":"","name_regex_delete":".*","name_regex_keep":".*-master"}}'"https://gitlab.example.com/api/v4/projects/2"
curl --request PUT --header'Content-Type: application/json;charset=UTF-8'--header"PRIVATE-TOKEN: <your_access_token>"\