Commit 11694b16 authored by Sean Carroll's avatar Sean Carroll Committed by Suzanne Selhorn

Specify asset types in Releases API documentation

Part of https://gitlab.com/gitlab-org/gitlab/-/issues/207257

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/33158
parent 96fe2a93
...@@ -121,13 +121,15 @@ Example response: ...@@ -121,13 +121,15 @@ Example response:
"id":2, "id":2,
"name":"awesome-v0.2.msi", "name":"awesome-v0.2.msi",
"url":"http://192.168.10.15:3000/msi", "url":"http://192.168.10.15:3000/msi",
"external":true "external":true,
"link_type":"other"
}, },
{ {
"id":1, "id":1,
"name":"awesome-v0.2.dmg", "name":"awesome-v0.2.dmg",
"url":"http://192.168.10.15:3000", "url":"http://192.168.10.15:3000",
"external":true "external":true,
"link_type":"other"
} }
], ],
"evidence_file_path":"https://gitlab.example.com/root/awesome-app/-/releases/v0.2/evidence.json" "evidence_file_path":"https://gitlab.example.com/root/awesome-app/-/releases/v0.2/evidence.json"
...@@ -323,7 +325,8 @@ Example response: ...@@ -323,7 +325,8 @@ Example response:
"id":3, "id":3,
"name":"hoge", "name":"hoge",
"url":"https://gitlab.example.com/root/awesome-app/-/tags/v0.11.1/binaries/linux-amd64", "url":"https://gitlab.example.com/root/awesome-app/-/tags/v0.11.1/binaries/linux-amd64",
"external":true "external":true,
"link_type":"other"
} }
] ]
}, },
...@@ -357,13 +360,14 @@ POST /projects/:id/releases ...@@ -357,13 +360,14 @@ POST /projects/:id/releases
| `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.md). | `assets:links:filepath` | string | no | Optional path for a [Direct Asset link](../../user/project/releases.md).
| `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`). |
Example request: Example request:
```shell ```shell
curl --header 'Content-Type: application/json' --header "PRIVATE-TOKEN: gDybLx3yrUK_HLp3qPjS" \ curl --header 'Content-Type: application/json' --header "PRIVATE-TOKEN: gDybLx3yrUK_HLp3qPjS" \
--data '{ "name": "New release", "tag_name": "v0.3", "description": "Super nice release", "milestones": ["v1.0", "v1.0-rc"], "assets": { "links": [{ "name": "hoge", "url": "https://google.com", "filepath": "/binaries/linux-amd64" }] } }' \ --data '{ "name": "New release", "tag_name": "v0.3", "description": "Super nice release", "milestones": ["v1.0", "v1.0-rc"], "assets": { "links": [{ "name": "hoge", "url": "https://google.com", "filepath": "/binaries/linux-amd64", "link_type":"other" }] } }' \
--request POST https://gitlab.example.com/api/v4/projects/24/releases --request POST https://gitlab.example.com/api/v4/projects/24/releases
``` ```
...@@ -465,7 +469,8 @@ Example response: ...@@ -465,7 +469,8 @@ Example response:
"id":3, "id":3,
"name":"hoge", "name":"hoge",
"url":"https://gitlab.example.com/root/awesome-app/-/tags/v0.11.1/binaries/linux-amd64", "url":"https://gitlab.example.com/root/awesome-app/-/tags/v0.11.1/binaries/linux-amd64",
"external":true "external":true,
"link_type":"other"
} }
], ],
"evidence_file_path":"https://gitlab.example.com/root/awesome-app/-/releases/v0.3/evidence.json" "evidence_file_path":"https://gitlab.example.com/root/awesome-app/-/releases/v0.3/evidence.json"
......
...@@ -32,13 +32,15 @@ Example response: ...@@ -32,13 +32,15 @@ Example response:
"id":2, "id":2,
"name":"awesome-v0.2.msi", "name":"awesome-v0.2.msi",
"url":"http://192.168.10.15:3000/msi", "url":"http://192.168.10.15:3000/msi",
"external":true "external":true,
"link_type":"other"
}, },
{ {
"id":1, "id":1,
"name":"awesome-v0.2.dmg", "name":"awesome-v0.2.dmg",
"url":"http://192.168.10.15:3000", "url":"http://192.168.10.15:3000",
"external":true "external":true,
"link_type":"other"
} }
] ]
``` ```
...@@ -70,7 +72,8 @@ Example response: ...@@ -70,7 +72,8 @@ Example response:
"id":1, "id":1,
"name":"awesome-v0.2.dmg", "name":"awesome-v0.2.dmg",
"url":"http://192.168.10.15:3000", "url":"http://192.168.10.15:3000",
"external":true "external":true,
"link_type":"other"
} }
``` ```
...@@ -87,7 +90,8 @@ POST /projects/:id/releases/:tag_name/assets/links ...@@ -87,7 +90,8 @@ POST /projects/:id/releases/:tag_name/assets/links
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](../README.md#namespaced-path-encoding). | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](../README.md#namespaced-path-encoding). |
| `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. |
| `link_type` | string | no | The type of the link: `other`, `runbook`, `image`, `package`. Defaults to `other`. |
Example request: Example request:
...@@ -106,7 +110,8 @@ Example response: ...@@ -106,7 +110,8 @@ Example response:
"id":1, "id":1,
"name":"awesome-v0.2.dmg", "name":"awesome-v0.2.dmg",
"url":"http://192.168.10.15:3000", "url":"http://192.168.10.15:3000",
"external":true "external":true,
"link_type":"other"
} }
``` ```
...@@ -122,9 +127,10 @@ PUT /projects/:id/releases/:tag_name/assets/links/:link_id ...@@ -122,9 +127,10 @@ PUT /projects/:id/releases/:tag_name/assets/links/:link_id
| ------------- | -------------- | -------- | --------------------------------------- | | ------------- | -------------- | -------- | --------------------------------------- |
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](../README.md#namespaced-path-encoding). | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](../README.md#namespaced-path-encoding). |
| `tag_name` | string | yes | The tag associated with the Release. | | `tag_name` | string | yes | The tag associated with the Release. |
| `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. |
| `link_type` | string | no | The type of the link: `other`, `runbook`, `image`, `package`. Defaults to `other`. |
NOTE: **NOTE** NOTE: **NOTE**
You have to specify at least one of `name` or `url` You have to specify at least one of `name` or `url`
...@@ -132,7 +138,7 @@ You have to specify at least one of `name` or `url` ...@@ -132,7 +138,7 @@ You have to specify at least one of `name` or `url`
Example request: Example request:
```shell ```shell
curl --request PUT --data name="new name" --header "PRIVATE-TOKEN: n671WNGecHugsdEDPsyo" "https://gitlab.example.com/api/v4/projects/24/releases/v0.1/assets/links/1" curl --request PUT --data name="new name" --data link_type="runbook" --header "PRIVATE-TOKEN: n671WNGecHugsdEDPsyo" "https://gitlab.example.com/api/v4/projects/24/releases/v0.1/assets/links/1"
``` ```
Example response: Example response:
...@@ -142,7 +148,8 @@ Example response: ...@@ -142,7 +148,8 @@ Example response:
"id":1, "id":1,
"name":"new name", "name":"new name",
"url":"http://192.168.10.15:3000", "url":"http://192.168.10.15:3000",
"external":true "external":true,
"link_type":"runbook"
} }
``` ```
...@@ -173,6 +180,7 @@ Example response: ...@@ -173,6 +180,7 @@ Example response:
"id":1, "id":1,
"name":"new name", "name":"new name",
"url":"http://192.168.10.15:3000", "url":"http://192.168.10.15:3000",
"external":true "external":true,
"link_type":"other"
} }
``` ```
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