Commit e4d7915e authored by Nick Gaskill's avatar Nick Gaskill

Merge branch 'szpak-master-patch-75987' into 'master'

Improve sample curl commands with Maven artifacts fetching

See merge request gitlab-org/gitlab!73733
parents 0451abcb e4911fa9
...@@ -36,13 +36,13 @@ GET packages/maven/*path/:file_name ...@@ -36,13 +36,13 @@ GET packages/maven/*path/:file_name
| `file_name` | string | yes | The name of the Maven package file. | | `file_name` | string | yes | The name of the Maven package file. |
```shell ```shell
curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/packages/maven/foo/bar/baz/mypkg-1.0-SNAPSHOT.jar" curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/packages/maven/foo/bar/mypkg/1.0-SNAPSHOT/mypkg-1.0-SNAPSHOT.jar"
``` ```
To write the output to file: To write the output to file:
```shell ```shell
curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/packages/maven/foo/bar/baz/mypkg-1.0-SNAPSHOT.jar" >> mypkg-1.0-SNAPSHOT.jar curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/packages/maven/foo/bar/mypkg/1.0-SNAPSHOT/mypkg-1.0-SNAPSHOT.jar" >> mypkg-1.0-SNAPSHOT.jar
``` ```
This writes the downloaded file to `mypkg-1.0-SNAPSHOT.jar` in the current directory. This writes the downloaded file to `mypkg-1.0-SNAPSHOT.jar` in the current directory.
...@@ -63,13 +63,13 @@ GET groups/:id/-/packages/maven/*path/:file_name ...@@ -63,13 +63,13 @@ GET groups/:id/-/packages/maven/*path/:file_name
| `file_name` | string | yes | The name of the Maven package file. | | `file_name` | string | yes | The name of the Maven package file. |
```shell ```shell
curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/groups/1/-/packages/maven/foo/bar/baz/mypkg-1.0-SNAPSHOT.jar" curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/groups/1/-/packages/maven/foo/bar/mypkg/1.0-SNAPSHOT/mypkg-1.0-SNAPSHOT.jar"
``` ```
To write the output to file: To write the output to file:
```shell ```shell
curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/groups/1/-/packages/maven/foo/bar/baz/mypkg-1.0-SNAPSHOT.jar" >> mypkg-1.0-SNAPSHOT.jar curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/groups/1/-/packages/maven/foo/bar/mypkg/1.0-SNAPSHOT/mypkg-1.0-SNAPSHOT.jar" >> mypkg-1.0-SNAPSHOT.jar
``` ```
This writes the downloaded file to `mypkg-1.0-SNAPSHOT.jar` in the current directory. This writes the downloaded file to `mypkg-1.0-SNAPSHOT.jar` in the current directory.
...@@ -90,13 +90,13 @@ GET projects/:id/packages/maven/*path/:file_name ...@@ -90,13 +90,13 @@ GET projects/:id/packages/maven/*path/:file_name
| `file_name` | string | yes | The name of the Maven package file. | | `file_name` | string | yes | The name of the Maven package file. |
```shell ```shell
curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/projects/1/packages/maven/foo/bar/baz/mypkg-1.0-SNAPSHOT.jar" curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/projects/1/packages/maven/foo/bar/mypkg/1.0-SNAPSHOT/mypkg-1.0-SNAPSHOT.jar"
``` ```
To write the output to file: To write the output to file:
```shell ```shell
curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/projects/1/packages/maven/foo/bar/baz/mypkg-1.0-SNAPSHOT.jar" >> mypkg-1.0-SNAPSHOT.jar curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/projects/1/packages/maven/foo/bar/mypkg/1.0-SNAPSHOT/mypkg-1.0-SNAPSHOT.jar" >> mypkg-1.0-SNAPSHOT.jar
``` ```
This writes the downloaded file to `mypkg-1.0-SNAPSHOT.jar` in the current directory. This writes the downloaded file to `mypkg-1.0-SNAPSHOT.jar` in the current directory.
...@@ -120,5 +120,5 @@ PUT projects/:id/packages/maven/*path/:file_name ...@@ -120,5 +120,5 @@ PUT projects/:id/packages/maven/*path/:file_name
curl --request PUT \ curl --request PUT \
--upload-file path/to/mypkg-1.0-SNAPSHOT.pom \ --upload-file path/to/mypkg-1.0-SNAPSHOT.pom \
--header "Private-Token: <personal_access_token>" \ --header "Private-Token: <personal_access_token>" \
"https://gitlab.example.com/api/v4/projects/1/packages/maven/foo/bar/baz/mypkg-1.0-SNAPSHOT.pom" "https://gitlab.example.com/api/v4/projects/1/packages/maven/foo/bar/mypkg/1.0-SNAPSHOT/mypkg-1.0-SNAPSHOT.pom"
``` ```
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