Commit 10c4720a authored by Nick Gaskill's avatar Nick Gaskill

Merge branch '217553-permanent-links-to-release-assets-not-found-404-2' into 'master'

Release assets documentation

See merge request gitlab-org/gitlab!46997
parents 77f50948 7c262935
...@@ -367,7 +367,7 @@ POST /projects/:id/releases ...@@ -367,7 +367,7 @@ POST /projects/:id/releases
| `assets:links` | array of hash | no | An array of assets links. | | `assets:links` | array of hash | no | An array of assets links. |
| `assets:links:name`| string | required by: `assets:links` | The name of the link. | | `assets:links:name`| string | required by: `assets:links` | The name of the link. |
| `assets:links:url` | string | required by: `assets:links` | The URL of the link. | | `assets:links:url` | string | required by: `assets:links` | The URL of the link. |
| `assets:links:filepath` | string | no | Optional path for a [Direct Asset link](../../user/project/releases/index.md). | `assets:links:filepath` | string | no | Optional path for a [Direct Asset link](../../user/project/releases/index.md#permanent-links-to-release-assets).
| `assets:links:link_type` | string | no | The type of the link: `other`, `runbook`, `image`, `package`. Defaults to `other`. | `assets:links:link_type` | string | no | The type of the link: `other`, `runbook`, `image`, `package`. Defaults to `other`.
| `released_at` | datetime | no | The date when the release will be/was ready. Defaults to the current time. Expected in ISO 8601 format (`2019-03-15T08:00:00Z`). | | `released_at` | datetime | no | The date when the release will be/was ready. Defaults to the current time. Expected in ISO 8601 format (`2019-03-15T08:00:00Z`). |
......
...@@ -97,26 +97,29 @@ POST /projects/:id/releases/:tag_name/assets/links ...@@ -97,26 +97,29 @@ POST /projects/:id/releases/:tag_name/assets/links
| `tag_name` | string | yes | The tag associated with the Release. | | `tag_name` | string | yes | The tag associated with the Release. |
| `name` | string | yes | The name of the link. | | `name` | string | yes | The name of the link. |
| `url` | string | yes | The URL of the link. | | `url` | string | yes | The URL of the link. |
| `filepath` | string | no | Optional path for a [Direct Asset link](../../user/project/releases/index.md#permanent-links-to-release-assets).
| `link_type` | string | no | The type of the link: `other`, `runbook`, `image`, `package`. Defaults to `other`. | | `link_type` | string | no | The type of the link: `other`, `runbook`, `image`, `package`. Defaults to `other`. |
Example request: Example request:
```shell ```shell
curl --request POST \ curl --request POST \
--header "PRIVATE-TOKEN: n671WNGecHugsdEDPsyo" \ --header "PRIVATE-TOKEN: tkhfG7HgG-LiZd3zfdDC" \
--data name="awesome-v0.2.dmg" \ --data name="hellodarwin-amd64" \
--data url="http://192.168.10.15:3000" \ --data url="https://gitlab.example.com/mynamespace/hello/-/jobs/688/artifacts/raw/bin/hello-darwin-amd64" \
"https://gitlab.example.com/api/v4/projects/24/releases/v0.1/assets/links" --data filepath="/bin/hellodarwin-amd64" \
"https://gitlab.example.com/api/v4/projects/20/releases/v1.7.0/assets/links"
``` ```
Example response: Example response:
```json ```json
{ {
"id":1, "id":2,
"name":"awesome-v0.2.dmg", "name":"hellodarwin-amd64",
"url":"http://192.168.10.15:3000", "url":"https://gitlab.example.com/mynamespace/hello/-/jobs/688/artifacts/raw/bin/hello-darwin-amd64",
"external":true, "direct_asset_url":"https://gitlab.example.com/mynamespace/hello/-/releases/v1.7.0/downloads/bin/hellodarwin-amd64",
"external":false,
"link_type":"other" "link_type":"other"
} }
``` ```
...@@ -136,6 +139,7 @@ PUT /projects/:id/releases/:tag_name/assets/links/:link_id ...@@ -136,6 +139,7 @@ PUT /projects/:id/releases/:tag_name/assets/links/:link_id
| `link_id` | integer | yes | The ID of the link. | | `link_id` | integer | yes | The ID of the link. |
| `name` | string | no | The name of the link. | | `name` | string | no | The name of the link. |
| `url` | string | no | The URL of the link. | | `url` | string | no | The URL of the link. |
| `filepath` | string | no | Optional path for a [Direct Asset link](../../user/project/releases/index.md#permanent-links-to-release-assets).
| `link_type` | string | no | The type of the link: `other`, `runbook`, `image`, `package`. Defaults to `other`. | | `link_type` | string | no | The type of the link: `other`, `runbook`, `image`, `package`. Defaults to `other`. |
NOTE: **Note:** NOTE: **Note:**
......
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