Releases can be retrieved through this API using a GET service.
...
Parameter | Type | Required | Description |
---|---|---|---|
releaseId | URL | Yes | Path parameter for the release Id |
Response
Release JSON objects can having the following attributes:
Attribute | Type | Description |
---|---|---|
releaseId | Long | The id of the release |
releaseName | String | The name of the release |
description | String | The description of the release |
pipelineId | Long | The id of the pipeline used by the release |
pipelineName | String | The name of the pipeline used by the release |
startDate | String | The date the release started |
endDate | String | The date the release ended |
scheduleBuildExpression | String | The expression which is used to schedule builds |
projects | List<ReleaseProjects> | The list of projects associated with the release. See more about ReleaseProjects below. |
Elements of ReleaseProjects have the following attributes:
Attribute | Type | Description |
---|---|---|
priority | Integer | The priority of the project |
projectId | Long | The id of the project |
projectName | String | The name of the project |
applicationPath | String | The fully-qualified path of the application which the project is in |
packageName | String | The package name for the project (partial deployment projects only) |
requestAllFiles | Boolean | Whether or not the project includes all files (partial deployment projects only) |
buildEnvironmentId | Long | The id of the build environment for the project |
projectStreamId | Long | The id of the Stream which the project/package was built from |
projectGroups | String | Groups the project is in, based on groups defined in associated pipeline |
Response Codes
HTTP Code | Description | ||
---|---|---|---|
200 | Release was found and returned | 400 | Bad request (Not found or release wasn't in given releaseId) |
401 | Unauthorized (User may not be signed in or user may not have read access to release) | ||
404 | Not found or release wasn't in given releaseId | ||
500 | Unexpected internal server error |
Example
If a release in our database had an id of 14321 and a GET request was sent to http://host:port/flexdeploy/rest/v1/releases/14321
A Release JSON object will be returned with release information:
Code Block | ||||
---|---|---|---|---|
| ||||
{ "releaseId": 14321, "releaseName": "Test Release 1", "description": "", "pipelineId": 10004, "pipelineName": "Simple Pipeline", "startDate": "2019-02-13", "endDate": null, "scheduleBuildExpression": null, "releaseStatus": "STARTED", "projects": [ { "priority": 1, "projectId": 10000, "packageName": "package1", "projectName": "REST Project 1", "requestAllFiles": false, "applicationPath": "FlexDeploy/REST", "buildEnvironmentId": 21212, "projectStreamId": 13900, "projectGroups": null }, { "priority": 2, "projectId": 10001, "packageName": null, "projectName": "REST Project 2", "requestAllFiles": false, "applicationPath": "FlexDeploy/REST", "buildEnvironmentId": 10056, "projectStreamId": 15986, "projectGroups": null }] } |
GET (Using Query Parameters)
This GET service will return the JSON representation of a list of releases given release query parameters.
Info | ||
---|---|---|
| ||
http://host:port/flexdeploy/rest/v1/releases |
Request
Parameter | Type | Required | Description |
---|---|---|---|
releaseName | String (Query) | No | Query based on the name of the release. Name is case insensitive. The service will query for release names which contain the release name provided. |
releaseStatus | String (Query) | No | Query based on the status of the release. Possible statuses are NOT STARTED, STARTED, SUSPENDED, and COMPLETED. Status is case insensitive. |
Tip |
---|
If no query parameters are provided, all releases will be returned. |
Response
Release JSON objects can have the following attributes:
Attribute | Type | Description |
---|---|---|
releaseId | Long | The id of the release |
releaseName | String | The name of the release |
description | String | The description of the release |
pipelineId | Long | The id of the pipeline used by the release |
pipelineName | String | The name of the pipeline used by the release |
startDate | String | The date the release started |
endDate | String | The date the release ended |
scheduleBuildExpression | String | The expression which is used to schedule builds |
projects | List<ReleaseProjects> | The list of projects associated with the release. See more about ReleaseProjects below. |
Elements of ReleaseProjects have the following attributes:
Attribute | Type | Description |
---|---|---|
priority | Integer | The priority of the project |
projectId | Long | The id of the project |
projectName | String | The name of the project |
applicationPath | String | The fully-qualified path of the application which the project is in |
packageName | String | The package name for the project (partial deployment projects only) |
requestAllFiles | Boolean | Whether or not the project includes all files (partial deployment projects only) |
buildEnvironmentId | Long | The id of the build environment for the project |
projectStreamId | Long | The id of the Stream which the project/package was built from |
projectGroups | String | Groups the project is in, based on groups defined in associated pipeline |
Response Codes
HTTP Code | Description |
---|---|
200 | Releases found in query were successfully returned |
400 | Bad request |
401 | Unauthorized (User may not be signed in or user may not have read access to release) |
500 | Unexpected internal server error |
Example
If we want to see all releases with a name containing 'Rest' with a status of STARTED, we would send this request:
Request: http://host:port/flexdeploy/rest/v1/releases?releaseStatus=STARTED&releaseName=Rest
A GET request would be triggered and return the following JSON releases object:
Code Block | ||||
---|---|---|---|---|
| ||||
[ { "description": null, "endDate": null, "startDate": "2019-02-05", "projects": [ { "priority": 1, "packageName": null, "projectGroups": null, "projectName": "RESTDeployProject1", "projectId": 13903, "requestAllFiles": false, "projectStreamId": 13904, "buildEnvironmentId": 10956, "applicationPath": "FlexDeploy/RESTTests" }, { "priority": 1, "packageName": "Package2", "projectGroups": null, "projectName": "RESTDeployPartialProject", "projectId": 13921, "requestAllFiles": false, "projectStreamId": 13922, "buildEnvironmentId": 10956, "applicationPath": "FlexDeploy/RESTTests" }, { "priority": 1, "packageName": "Package1", "projectGroups": null, "projectName": "RESTDeployPartialProject", "projectId": 13921, "requestAllFiles": false, "projectStreamId": 13922, "buildEnvironmentId": 10956, "applicationPath": "FlexDeploy/RESTTests" } ], "pipelineId": 10004, "scheduleBuildExpression": null, "releaseStatus": "STARTED", "releaseId": 12101, "releaseName": "REST Release 1", "pipelineName": "Test Pipeline" }, { "description": null, "endDate": null, "startDate": "2019-02-05", "projects": [ { "priority": 1, "packageName": null, "projectGroups": null, "projectName": "RESTDeployPartialProject", "projectId": 13921, "requestAllFiles": true, "projectStreamId": 13922, "buildEnvironmentId": 10956, "applicationPath": "FlexDeploy/RESTTests" }, { "priority": 1, "packageName": null, "projectGroups": null, "projectName": "RESTDeployProject1", "projectId": 13903, "requestAllFiles": false, "projectStreamId": 13904, "buildEnvironmentId": 10956, "applicationPath": "FlexDeploy/RESTTests" } ], "pipelineId": 10004, "scheduleBuildExpression": null, "releaseStatus": "STARTED", "releaseId": 12104, "releaseName": "REST Release 2", "pipelineName": "Test Pipeline" } ] |