Commit 6463e1b0 authored by Marcel Amirault's avatar Marcel Amirault

Standardize codeblock fences (bash)

Find and replace bash with shell
parent 832eb5f8
......@@ -465,7 +465,7 @@ step of the sync.
1. Start a Rails console:
```bash
```shell
# For Omnibus installations
sudo gitlab-rails console
......@@ -540,7 +540,7 @@ statements.
Indicates the point where syncing actually begins:
```bash
```shell
Started syncing all providers for 'my_group' group
```
......@@ -551,7 +551,7 @@ log entries like this - one for each LDAP group. If you don't see an LDAP user
DN in this log entry, LDAP is not returning the user when we do the lookup.
Verify the user is actually in the LDAP group.
```bash
```shell
Members in 'ldap_group_1' LDAP group: ["uid=john0,ou=people,dc=example,dc=com",
"uid=mary0,ou=people,dc=example,dc=com", "uid=john1,ou=people,dc=example,dc=com",
"uid=mary1,ou=people,dc=example,dc=com", "uid=john2,ou=people,dc=example,dc=com",
......@@ -571,7 +571,7 @@ NOTE: **Note:**
10 is 'Guest', 20 is 'Reporter', 30 is 'Developer', 40 is 'Maintainer'
and 50 is 'Owner'.
```bash
```shell
Resolved 'my_group' group member access: {"uid=john0,ou=people,dc=example,dc=com"=>30,
"uid=mary0,ou=people,dc=example,dc=com"=>30, "uid=john1,ou=people,dc=example,dc=com"=>30,
"uid=mary1,ou=people,dc=example,dc=com"=>30, "uid=john2,ou=people,dc=example,dc=com"=>30,
......@@ -588,7 +588,7 @@ If you think a particular user should already exist in GitLab, but you're seeing
this entry, it could be due to a mismatched DN stored in GitLab. See
[User DN has changed](#User-DN-has-changed) to update the user's LDAP identity.
```bash
```shell
User with DN `uid=john0,ou=people,dc=example,dc=com` should have access
to 'my_group' group but there is no user in GitLab with that
identity. Membership will be updated once the user signs in for
......@@ -597,6 +597,6 @@ the first time.
Finally, the following entry says syncing has finished for this group:
```bash
```shell
Finished syncing all providers for 'my_group' group
```
......@@ -583,7 +583,7 @@ ldapsearch -H ldaps://$host:$port -D "$bind_dn" -y bind_dn_password.txt -b "$ba
- Run the following check command to make sure that the LDAP settings are
correct and GitLab can see your users:
```bash
```shell
# For Omnibus installations
sudo gitlab-rake gitlab:ldap:check
......
......@@ -94,7 +94,7 @@ The rake task will use a sample data and execute each of file hook. The output
should be enough to determine if the system sees your file hook and if it was
executed without errors.
```bash
```shell
# Omnibus installations
sudo gitlab-rake file_hooks:validate
......
......@@ -135,7 +135,7 @@ do this manually.
1. SSH in to the database node in the **secondary** and trigger PostgreSQL to
promote to read-write:
```bash
```shell
sudo gitlab-pg-ctl promote
```
......@@ -157,7 +157,7 @@ do this manually.
1. Promote the **secondary** to **primary**. SSH into a single application
server and execute:
```bash
```shell
sudo gitlab-rake geo:set_secondary_as_primary
```
......
......@@ -13,13 +13,13 @@ developed and tested. We aim to be compatible with most external
1. SSH into a GitLab **primary** application server and login as root:
```bash
```shell
sudo -i
```
1. Execute the command below to define the node as **primary** node:
```bash
```shell
gitlab-ctl set-geo-primary-node
```
......@@ -100,7 +100,7 @@ To configure the connection to the external read-replica database and enable Log
1. SSH into a GitLab **secondary** application server and login as root:
```bash
```shell
sudo -i
```
......@@ -147,7 +147,7 @@ the tracking database on port 5432.
1. SSH into a GitLab **secondary** server and login as root:
```bash
```shell
sudo -i
```
......@@ -168,7 +168,7 @@ the tracking database on port 5432.
1. Run the tracking database migrations:
```bash
```shell
gitlab-rake geo:db:create
gitlab-rake geo:db:migrate
```
......@@ -179,7 +179,7 @@ the tracking database on port 5432.
Save the script below in a file, ex. `/tmp/geo_fdw.sh` and modify the connection
params to match your environment. Execute it to set up the FDW connection.
```bash
```shell
#!/bin/bash
# Secondary Database connection params:
......@@ -213,6 +213,6 @@ the tracking database on port 5432.
1. Save the file and [restart GitLab](../../restart_gitlab.md#omnibus-gitlab-restart)
1. Populate the FDW tables:
```bash
```shell
gitlab-rake geo:db:refresh_foreign_tables
```
......@@ -10,13 +10,13 @@ Once removed from the Geo admin page, you must stop and uninstall the **secondar
1. On the **secondary** node, stop GitLab:
```bash
```shell
sudo gitlab-ctl stop
```
1. On the **secondary** node, uninstall GitLab:
```bash
```shell
# Stop gitlab and remove its supervision process
sudo gitlab-ctl uninstall
......@@ -31,7 +31,7 @@ Once GitLab has been uninstalled from the **secondary** node, the replication sl
1. On the **primary** node, start a PostgreSQL console session:
```bash
```shell
sudo gitlab-psql
```
......
......@@ -8,7 +8,7 @@ Pushing directly to a **secondary** node (for both HTTP, SSH including Git LFS)
Example of the output you will see when pushing to a **secondary** node:
```bash
```shell
$ git push
remote:
remote: You're pushing to a Geo secondary. We'll help you by proxying this
......
......@@ -357,7 +357,7 @@ is prepended with the relevant node for better clarity:
1. **(secondary)** Save the snippet below in a file, let's say `/tmp/replica.sh`. Modify the
embedded paths if necessary:
```bash
```shell
#!/bin/bash
PORT="5432"
......
......@@ -96,7 +96,7 @@ one is located in `config.yml` of GitLab Shell.
Here is an example workflow of uploading a very large file and then checking it
into your Git repository:
```bash
```shell
git clone git@example.com:group/project.git
git annex init 'My Laptop' # initialize the annex project and give an optional description
......@@ -165,7 +165,7 @@ repository.
Downloading a single large file is also very simple:
```bash
```shell
git clone git@gitlab.example.com:group/project.git
git annex sync # sync Git branches but not the large file
......@@ -174,7 +174,7 @@ git annex get debian.iso # download the large file
To download all files:
```bash
```shell
git clone git@gitlab.example.com:group/project.git
git annex sync --content # sync Git branches and download all the large files
......
......@@ -1009,7 +1009,7 @@ If you are having trouble connecting to a Gitaly node with command line (CLI) to
Verify that you can reach Gitaly via TCP:
```bash
```shell
sudo gitlab-rake gitlab:tcp_check[GITALY_SERVER_IP,GITALY_LISTEN_PORT]
```
......@@ -1019,7 +1019,7 @@ If you use proxy servers in your command line environment, such as Bash, these c
If you use Bash or a compatible command line environment, run the following commands to determine whether you have proxy servers configured:
```bash
```shell
echo $http_proxy
echo $https_proxy
```
......@@ -1028,7 +1028,7 @@ If either of these variables have a value, your Gitaly CLI connections may be ge
To remove the proxy setting, run the following commands (depending on which variables had values):
```bash
```shell
unset http_proxy
unset https_proxy
```
......
......@@ -186,7 +186,7 @@ single NFS mount point as you normally would in `/etc/fstab`. Let's assume your
NFS mount point is `/gitlab-nfs`. Then, add the following bind mounts in
`/etc/fstab`:
```bash
```shell
/gitlab-nfs/gitlab-data/git-data /var/opt/gitlab/git-data none bind 0 0
/gitlab-nfs/gitlab-data/.ssh /var/opt/gitlab/.ssh none bind 0 0
/gitlab-nfs/gitlab-data/uploads /var/opt/gitlab/gitlab-rails/uploads none bind 0 0
......
......@@ -978,7 +978,7 @@ To make sure your configuration is correct:
1. To simulate a failover on master Redis, SSH into the Redis server and run:
```bash
```shell
# port must match your master redis port, and the sleep time must be a few seconds bigger than defined one
redis-cli -h localhost -p 6379 DEBUG sleep 20
```
......
......@@ -11,6 +11,6 @@ increasing the `local_markdown_version` setting in application settings. This c
be done by [changing the application settings through
the API](../api/settings.md#change-application-settings):
```bash
```shell
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/application/settings?local_markdown_version=<increased_number>
```
......@@ -156,7 +156,7 @@ _The artifacts are stored by default in
1. Save the file and [reconfigure GitLab][] for the changes to take effect.
1. Migrate any existing local artifacts to the object storage:
```bash
```shell
gitlab-rake gitlab:artifacts:migrate
```
......@@ -184,7 +184,7 @@ _The artifacts are stored by default in
1. Save the file and [restart GitLab][] for the changes to take effect.
1. Migrate any existing local artifacts to the object storage:
```bash
```shell
sudo -u git -H bundle exec rake gitlab:artifacts:migrate RAILS_ENV=production
```
......
......@@ -178,7 +178,7 @@ On Omnibus installations, the settings are prefixed by `lfs_object_store_`:
1. Save the file and [reconfigure GitLab]s for the changes to take effect.
1. Migrate any existing local LFS objects to the object storage:
```bash
```shell
gitlab-rake gitlab:lfs:migrate
```
......@@ -214,7 +214,7 @@ For source installations the settings are nested under `lfs:` and then
1. Save the file and [restart GitLab][] for the changes to take effect.
1. Migrate any existing local LFS objects to the object storage:
```bash
```shell
sudo -u git -H bundle exec rake gitlab:lfs:migrate RAILS_ENV=production
```
......
......@@ -50,7 +50,7 @@ Lets take a look at the workflow when you need to check large files into your Gi
repository with Git LFS. For example, if you want to upload a very large file and
check it into your Git repository:
```bash
```shell
git clone git@gitlab.example.com:group/project.git
git lfs install # initialize the Git LFS project
git lfs track "*.iso" # select the file extensions that you want to treat as large files
......@@ -59,7 +59,7 @@ git lfs track "*.iso" # select the file extensions that you want
Once a certain file extension is marked for tracking as a LFS object you can use
Git as usual without having to redo the command to track a file with the same extension:
```bash
```shell
cp ~/tmp/debian.iso ./ # copy a large file into the current directory
git add . # add the large file to the project
git commit -am "Added Debian iso" # commit the file meta data
......@@ -69,7 +69,7 @@ git push origin master # sync the git repo and large file to the
**Make sure** that `.gitattributes` is tracked by Git. Otherwise Git
LFS will not be working properly for people cloning the project:
```bash
```shell
git add .gitattributes
```
......@@ -78,14 +78,14 @@ LFS-tracked files and clones them via HTTP. If you performed the `git clone`
command with a SSH URL, you have to enter your GitLab credentials for HTTP
authentication.
```bash
```shell
git clone git@gitlab.example.com:group/project.git
```
If you already cloned the repository and you want to get the latest LFS object
that are on the remote repository, eg. for a branch from origin:
```bash
```shell
git lfs fetch origin master
```
......@@ -101,14 +101,14 @@ The first thing to do before using File Locking is to tell Git LFS which
kind of files are lockable. The following command will store PNG files
in LFS and flag them as lockable:
```bash
```shell
git lfs track "*.png" --lockable
```
After executing the above command a file named `.gitattributes` will be
created or updated with the following content:
```bash
```shell
*.png filter=lfs diff=lfs merge=lfs -text lockable
```
......@@ -116,7 +116,7 @@ You can also register a file type as lockable without using LFS
(In order to be able to lock/unlock a file you need a remote server that implements the LFS File Locking API),
in order to do that you can edit the `.gitattributes` file manually:
```bash
```shell
*.pdf lockable
```
......@@ -128,14 +128,14 @@ need to lock the file before editing it.
Once you're ready to edit your file you need to lock it first:
```bash
```shell
git lfs lock images/banner.png
Locked images/banner.png
```
This will register the file as locked in your name on the server:
```bash
```shell
git lfs locks
images/banner.png joe ID:123
```
......@@ -143,13 +143,13 @@ images/banner.png joe ID:123
Once you have pushed your changes, you can unlock the file so others can
also edit it:
```bash
```shell
git lfs unlock images/banner.png
```
You can also unlock by id:
```bash
```shell
git lfs unlock --id=123
```
......@@ -157,7 +157,7 @@ If for some reason you need to unlock a file that was not locked by you,
you can use the `--force` flag as long as you have a `maintainer` access on
the project:
```bash
```shell
git lfs unlock --id=123 --force
```
......@@ -183,7 +183,7 @@ available to the project anymore. Probably the object was removed from the serve
Git LFS will log the failures into a log file.
To view this log file, while in project directory:
```bash
```shell
git lfs logs last
```
......@@ -215,7 +215,7 @@ This behaviour is caused by Git LFS using HTTPS connections by default when a
To prevent this from happening, set the lfs url in project Git config:
```bash
```shell
git config --add lfs.url "http://gitlab.example.com/group/project.git/info/lfs"
```
......@@ -235,7 +235,7 @@ you use. This is described in [Git credentials man pages](https://git-scm.com/do
For example, you can tell Git to remember the password for a period of time in
which you expect to push the objects:
```bash
```shell
git config --global credential.helper 'cache --timeout=3600'
```
......
......@@ -48,7 +48,7 @@ Fire up a terminal, navigate to your Git repository and:
1. Disable `git-annex`:
```bash
```shell
git annex sync --content
git annex direct
git annex uninit
......@@ -85,7 +85,7 @@ if the server also has Git Annex 6 installed. Read more in the
1. Backup your repository
```bash
```shell
cd repository
git annex sync --content
cd ..
......@@ -97,14 +97,14 @@ if the server also has Git Annex 6 installed. Read more in the
1. Use `annex direct`:
```bash
```shell
cd repository
git annex direct
```
The output should be similar to this:
```bash
```shell
commit
On branch master
Your branch is up-to-date with 'origin/master'.
......@@ -116,13 +116,13 @@ if the server also has Git Annex 6 installed. Read more in the
1. Disable Git Annex with [`annex uninit`][uninit]:
```bash
```shell
git annex uninit
```
The output should be similar to this:
```bash
```shell
unannex debian.iso ok
Deleted branch git-annex (was 2534d2c).
```
......@@ -131,13 +131,13 @@ if the server also has Git Annex 6 installed. Read more in the
1. Switch back to `indirect` mode:
```bash
```shell
git annex indirect
```
The output should be similar to this:
```bash
```shell
(merging origin/git-annex into git-annex...)
(recording state in git...)
commit (recording state in git...)
......@@ -165,7 +165,7 @@ GitLab.com), therefore, you don't need to do anything server-side.
1. First, make sure you have `git-lfs` installed locally:
```bash
```shell
git lfs help
```
......@@ -174,7 +174,7 @@ GitLab.com), therefore, you don't need to do anything server-side.
1. Inside the repo, run the following command to initiate LFS:
```bash
```shell
git lfs install
```
......@@ -182,7 +182,7 @@ GitLab.com), therefore, you don't need to do anything server-side.
can track specific files, all files containing the same extension, or an
entire directory:
```bash
```shell
git lfs track images/01.png # per file
git lfs track **/*.png # per extension
git lfs track images/ # per directory
......@@ -194,7 +194,7 @@ GitLab.com), therefore, you don't need to do anything server-side.
1. Add the files, commit and push them to GitLab:
```bash
```shell
git add .
git commit -m "commit message"
git push
......@@ -217,7 +217,7 @@ branches created by Git Annex: `git-annex`, and all under `synced/`.
You can also do this on the command line with:
```bash
```shell
git branch -d synced/master
git branch -d synced/git-annex
git push origin :synced/master
......@@ -229,7 +229,7 @@ git remote prune origin
If there are still some Annex objects inside your repository (`.git/annex/`)
or references inside `.git/config`, run `annex uninit` again:
```bash
```shell
git annex uninit
```
......
......@@ -17,7 +17,7 @@ changes.
Finally, a restart of all GitLab processes is required for the changes to take
effect:
```bash
```shell
# For Omnibus installations
sudo gitlab-ctl restart
......
......@@ -110,14 +110,14 @@ buffer size is set to the same value, the default value is almost never enough.
To set the OS buffer size to 200 MB, on Linux you can run the following command:
```bash
```shell
sysctl -w net.core.rmem_max=209715200
```
To make this permanent, add the following to `/etc/sysctl.conf` and restart the
server:
```bash
```shell
net.core.rmem_max=209715200
```
......@@ -154,7 +154,7 @@ and password (`-password <password>`) you set earlier to the commands below._
Run the following command to create a database named `gitlab`:
```bash
```shell
influx -execute 'CREATE DATABASE gitlab'
```
......@@ -162,7 +162,7 @@ The name **must** be `gitlab`, do not use any other name.
Next, make sure that the database was successfully created:
```bash
```shell
influx -execute 'SHOW DATABASES'
```
......
......@@ -207,7 +207,7 @@ For debugging purposes, you can start extra Sidekiq processes by using the comma
`/opt/gitlab/embedded/service/gitlab-rails/ee/bin/sidekiq-cluster`. This command
takes arguments using the following syntax:
```bash
```shell
/opt/gitlab/embedded/service/gitlab-rails/ee/bin/sidekiq-cluster [QUEUE,QUEUE,...] [QUEUE, ...]
```
......@@ -225,14 +225,14 @@ For example, say you want to start 2 extra processes: one to process the
`process_commit` queue, and one to process the `post_receive` queue. This can be
done as follows:
```bash
```shell
/opt/gitlab/embedded/service/gitlab-rails/ee/bin/sidekiq-cluster process_commit post_receive
```
If you instead want to start one process processing both queues, you'd use the
following syntax:
```bash
```shell
/opt/gitlab/embedded/service/gitlab-rails/ee/bin/sidekiq-cluster process_commit,post_receive
```
......@@ -240,7 +240,7 @@ If you want to have one Sidekiq process dealing with the `process_commit` and
`post_receive` queues, and one process to process the `gitlab_shell` queue,
you'd use the following:
```bash
```shell
/opt/gitlab/embedded/service/gitlab-rails/ee/bin/sidekiq-cluster process_commit,post_receive gitlab_shell
```
......@@ -272,7 +272,7 @@ The `sidekiq-cluster` command can store its PID in a file. By default no PID
file is written, but this can be changed by passing the `--pidfile` option to
`sidekiq-cluster`. For example:
```bash
```shell
/opt/gitlab/embedded/service/gitlab-rails/ee/bin/sidekiq-cluster --pidfile /var/run/gitlab/sidekiq_cluster.pid process_commit
```
......
......@@ -60,7 +60,7 @@ AuthorizedKeysCommandUser git
Reload OpenSSH:
```bash
```shell
# Debian or Ubuntu installations
sudo service ssh reload
......
......@@ -169,7 +169,7 @@ If your certificate provider provides the CA Bundle certificates, append them to
Users should now be able to login to the Container Registry with their GitLab
credentials using:
```bash
```shell
docker login gitlab.example.com:4567
```
......@@ -194,7 +194,7 @@ Let's assume that you want the container Registry to be accessible at
`/etc/gitlab/ssl/registry.gitlab.example.com.key` and make sure they have
correct permissions:
```bash
```shell
chmod 600 /etc/gitlab/ssl/registry.gitlab.example.com.*
```
......@@ -234,7 +234,7 @@ registry_nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/certificate.key"
Users should now be able to login to the Container Registry using their GitLab
credentials:
```bash
```shell
docker login registry.gitlab.example.com
```
......@@ -793,7 +793,7 @@ After adding the setting, [reconfigure GitLab](../restart_gitlab.md#omnibus-gitl
Use curl to request debug output from the debug server:
```bash
```shell
curl localhost:5001/debug/health
curl localhost:5001/debug/vars
```
......
......@@ -172,6 +172,6 @@ sudo gitlab-rake "gitlab:packages:migrate"
For installations from source:
```bash
```shell
RAILS_ENV=production sudo -u git -H bundle exec rake gitlab:packages:migrate
```
......@@ -360,14 +360,14 @@ that method from working. Use the following workaround:
1. Append your GitLab server TLS/SSL certficate to `/opt/gitlab/embedded/ssl/certs/cacert.pem` where `gitlab-domain-example.com` is your GitLab application URL
```bash
```shell
printf "\ngitlab-domain-example.com\n===========================\n" | sudo tee --append /opt/gitlab/embedded/ssl/certs/cacert.pem
echo -n | openssl s_client -connect gitlab-domain-example.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee --append /opt/gitlab/embedded/ssl/certs/cacert.pem
```
1. [Restart](../restart_gitlab.md) the GitLab Pages Daemon. For GitLab Omnibus instances:
```bash
```shell
sudo gitlab-ctl restart gitlab-pages
```
......
......@@ -98,7 +98,7 @@ The Pages daemon doesn't listen to the outside world.
1. Install the Pages daemon:
```bash
```shell
cd /home/git
sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-pages.git
cd gitlab-pages
......@@ -108,7 +108,7 @@ The Pages daemon doesn't listen to the outside world.
1. Go to the GitLab installation directory:
```bash
```shell
cd /home/git/gitlab
```
......@@ -138,7 +138,7 @@ The Pages daemon doesn't listen to the outside world.
1. Copy the `gitlab-pages` NGINX configuration file:
```bash
```shell
sudo cp lib/support/nginx/gitlab-pages /etc/nginx/sites-available/gitlab-pages.conf
sudo ln -sf /etc/nginx/sites-{available,enabled}/gitlab-pages.conf
```
......@@ -160,7 +160,7 @@ outside world.
1. Install the Pages daemon:
```bash
```shell
cd /home/git
sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-pages.git
cd gitlab-pages
......@@ -170,7 +170,7 @@ outside world.
1. In `gitlab.yml`, set the port to `443` and https to `true`:
```bash
```shell
## GitLab Pages
pages:
enabled: true
......@@ -195,7 +195,7 @@ outside world.
1. Copy the `gitlab-pages-ssl` NGINX configuration file:
```bash
```shell
sudo cp lib/support/nginx/gitlab-pages-ssl /etc/nginx/sites-available/gitlab-pages-ssl.conf
sudo ln -sf /etc/nginx/sites-{available,enabled}/gitlab-pages-ssl.conf
```
......@@ -225,7 +225,7 @@ world. Custom domains are supported, but no TLS.
1. Install the Pages daemon:
```bash
```shell
cd /home/git
sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-pages.git
cd gitlab-pages
......@@ -263,7 +263,7 @@ world. Custom domains are supported, but no TLS.
1. Copy the `gitlab-pages-ssl` NGINX configuration file:
```bash
```shell
sudo cp lib/support/nginx/gitlab-pages /etc/nginx/sites-available/gitlab-pages.conf
sudo ln -sf /etc/nginx/sites-{available,enabled}/gitlab-pages.conf
```
......@@ -290,7 +290,7 @@ world. Custom domains and TLS are supported.
1. Install the Pages daemon:
```bash
```shell
cd /home/git
sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-pages.git
cd gitlab-pages
......@@ -332,7 +332,7 @@ world. Custom domains and TLS are supported.
1. Copy the `gitlab-pages-ssl` NGINX configuration file:
```bash
```shell
sudo cp lib/support/nginx/gitlab-pages-ssl /etc/nginx/sites-available/gitlab-pages-ssl.conf
sudo ln -sf /etc/nginx/sites-{available,enabled}/gitlab-pages-ssl.conf
```
......
......@@ -85,7 +85,7 @@ You can optionally run the pseudonymizer using the following environment variabl
- `PSEUDONYMIZER_OUTPUT_DIR` - where to store the output CSV files (defaults to `/tmp`)
- `PSEUDONYMIZER_BATCH` - the batch size when querying the DB (defaults to `100000`)
```bash
```shell
## Omnibus
sudo gitlab-rake gitlab:db:pseudonymizer
......
......@@ -33,13 +33,13 @@ integrity check described previously.
**Omnibus Installation**
```bash
```shell
sudo gitlab-rake gitlab:git:fsck
```
**Source Installation**
```bash
```shell
sudo -u git -H bundle exec rake gitlab:git:fsck RAILS_ENV=production
```
......@@ -58,7 +58,7 @@ Currently, integrity checks are supported for the following types of file:
**Omnibus Installation**
```bash
```shell
sudo gitlab-rake gitlab:artifacts:check
sudo gitlab-rake gitlab:lfs:check
sudo gitlab-rake gitlab:uploads:check
......@@ -66,7 +66,7 @@ sudo gitlab-rake gitlab:uploads:check
**Source Installation**
```bash
```shell
sudo -u git -H bundle exec rake gitlab:artifacts:check RAILS_ENV=production
sudo -u git -H bundle exec rake gitlab:lfs:check RAILS_ENV=production
sudo -u git -H bundle exec rake gitlab:uploads:check RAILS_ENV=production
......@@ -82,7 +82,7 @@ Variable | Type | Description
`ID_TO` | integer | Specifies the ID value to end at, inclusive of the value.
`VERBOSE` | boolean | Causes failures to be listed individually, rather than being summarized.
```bash
```shell
sudo gitlab-rake gitlab:artifacts:check BATCH=100 ID_FROM=50 ID_TO=250
sudo gitlab-rake gitlab:lfs:check BATCH=100 ID_FROM=50 ID_TO=250
sudo gitlab-rake gitlab:uploads:check BATCH=100 ID_FROM=50 ID_TO=250
......@@ -90,7 +90,7 @@ sudo gitlab-rake gitlab:uploads:check BATCH=100 ID_FROM=50 ID_TO=250
Example output:
```bash
```shell
$ sudo gitlab-rake gitlab:uploads:check
Checking integrity of Uploads
- 1..1350: Failures: 0
......@@ -107,7 +107,7 @@ Done!
Example verbose output:
```bash
```shell
$ sudo gitlab-rake gitlab:uploads:check VERBOSE=1
Checking integrity of Uploads
- 1..1350: Failures: 0
......
......@@ -11,13 +11,13 @@ This is equivalent of running `git repack -d` on a _bare_ repository.
**Omnibus Installation**
```bash
```shell
sudo gitlab-rake geo:git:housekeeping:incremental_repack
```
**Source Installation**
```bash
```shell
sudo -u git -H bundle exec rake geo:git:housekeeping:incremental_repack RAILS_ENV=production
```
......@@ -29,13 +29,13 @@ when this is enabled in GitLab.
**Omnibus Installation**
```bash
```shell
sudo gitlab-rake geo:git:housekeeping:full_repack
```
**Source Installation**
```bash
```shell
sudo -u git -H bundle exec rake geo:git:housekeeping:full_repack RAILS_ENV=production
```
......@@ -46,13 +46,13 @@ a reachability bitmap index when this is enabled in GitLab.
**Omnibus Installation**
```bash
```shell
sudo gitlab-rake geo:git:housekeeping:gc
```
**Source Installation**
```bash
```shell
sudo -u git -H bundle exec rake geo:git:housekeeping:gc RAILS_ENV=production
```
......@@ -63,12 +63,12 @@ can remove them using the rake task `geo:run_orphaned_project_registry_cleaner`:
**Omnibus Installation**
```bash
```shell
sudo gitlab-rake geo:run_orphaned_project_registry_cleaner
```
**Source Installation**
```bash
```shell
sudo -u git -H bundle exec rake geo:run_orphaned_project_registry_cleaner RAILS_ENV=production
```
......@@ -16,7 +16,7 @@ before/after the brackets. Also, Some shells (e.g., zsh) can interpret the open/
To import a project from the list of your GitHub projects available:
```bash
```shell
# Omnibus installations
sudo gitlab-rake "import:github[access_token,root,foo/bar]"
......@@ -32,7 +32,7 @@ will get created from your GitHub project. Subgroups are also possible: `foo/foo
To import a specific GitHub project (named `foo/github_repo` here):
```bash
```shell
# Omnibus installations
sudo gitlab-rake "import:github[access_token,root,foo/bar,foo/github_repo]"
......
......@@ -9,20 +9,20 @@ using the command below.
**Omnibus Installation**
```bash
```shell
sudo gitlab-rake gitlab:ldap:check
```
**Source Installation**
```bash
```shell
sudo -u git -H bundle exec rake gitlab:ldap:check RAILS_ENV=production
```
By default, the task will return a sample of 100 LDAP users. Change this
limit by passing a number to the check task:
```bash
```shell
rake gitlab:ldap:check[50]
```
......@@ -41,13 +41,13 @@ instead.
**Omnibus Installation**
```bash
```shell
sudo gitlab-rake gitlab:ldap:group_sync
```
**Source Installation**
```bash
```shell
bundle exec rake gitlab:ldap:group_sync
```
......@@ -79,13 +79,13 @@ as the `old_provider` and the correct provider as the `new_provider`.
**Omnibus Installation**
```bash
```shell
sudo gitlab-rake gitlab:ldap:rename_provider[old_provider,new_provider]
```
**Source Installation**
```bash
```shell
bundle exec rake gitlab:ldap:rename_provider[old_provider,new_provider] RAILS_ENV=production
```
......@@ -95,7 +95,7 @@ Consider beginning with the default server ID `main` (full provider `ldapmain`).
If we change `main` to `mycompany`, the `new_provider` is `ldapmycompany`.
To rename all user identities run the following command:
```bash
```shell
sudo gitlab-rake gitlab:ldap:rename_provider[ldapmain,ldapmycompany]
```
......@@ -116,13 +116,13 @@ for them:
**Omnibus Installation**
```bash
```shell
sudo gitlab-rake gitlab:ldap:rename_provider
```
**Source Installation**
```bash
```shell
bundle exec rake gitlab:ldap:rename_provider RAILS_ENV=production
```
......@@ -136,6 +136,6 @@ What is the new provider? Ex. 'ldapcustom': ldapmycompany
This tasks also accepts the `force` environment variable which will skip the
confirmation dialog:
```bash
```shell
sudo gitlab-rake gitlab:ldap:rename_provider[old_provider,new_provider] force=yes
```
......@@ -6,13 +6,13 @@ This command gathers information about your GitLab installation and the System i
**Omnibus Installation**
```bash
```shell
sudo gitlab-rake gitlab:env:info
```
**Source Installation**
```bash
```shell
bundle exec rake gitlab:env:info RAILS_ENV=production
```
......@@ -66,13 +66,13 @@ You may also have a look at our Troubleshooting Guides:
**Omnibus Installation**
```bash
```shell
sudo gitlab-rake gitlab:check
```
**Source Installation**
```bash
```shell
bundle exec rake gitlab:check RAILS_ENV=production
```
......@@ -129,13 +129,13 @@ In some case it is necessary to rebuild the `authorized_keys` file.
**Omnibus Installation**
```bash
```shell
sudo gitlab-rake gitlab:shell:setup
```
**Source Installation**
```bash
```shell
cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:shell:setup RAILS_ENV=production
```
......@@ -153,13 +153,13 @@ clear Redis' cache.
**Omnibus Installation**
```bash
```shell
sudo gitlab-rake cache:clear
```
**Source Installation**
```bash
```shell
cd /home/git/gitlab
sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production
```
......@@ -174,7 +174,7 @@ Omnibus packages.
**Source Installation**
```bash
```shell
cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:assets:compile RAILS_ENV=production
```
......@@ -194,13 +194,13 @@ in the GitLab Performance Monitoring database.
**Omnibus Installation**
```bash
```shell
sudo gitlab-rake gitlab:track_deployment
```
**Source Installation**
```bash
```shell
cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:track_deployment RAILS_ENV=production
```
......@@ -213,13 +213,13 @@ is included to help you with this:
**Omnibus Installation**
```bash
```shell
sudo gitlab-rake gitlab:tcp_check[example.com,80]
```
**Source Installation**
```bash
```shell
cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:tcp_check[example.com,80] RAILS_ENV=production
```
......@@ -238,13 +238,13 @@ To clear all exclusive leases:
DANGER: **DANGER**:
Don't run it while GitLab or Sidekiq is running
```bash
```shell
sudo gitlab-rake gitlab:exclusive_lease:clear
```
To specify a lease `type` or lease `type + id`, specify a scope:
```bash
```shell
# to clear all leases for repository garbage collection:
sudo gitlab-rake gitlab:exclusive_lease:clear[project_housekeeping:*]
......@@ -256,14 +256,14 @@ sudo gitlab-rake gitlab:exclusive_lease:clear[project_housekeeping:4]
To check the status of migrations, you can use the following rake task:
```bash
```shell
sudo gitlab-rake db:migrate:status
```
This will output a table with a `Status` of `up` or `down` for
each Migration ID.
```bash
```shell
database: gitlabhq_production
Status Migration ID Migration Name
......@@ -279,6 +279,6 @@ This could be as a result of [updating existing metrics](../../development/prome
To re-import the metrics you can run:
```bash
```shell
sudo gitlab-rake metrics:setup_common_metrics
```
......@@ -13,7 +13,7 @@
The GitLab Import/Export version can be checked by using:
```bash
```shell
# Omnibus installations
sudo gitlab-rake gitlab:import_export:version
......@@ -23,7 +23,7 @@ bundle exec rake gitlab:import_export:version RAILS_ENV=production
The current list of DB tables that will get exported can be listed by using:
```bash
```shell
# Omnibus installations
sudo gitlab-rake gitlab:import_export:data
......
......@@ -16,19 +16,19 @@ This task will schedule all your existing projects and attachments associated wi
**Omnibus Installation**
```bash
```shell
sudo gitlab-rake gitlab:storage:migrate_to_hashed
```
**Source Installation**
```bash
```shell
sudo -u git -H bundle exec rake gitlab:storage:migrate_to_hashed RAILS_ENV=production
```
They both also accept a range as environment variable:
```bash
```shell
# to migrate any non migrated project from ID 20 to 50.
export ID_FROM=20
export ID_TO=50
......@@ -63,19 +63,19 @@ Legacy storage type.
For Omnibus installations, run the following:
```bash
```shell
sudo gitlab-rake gitlab:storage:rollback_to_legacy
```
For source installations, run the following:
```bash
```shell
sudo -u git -H bundle exec rake gitlab:storage:rollback_to_legacy RAILS_ENV=production
```
Both commands accept a range as environment variable:
```bash
```shell
# to rollback any migrated project from ID 20 to 50.
export ID_FROM=20
export ID_TO=50
......@@ -95,13 +95,13 @@ To have a simple summary of projects using **Legacy** storage:
**Omnibus Installation**
```bash
```shell
sudo gitlab-rake gitlab:storage:legacy_projects
```
**Source Installation**
```bash
```shell
sudo -u git -H bundle exec rake gitlab:storage:legacy_projects RAILS_ENV=production
```
......@@ -109,13 +109,13 @@ To list projects using **Legacy** storage:
**Omnibus Installation**
```bash
```shell
sudo gitlab-rake gitlab:storage:list_legacy_projects
```
**Source Installation**
```bash
```shell
sudo -u git -H bundle exec rake gitlab:storage:list_legacy_projects RAILS_ENV=production
```
......@@ -126,13 +126,13 @@ To have a simple summary of projects using **Hashed** storage:
**Omnibus Installation**
```bash
```shell
sudo gitlab-rake gitlab:storage:hashed_projects
```
**Source Installation**
```bash
```shell
sudo -u git -H bundle exec rake gitlab:storage:hashed_projects RAILS_ENV=production
```
......@@ -140,13 +140,13 @@ To list projects using **Hashed** storage:
**Omnibus Installation**
```bash
```shell
sudo gitlab-rake gitlab:storage:list_hashed_projects
```
**Source Installation**
```bash
```shell
sudo -u git -H bundle exec rake gitlab:storage:list_hashed_projects RAILS_ENV=production
```
......@@ -156,13 +156,13 @@ To have a simple summary of project attachments using **Legacy** storage:
**Omnibus Installation**
```bash
```shell
sudo gitlab-rake gitlab:storage:legacy_attachments
```
**Source Installation**
```bash
```shell
sudo -u git -H bundle exec rake gitlab:storage:legacy_attachments RAILS_ENV=production
```
......@@ -170,13 +170,13 @@ To list project attachments using **Legacy** storage:
**Omnibus Installation**
```bash
```shell
sudo gitlab-rake gitlab:storage:list_legacy_attachments
```
**Source Installation**
```bash
```shell
sudo -u git -H bundle exec rake gitlab:storage:list_legacy_attachments RAILS_ENV=production
```
......@@ -186,13 +186,13 @@ To have a simple summary of project attachments using **Hashed** storage:
**Omnibus Installation**
```bash
```shell
sudo gitlab-rake gitlab:storage:hashed_attachments
```
**Source Installation**
```bash
```shell
sudo -u git -H bundle exec rake gitlab:storage:hashed_attachments RAILS_ENV=production
```
......@@ -200,13 +200,13 @@ To list project attachments using **Hashed** storage:
**Omnibus Installation**
```bash
```shell
sudo gitlab-rake gitlab:storage:list_hashed_attachments
```
**Source Installation**
```bash
```shell
sudo -u git -H bundle exec rake gitlab:storage:list_hashed_attachments RAILS_ENV=production
```
......
......@@ -17,13 +17,13 @@ described in the next section.
**Omnibus Installation**
```bash
```shell
gitlab-rake "gitlab:uploads:migrate:all"
```
**Source Installation**
```bash
```shell
sudo RAILS_ENV=production -u git -H bundle exec rake gitlab:uploads:migrate:all
```
......@@ -52,7 +52,7 @@ Variable | Type | Description
**Omnibus Installation**
```bash
```shell
# gitlab-rake gitlab:uploads:migrate[uploader_class, model_class, mount_point]
# Avatars
......@@ -80,7 +80,7 @@ gitlab-rake "gitlab:uploads:migrate[FileUploader, MergeRequest]"
>**Note:**
Use `RAILS_ENV=production` for every task.
```bash
```shell
# sudo -u git -H bundle exec rake gitlab:uploads:migrate
# Avatars
......@@ -112,13 +112,13 @@ To migrate all uploads created by legacy uploaders, run:
**Omnibus Installation**
```bash
```shell
gitlab-rake gitlab:uploads:legacy:migrate
```
**Source Installation**
```bash
```shell
bundle exec rake gitlab:uploads:legacy:migrate
```
......@@ -145,13 +145,13 @@ keeping in mind the task name in this case is `gitlab:uploads:migrate_to_local`.
**Omnibus Installation**
```bash
```shell
gitlab-rake "gitlab:uploads:migrate_to_local:all"
```
**Source Installation**
```bash
```shell
sudo RAILS_ENV=production -u git -H bundle exec rake gitlab:uploads:migrate_to_local:all
```
......
......@@ -22,7 +22,7 @@ Because EXIF data may contain sensitive information (e.g. GPS location), you
can remove EXIF data also from existing images which were uploaded before
with the following command:
```bash
```shell
sudo RAILS_ENV=production -u git -H bundle exec rake gitlab:uploads:sanitize:remove_exif
```
......@@ -46,13 +46,13 @@ each with a separate range of upload IDs (by setting `start_id` and `stop_id`).
To run the command without dry mode and remove EXIF data from all uploads, you can use:
```bash
```shell
sudo RAILS_ENV=production -u git -H bundle exec rake gitlab:uploads:sanitize:remove_exif[,,false,] 2>&1 | tee exif.log
```
To run the command without dry mode on uploads with ID between 100 and 5000 and pause for 0.1 second, you can use:
```bash
```shell
sudo RAILS_ENV=production -u git -H bundle exec rake gitlab:uploads:sanitize:remove_exif[100,5000,false,0.1] 2>&1 | tee exif.log
```
......
......@@ -118,7 +118,7 @@ to validate. You can do so by specifying a range with the operation.
This is an example of how to limit the rollout to Project IDs 50 to 100, running in
an Omnibus GitLab installation:
```bash
```shell
sudo gitlab-rake gitlab:storage:migrate_to_hashed ID_FROM=50 ID_TO=100
```
......@@ -139,7 +139,7 @@ To schedule a complete rollback, see the
The rollback task also supports specifying a range of Project IDs. Here is an example
of limiting the rollout to Project IDs 50 to 100, in an Omnibus GitLab installation:
```bash
```shell
sudo gitlab-rake gitlab:storage:rollback_to_legacy ID_FROM=50 ID_TO=100
```
......
......@@ -31,7 +31,7 @@ GitLab Rails application (Unicorn) as well as the other components, like:
There may be times in the documentation where you will be asked to _restart_
GitLab. In that case, you need to run the following command:
```bash
```shell
sudo gitlab-ctl restart
```
......@@ -51,13 +51,13 @@ ok: run: unicorn: (pid 11338) 0s
To restart a component separately, you can append its service name to the
`restart` command. For example, to restart **only** NGINX you would run:
```bash
```shell
sudo gitlab-ctl restart nginx
```
To check the status of GitLab services, run:
```bash
```shell
sudo gitlab-ctl status
```
......@@ -79,7 +79,7 @@ GitLab. Remember that this method applies only for the Omnibus packages.
Reconfigure Omnibus GitLab with:
```bash
```shell
sudo gitlab-ctl reconfigure
```
......@@ -152,7 +152,7 @@ the [cloud native Helm Chart](https://docs.gitlab.com/charts/). Usually, it shou
enough to restart a specific component separately (`gitaly`, `unicorn`,
`workhorse`, `gitlab-shell`, etc.) by deleting all the pods related to it:
```bash
```shell
kubectl delete pods -l release=<helm release name>,app=<component name>
```
......
......@@ -111,7 +111,7 @@ declined or an error occurs during the Git hook, your script should:
This hook script written in bash will generate the following message in GitLab's UI:
```bash
```shell
#!/bin/sh
echo "GL-HOOK-ERR: My custom error message.";
exit 1
......
......@@ -67,7 +67,7 @@ extensions), which contain the following in a single encrypted file:
In order to export the required files in PEM encoding from the PKCS#12 file,
the `openssl` command can be used:
```bash
```shell
#-- Extract private key in PEM encoding (no password, unencrypted)
$ openssl pkcs12 -in gitlab.p12 -nocerts -nodes -out gitlab.key
......
......@@ -35,7 +35,7 @@ The steps to configure this setting through the Rails console are:
1. Start the Rails console:
```bash
```shell
# For Omnibus installations
sudo gitlab-rails console
......@@ -60,12 +60,12 @@ To retrieve the current value, start the Rails console and run:
The process to set the snippets size limit through the Application Settings API is
exactly the same as you would do to [update any other setting](../../api/settings.md#change-application-settings).
```bash
```shell
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/application/settings?snippet_size_limit=52428800
```
You can also use the API to [retrieve the current value](../../api/settings.md#get-current-application-settings).
```bash
```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/application/settings
```
......@@ -332,7 +332,7 @@ bind ports 9200/9300 so it can be used.
The following is an example of running a docker container of Elasticsearch v7.2.0:
```bash
```shell
docker pull docker.elastic.co/elasticsearch/elasticsearch:7.2.0
docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.2.0
```
......
......@@ -30,7 +30,7 @@ should and, if needed, update the script for the latest version of GitLab.
If the script you want to run is short, you can use the Rails Runner to avoid
entering the rails console in the first place. Here's an example of its use:
```bash
```shell
gitlab-rails runner "RAILS_COMMAND"
# Example with a 2-line script
......@@ -130,19 +130,19 @@ end
### Check the GitLab version fast
```bash
```shell
grep -m 1 gitlab /opt/gitlab/version-manifest.txt
```
### Debugging SSH
```bash
```shell
GIT_SSH_COMMAND="ssh -vvv" git clone <repository>
```
### Debugging over HTTPS
```bash
```shell
GIT_CURL_VERBOSE=1 GIT_TRACE=1 git clone <repository>
```
......@@ -301,19 +301,19 @@ correctly named empty project using the steps below.
Move the new repository to the empty repository:
```bash
```shell
mv /var/opt/gitlab/git-data/repositories/<group>/<new-project> /var/opt/gitlab/git-data/repositories/<group>/<empty-project>
```
Make sure the permissions are correct:
```bash
```shell
chown -R git:git <path-to-directory>.git
```
Clear the cache:
```bash
```shell
sudo gitlab-rake cache:clear
```
......@@ -489,7 +489,7 @@ User.active.count
::HistoricalData.max_historical_user_count
```
```bash
```shell
# Using curl and jq (up to a max 100, see pagination docs https://docs.gitlab.com/ee/api/#pagination
curl --silent --header "Private-Token: ********************" "https://gitlab.example.com/api/v4/users?per_page=100&active" | jq --compact-output '.[] | [.id,.name,.username]'
```
......@@ -1034,7 +1034,7 @@ This script will go through all the encrypted variables and count how many are n
to be decrypted. Might be helpful to run on multiple nodes to see which `gitlab-secrets.json`
file is most up to date:
```bash
```shell
wget -O /tmp/bad-decrypt.rb https://gitlab.com/snippets/1730735/raw
gitlab-rails runner /tmp/bad-decrypt.rb
```
......@@ -1075,7 +1075,7 @@ two-factor authentication.
This script will search for all encrypted tokens that are causing decryption errors,
and update or reset as needed:
```bash
```shell
wget -O /tmp/encrypted-tokens.rb https://gitlab.com/snippets/1876342/raw
gitlab-rails runner /tmp/encrypted-tokens.rb
```
......
......@@ -20,13 +20,13 @@ and they will assist you with any issues you are having.
- How to authorize to your GCP project (can be especially useful if you have projects
under different GCP accounts):
```bash
```shell
gcloud auth login
```
- How to access Kubernetes dashboard:
```bash
```shell
# for minikube:
minikube dashboard —url
# for non-local installations if access via Kubectl is configured:
......@@ -42,7 +42,7 @@ and they will assist you with any issues you are having.
- How to copy a file from local machine to a pod:
```bash
```shell
kubectl cp file-name pod-name:./destination-path
```
......@@ -51,19 +51,19 @@ and they will assist you with any issues you are having.
- Check logs via Kubernetes dashboard.
- Check logs via Kubectl:
```bash
```shell
kubectl logs <unicorn pod> -c dependencies
```
- How to tail all Kubernetes cluster events in real time:
```bash
```shell
kubectl get events -w --all-namespaces
```
- How to get logs of the previously terminated pod instance:
```bash
```shell
kubectl logs <pod-name> --previous
```
......@@ -79,13 +79,13 @@ and they will assist you with any issues you are having.
- Tailing logs of a separate pod. An example for a Unicorn pod:
```bash
```shell
kubectl logs gitlab-unicorn-7656fdd6bf-jqzfs -c unicorn
```
- Tail and follow all pods that share a label (in this case, `unicorn`):
```bash
```shell
# all containers in the unicorn pods
kubectl logs -f -l app=unicorn --all-containers=true --max-log-requests=50
......@@ -96,21 +96,21 @@ and they will assist you with any issues you are having.
- One can stream logs from all containers at once, similar to the Omnibus
command `gitlab-ctl tail`:
```bash
```shell
kubectl logs -f -l release=gitlab --all-containers=true --max-log-requests=100
```
- Check all events in the `gitlab` namespace (the namespace name can be different if you
specified a different one when deploying the Helm chart):
```bash
```shell
kubectl get events -w --namespace=gitlab
```
- Most of the useful GitLab tools (console, rake tasks, etc) are found in the task-runner
pod. You may enter it and run commands inside or run them from the outside:
```bash
```shell
# find the pod
kubectl get pods | grep task-runner
......@@ -145,7 +145,7 @@ and they will assist you with any issues you are having.
- How to get your initial admin password <https://docs.gitlab.com/charts/installation/deployment.html#initial-login>:
```bash
```shell
# find the name of the secret containing the password
kubectl get secrets | grep initial-root
# decode it
......@@ -154,19 +154,19 @@ and they will assist you with any issues you are having.
- How to connect to a GitLab Postgres database:
```bash
```shell
kubectl exec -it <task-runner-pod-name> -- /srv/gitlab/bin/rails dbconsole -p
```
- How to get info about Helm installation status:
```bash
```shell
helm status name-of-installation
```
- How to update GitLab installed using Helm Chart:
```bash
```shell
helm repo upgrade
# get current values and redirect them to yaml file (analogue of gitlab.rb values)
......@@ -185,7 +185,7 @@ and they will assist you with any issues you are having.
- Modify the `gitlab.yaml` file.
- Run the following command to apply changes:
```bash
```shell
helm upgrade <release name> <chart path> -f gitlab.yaml
```
......@@ -197,20 +197,20 @@ to those documents for details.
- Install Kubectl via Homebrew:
```bash
```shell
brew install kubernetes-cli
```
- Install Minikube via Homebrew:
```bash
```shell
brew cask install minikube
```
- Start Minikube and configure it. If Minikube cannot start, try running `minikube delete && minikube start`
and repeat the steps:
```bash
```shell
minikube start --cpus 3 --memory 8192 # minimum amount for GitLab to work
minikube addons enable ingress
minikube addons enable kube-dns
......@@ -218,7 +218,7 @@ to those documents for details.
- Install Helm via Homebrew and initialize it:
```bash
```shell
brew install kubernetes-helm
helm init --service-account tiller
```
......@@ -231,7 +231,7 @@ to those documents for details.
- Install the GitLab Helm Chart:
```bash
```shell
helm repo add gitlab https://charts.gitlab.io
helm install --name gitlab -f <path-to-yaml-file> gitlab/gitlab
```
......
......@@ -23,7 +23,7 @@ on. Contributions are welcome to help add them.
### Distro Information
```bash
```shell
# Debian/Ubuntu
uname -a
lsb_release -a
......@@ -38,14 +38,14 @@ cat /etc/os-release
### Shut down or Reboot
```bash
```shell
shutdown -h now
reboot
```
### Permissions
```bash
```shell
# change the user:group ownership of a file/dir
chown root:git <file_or_dir>
......@@ -55,7 +55,7 @@ chmod u+x <file>
### Files & Dirs
```bash
```shell
# create a new directory and all subdirectories
mkdir -p dir/dir2/dir3
......@@ -71,7 +71,7 @@ sed -i 's/original-text/new-text/g' <filename>
### See all set environment variables
```bash
```shell
env
```
......@@ -79,7 +79,7 @@ env
### File names
```bash
```shell
# search for a file in a filesystem
find . -name 'filename.rb' -print
......@@ -95,7 +95,7 @@ history
### File contents
```bash
```shell
# -B/A = show 2 lines before/after search_term
grep -B 2 -A 2 search_term <filename>
......@@ -114,7 +114,7 @@ fgrep -R string_pattern <filename or directory>
### CLI
```bash
```shell
# View command history
history
......@@ -132,7 +132,7 @@ sudo !!
### Memory, Disk, & CPU usage
```bash
```shell
# disk space info. The '-h' gives the data in human-readable values
df -h
......@@ -157,7 +157,7 @@ top -o %CPU
### Strace
```bash
```shell
# strace a process
strace -tt -T -f -y -s 1024 -p <pid>
......@@ -274,7 +274,7 @@ small differences should not be considered significant.
### Ports
```bash
```shell
# Find the programs that are listening on ports
netstat -plnt
ss -plnt
......@@ -283,7 +283,7 @@ lsof -i -P | grep <port>
### Internet/DNS
```bash
```shell
# Show domain IP address
dig +short example.com
nslookup example.com
......@@ -302,7 +302,7 @@ curl --head --location https://example.com
## Package Management
```bash
```shell
# Debian/Ubuntu
# List packages
......@@ -332,7 +332,7 @@ rpm -qa | grep <package>
## Logs
```bash
```shell
# Print last lines in log file where 'n'
# is the number of lines to print
tail -n /path/to/log/file
......
......@@ -83,13 +83,13 @@ To fix this problem:
If your GitLab instance is using a self-signed certificate, or the certificate is signed by an internal certificate authority (CA), you might run into the following errors when attempting to perform Git operations:
```bash
```shell
$ git clone https://gitlab.domain.tld/group/project.git
Cloning into 'project'...
fatal: unable to access 'https://gitlab.domain.tld/group/project.git/': SSL certificate problem: self signed certificate
```
```bash
```shell
$ git clone https://gitlab.domain.tld/group/project.git
Cloning into 'project'...
fatal: unable to access 'https://gitlab.domain.tld/group/project.git/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
......@@ -107,6 +107,6 @@ To fix this problem:
- Disable SSL verification in your Git client. Note that this intended as a temporary measure as it could be considered a **security risk**.
```bash
```shell
git config --global http.sslVerify false
```
......@@ -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"
......
......@@ -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
```
......@@ -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
```
......
......@@ -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
```
......
......@@ -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
```
......
......@@ -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"
```
......
......@@ -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"
```
......@@ -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
```
......@@ -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
```
......
......@@ -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
......
......@@ -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"
```
This diff is collapsed.
......@@ -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"
```
......
......@@ -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
```
......
......@@ -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
```
......
......@@ -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
```
......
......@@ -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
```
......
......@@ -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
```
......
......@@ -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
```
......@@ -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
```
......@@ -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
```
......
......@@ -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
```
......
......@@ -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
```
......
......@@ -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
```
......@@ -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
```
......@@ -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
```
......
......@@ -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
```
......
......@@ -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"
```
......
......@@ -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
```
......
......@@ -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"
```
......
......@@ -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
```
......@@ -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
```
......
......@@ -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
```
......
......@@ -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
```
......@@ -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"
```
......
......@@ -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\"]}}"}'
```
......
......@@ -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"
```
......
......@@ -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
```
......
......@@ -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
```
......
......@@ -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
```
......
......@@ -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
```
......
......@@ -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
```
......
......@@ -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
```
......@@ -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
```
......
......@@ -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
```
......
......@@ -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
```
......@@ -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
```
......@@ -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
```
......
......@@ -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
```
......@@ -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
```
......
......@@ -548,7 +548,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"
```
......@@ -1229,7 +1229,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"
```
......@@ -1312,7 +1312,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"
```
......@@ -1401,7 +1401,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"
```
......@@ -1490,7 +1490,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"
```
......@@ -1531,7 +1531,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"
```
......@@ -1559,7 +1559,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"
```
......@@ -1667,7 +1667,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"
```
......@@ -1811,7 +1811,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
```
......@@ -1857,7 +1857,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
```
......@@ -2025,7 +2025,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
```
......@@ -2184,7 +2184,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
```
......
......@@ -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'
```
......
......@@ -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'
```
......
......@@ -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"
```
......
......@@ -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"}' \
......
......@@ -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
```
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment