debian-mirror-gitlab/doc/api/packages/helm.md

96 lines
3.1 KiB
Markdown
Raw Normal View History

2021-09-30 23:02:18 +05:30
---
stage: Package
2023-01-13 00:05:48 +05:30
group: Package Registry
2022-11-25 23:54:43 +05:30
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
2021-09-30 23:02:18 +05:30
---
2021-11-11 11:23:49 +05:30
# Helm API **(FREE)**
2021-09-30 23:02:18 +05:30
This is the API documentation for [Helm](../../user/packages/helm_repository/index.md).
WARNING:
This API is used by the Helm-related package clients such as [Helm](https://helm.sh/)
and [`helm-push`](https://github.com/chartmuseum/helm-push/#readme),
2021-10-27 15:23:28 +05:30
and is generally not meant for manual consumption.
2021-09-30 23:02:18 +05:30
For instructions on how to upload and install Helm packages from the GitLab
Package Registry, see the [Helm registry documentation](../../user/packages/helm_repository/index.md).
NOTE:
These endpoints do not adhere to the standard API authentication methods.
See the [Helm registry documentation](../../user/packages/helm_repository/index.md)
2023-06-20 00:43:36 +05:30
for details on which headers and token types are supported. Undocumented authentication methods might be removed in the future.
2021-09-30 23:02:18 +05:30
## Download a chart index
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/62757) in GitLab 14.1.
Download a chart index:
```plaintext
GET projects/:id/packages/helm/:channel/index.yaml
```
| Attribute | Type | Required | Description |
| --------- | ------ | -------- | ----------- |
| `id` | string | yes | The ID or full path of the project. |
| `channel` | string | yes | Helm repository channel. |
```shell
curl --user <username>:<personal_access_token> \
2021-11-11 11:23:49 +05:30
"https://gitlab.example.com/api/v4/projects/1/packages/helm/stable/index.yaml"
2021-09-30 23:02:18 +05:30
```
Write the output to a file:
```shell
curl --user <username>:<personal_access_token> \
2021-11-11 11:23:49 +05:30
"https://gitlab.example.com/api/v4/projects/1/packages/helm/stable/index.yaml" \
2021-09-30 23:02:18 +05:30
--remote-name
```
## Download a chart
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/61014) in GitLab 14.0.
Download a chart:
```plaintext
GET projects/:id/packages/helm/:channel/charts/:file_name.tgz
```
| Attribute | Type | Required | Description |
| ----------- | ------ | -------- | ----------- |
| `id` | string | yes | The ID or full path of the project. |
| `channel` | string | yes | Helm repository channel. |
2021-11-18 22:05:49 +05:30
| `file_name` | string | yes | Chart filename. |
2021-09-30 23:02:18 +05:30
```shell
curl --user <username>:<personal_access_token> \
2021-11-11 11:23:49 +05:30
"https://gitlab.example.com/api/v4/projects/1/packages/helm/stable/charts/mychart.tgz" \
2021-09-30 23:02:18 +05:30
--remote-name
```
## Upload a chart
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/64814) in GitLab 14.1.
Upload a chart:
```plaintext
POST projects/:id/packages/helm/api/:channel/charts
```
| Attribute | Type | Required | Description |
| --------- | ------ | -------- | ----------- |
| `id` | string | yes | The ID or full path of the project. |
| `channel` | string | yes | Helm repository channel. |
| `chart` | file | yes | Chart (as `multipart/form-data`). |
```shell
curl --request POST \
--form 'chart=@mychart.tgz' \
--user <username>:<personal_access_token> \
2021-11-11 11:23:49 +05:30
"https://gitlab.example.com/api/v4/projects/1/packages/helm/api/stable/charts"
2021-09-30 23:02:18 +05:30
```