Commit 7f7617cb authored by Tim Rizzi's avatar Tim Rizzi

Add example requests for publishing packages

parent 0f600368
...@@ -53,7 +53,7 @@ PUT /projects/:id/packages/generic/:package_name/:package_version/:file_name?sta ...@@ -53,7 +53,7 @@ PUT /projects/:id/packages/generic/:package_name/:package_version/:file_name?sta
Provide the file context in the request body. Provide the file context in the request body.
Example request: Example request using a personal access token:
```shell ```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" \ curl --header "PRIVATE-TOKEN: <your_access_token>" \
...@@ -69,6 +69,22 @@ Example response: ...@@ -69,6 +69,22 @@ Example response:
} }
``` ```
Example request using a deploy token:
```shell
curl --header "DEPLOY-TOKEN: <deploy_token>" \
--upload-file path/to/file.txt \
"https://gitlab.example.com/api/v4/projects/24/packages/generic/my_package/0.0.1/file.txt?status=hidden"
```
Example response:
```json
{
"message":"201 Created"
}
```
## Download package file ## Download package file
Download a package file. Download a package file.
......
...@@ -130,6 +130,22 @@ To pull packages in the GitLab package registry, you must: ...@@ -130,6 +130,22 @@ To pull packages in the GitLab package registry, you must:
1. For the [package type of your choice](../../packages/index.md), follow the 1. For the [package type of your choice](../../packages/index.md), follow the
authentication instructions for deploy tokens. authentication instructions for deploy tokens.
Example request publishing a generic package using a deploy token:
```shell
curl --header "DEPLOY-TOKEN: <deploy_token>" \
--upload-file path/to/file.txt \
"https://gitlab.example.com/api/v4/projects/24/packages/generic/my_package/0.0.1/file.txt?status=hidden"
```
Example response:
```json
{
"message":"201 Created"
}
```
### Push or upload packages ### Push or upload packages
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/213566) in GitLab 13.0. > [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/213566) in GitLab 13.0.
......
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