Commit c919bd03 authored by Etienne Baqué's avatar Etienne Baqué

Updated Release API docs

Updated 'milestone' param to 'milestones'.
Updated payload examples accordingly.
parent 6e462e0d
...@@ -57,19 +57,34 @@ Example response: ...@@ -57,19 +57,34 @@ Example response:
"committer_email":"admin@example.com", "committer_email":"admin@example.com",
"committed_date":"2019-01-03T01:55:38.000Z" "committed_date":"2019-01-03T01:55:38.000Z"
}, },
"milestone":{ "milestones": [
"id":51, {
"iid":1, "id":51,
"project_id":24, "iid":1,
"title":"v1.0-rc", "project_id":24,
"description":"Voluptate fugiat possimus quis quod aliquam expedita.", "title":"v1.0-rc",
"state":"closed", "description":"Voluptate fugiat possimus quis quod aliquam expedita.",
"created_at":"2019-07-12T19:45:44.256Z", "state":"closed",
"updated_at":"2019-07-12T19:45:44.256Z", "created_at":"2019-07-12T19:45:44.256Z",
"due_date":"2019-08-16T11:00:00.256Z", "updated_at":"2019-07-12T19:45:44.256Z",
"start_date":"2019-07-30T12:00:00.256Z", "due_date":"2019-08-16T11:00:00.256Z",
"web_url":"http://localhost:3000/root/awesome-app/-/milestones/1" "start_date":"2019-07-30T12:00:00.256Z",
}, "web_url":"https://gitlab.example.com/root/awesome-app/-/milestones/1"
},
{
"id":52,
"iid":2,
"project_id":24,
"title":"v1.0",
"description":"Voluptate fugiat possimus quis quod aliquam expedita.",
"state":"closed",
"created_at":"2019-07-16T14:00:12.256Z",
"updated_at":"2019-07-16T14:00:12.256Z",
"due_date":"2019-08-16T11:00:00.256Z",
"start_date":"2019-07-30T12:00:00.256Z",
"web_url":"https://gitlab.example.com/root/awesome-app/-/milestones/2"
}
],
"assets":{ "assets":{
"count":6, "count":6,
"sources":[ "sources":[
...@@ -218,19 +233,34 @@ Example response: ...@@ -218,19 +233,34 @@ Example response:
"committer_email":"admin@example.com", "committer_email":"admin@example.com",
"committed_date":"2019-01-03T01:53:28.000Z" "committed_date":"2019-01-03T01:53:28.000Z"
}, },
"milestone":{ "milestones": [
"id":51, {
"iid":1, "id":51,
"project_id":24, "iid":1,
"title":"v1.0-rc", "project_id":24,
"description":"Voluptate fugiat possimus quis quod aliquam expedita.", "title":"v1.0-rc",
"state":"closed", "description":"Voluptate fugiat possimus quis quod aliquam expedita.",
"created_at":"2019-07-12T19:45:44.256Z", "state":"closed",
"updated_at":"2019-07-12T19:45:44.256Z", "created_at":"2019-07-12T19:45:44.256Z",
"due_date":"2019-08-16T11:00:00.256Z", "updated_at":"2019-07-12T19:45:44.256Z",
"start_date":"2019-07-30T12:00:00.256Z", "due_date":"2019-08-16T11:00:00.256Z",
"web_url":"http://localhost:3000/root/awesome-app/-/milestones/1" "start_date":"2019-07-30T12:00:00.256Z",
}, "web_url":"https://gitlab.example.com/root/awesome-app/-/milestones/1"
},
{
"id":52,
"iid":2,
"project_id":24,
"title":"v1.0",
"description":"Voluptate fugiat possimus quis quod aliquam expedita.",
"state":"closed",
"created_at":"2019-07-16T14:00:12.256Z",
"updated_at":"2019-07-16T14:00:12.256Z",
"due_date":"2019-08-16T11:00:00.256Z",
"start_date":"2019-07-30T12:00:00.256Z",
"web_url":"https://gitlab.example.com/root/awesome-app/-/milestones/2"
}
],
"assets":{ "assets":{
"count":4, "count":4,
"sources":[ "sources":[
...@@ -273,7 +303,7 @@ POST /projects/:id/releases ...@@ -273,7 +303,7 @@ POST /projects/:id/releases
| `tag_name` | string | yes | The tag where the release will be created from. | | `tag_name` | string | yes | The tag where the release will be created from. |
| `description` | string | yes | The description of the release. You can use [markdown](../../user/markdown.md). | | `description` | string | yes | The description of the release. You can use [markdown](../../user/markdown.md). |
| `ref` | string | no | If `tag_name` doesn't exist, the release will be created from `ref`. It can be a commit SHA, another tag name, or a branch name. | | `ref` | string | no | If `tag_name` doesn't exist, the release will be created from `ref`. It can be a commit SHA, another tag name, or a branch name. |
| `milestone` | string | no | The title of the milestone the release is associated with. | | `milestones` | array of string | no | The title of each milestone the release is associated with. |
| `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. |
...@@ -283,7 +313,7 @@ Example request: ...@@ -283,7 +313,7 @@ Example request:
```sh ```sh
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", "milestone": "v1.0-rc", "assets": { "links": [{ "name": "hoge", "url": "https://google.com" }] } }' \ --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" }] } }' \
--request POST https://gitlab.example.com/api/v4/projects/24/releases --request POST https://gitlab.example.com/api/v4/projects/24/releases
``` ```
...@@ -321,19 +351,34 @@ Example response: ...@@ -321,19 +351,34 @@ Example response:
"committer_email":"admin@example.com", "committer_email":"admin@example.com",
"committed_date":"2019-01-03T01:55:38.000Z" "committed_date":"2019-01-03T01:55:38.000Z"
}, },
"milestone":{ "milestones": [
"id":51, {
"iid":1, "id":51,
"project_id":24, "iid":1,
"title":"v1.0-rc", "project_id":24,
"description":"Voluptate fugiat possimus quis quod aliquam expedita.", "title":"v1.0-rc",
"state":"active", "description":"Voluptate fugiat possimus quis quod aliquam expedita.",
"created_at":"2019-07-12T19:45:44.256Z", "state":"closed",
"updated_at":"2019-07-12T19:45:44.256Z", "created_at":"2019-07-12T19:45:44.256Z",
"due_date":"2019-08-16T11:00:00.256Z", "updated_at":"2019-07-12T19:45:44.256Z",
"start_date":"2019-07-30T12:00:00.256Z", "due_date":"2019-08-16T11:00:00.256Z",
"web_url":"http://localhost:3000/root/awesome-app/-/milestones/1" "start_date":"2019-07-30T12:00:00.256Z",
}, "web_url":"https://gitlab.example.com/root/awesome-app/-/milestones/1"
},
{
"id":52,
"iid":2,
"project_id":24,
"title":"v1.0",
"description":"Voluptate fugiat possimus quis quod aliquam expedita.",
"state":"closed",
"created_at":"2019-07-16T14:00:12.256Z",
"updated_at":"2019-07-16T14:00:12.256Z",
"due_date":"2019-08-16T11:00:00.256Z",
"start_date":"2019-07-30T12:00:00.256Z",
"web_url":"https://gitlab.example.com/root/awesome-app/-/milestones/2"
}
],
"assets":{ "assets":{
"count":5, "count":5,
"sources":[ "sources":[
...@@ -374,19 +419,19 @@ Update a Release. ...@@ -374,19 +419,19 @@ Update a Release.
PUT /projects/:id/releases/:tag_name PUT /projects/:id/releases/:tag_name
``` ```
| Attribute | Type | Required | Description | | Attribute | Type | Required | Description |
| ------------- | -------------- | -------- | --------------------------------------------------------------------------------------------------------- | | ------------- | --------------- | -------- | ----------------------------------------------------------------------------------------------------------- |
| `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 where the release will be created from. | | `tag_name` | string | yes | The tag where the release will be created from. |
| `name` | string | no | The release name. | | `name` | string | no | The release name. |
| `description` | string | no | The description of the release. You can use [markdown](../../user/markdown.md). | | `description` | string | no | The description of the release. You can use [markdown](../../user/markdown.md). |
| `milestone` | string | no | The title of the milestone to associate with the release (`""` to remove the milestone from the release). | | `milestones` | array of string | no | The title of each milestone to associate with the release (`[]` to remove all milestones from the release). |
| `released_at` | datetime | no | The date when the release will be/was ready. Expected in ISO 8601 format (`2019-03-15T08:00:00Z`). | | `released_at` | datetime | no | The date when the release will be/was ready. Expected in ISO 8601 format (`2019-03-15T08:00:00Z`). |
Example request: Example request:
```sh ```sh
curl --header 'Content-Type: application/json' --request PUT --data '{"name": "new name", "milestone": "v1.0"}' --header "PRIVATE-TOKEN: gDybLx3yrUK_HLp3qPjS" "https://gitlab.example.com/api/v4/projects/24/releases/v0.1" curl --header 'Content-Type: application/json' --request PUT --data '{"name": "new name", "milestones": ["v1.2"]}' --header "PRIVATE-TOKEN: gDybLx3yrUK_HLp3qPjS" "https://gitlab.example.com/api/v4/projects/24/releases/v0.1"
``` ```
Example response: Example response:
...@@ -423,19 +468,21 @@ Example response: ...@@ -423,19 +468,21 @@ Example response:
"committer_email":"admin@example.com", "committer_email":"admin@example.com",
"committed_date":"2019-01-03T01:53:28.000Z" "committed_date":"2019-01-03T01:53:28.000Z"
}, },
"milestone":{ "milestones": [
"id":53, {
"iid":2, "id":53,
"project_id":24, "iid":3,
"title":"v1.0", "project_id":24,
"description":"Voluptate fugiat possimus quis quod aliquam expedita.", "title":"v1.0",
"state":"active", "description":"Voluptate fugiat possimus quis quod aliquam expedita.",
"created_at":"2019-09-01T13:00:00.256Z", "state":"active",
"updated_at":"2019-09-01T13:00:00.256Z", "created_at":"2019-09-01T13:00:00.256Z",
"due_date":"2019-09-20T13:00:00.256Z", "updated_at":"2019-09-01T13:00:00.256Z",
"start_date":"2019-09-05T12:00:00.256Z", "due_date":"2019-09-20T13:00:00.256Z",
"web_url":"http://localhost:3000/root/awesome-app/-/milestones/3" "start_date":"2019-09-05T12:00:00.256Z",
}, "web_url":"https://gitlab.example.com/root/awesome-app/-/milestones/3"
}
],
"assets":{ "assets":{
"count":4, "count":4,
"sources":[ "sources":[
......
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