...
Snapshots can be created through this API using a POST service and snapshot information can be retrieved using a GET service.
Include Page |
---|
| REST V1 Authentication |
---|
| REST V1 Authentication |
---|
|
GET
There are two implementations of GET. One will find a Snapshot with the given release id and snapshot id and return the JSON representation of the Snapshot. The other will find a list of Snapshots matching the parameters supplied to it.
GET (By Id)
This GET service will return the JSON representation of a snapshot given a release id and snapshot Id.
...
...
...
...
...
Snapshot JSON objects can having the following attributes:
...
...
...
...
...
...
...
...
...
...
Back to Top
...
POST (create snapshot)
This POST service will create a new snapshot with the same attributes as the given JSON object.
...
Request
POST will receive a snapshot input JSON object and return a snapshot JSON object. Snapshot input JSON objects can have the following attributes:
Attributes | Type | Required | Description |
---|
releaseId | URL | Yes | Path parameter for the release Id where the snapshot will be added |
action | String | Yes | should be set to createSnapshot for this API. |
description | String | No | The description of the snapshot |
projectsList<Project>List<SnapshotVersionInputPojo> | No | |
projects - project versions to be built or existing versions to be associated with
|
the snapshotprojectId | Long | Yes | The id of the project- new snapshot.
- If you do not provide projectVersionId, build will be initiated.
- If you do not supply specific project that is configured in release, it will be added for build. projectId and packageName is used to identify if project is configured in Release or not.
- If you supply projectId and packageName combination that is not part of release, exception will be thrown.
- If you do not provide anything for this attribute, build will be initiated for all project in Release.
|
Elements of snapshotVersionInputs has following attributes:
Attributes | Type | Required | Description |
---|
projectId | Long | Yes | Project associated with release. |
projectVersionId | Long | No | The version id of the project. If project version is not supplied new build will be performed. |
packageName | String | Yes |
*for partial deploy, otherwise No | The name of the package (used for partial deployment projects only) |
projectVersionId | Long | No | The version id of the projectassociated with release. If Partial deployment project and packageName is not supplied it will be considered all files type version. |
buildEnvironmentId | Long |
YesNo | The build environment associated with the project |
(used for projects with multiple build environments). If not supplied and only one environment found for build instance then it will be defaulted. |
forceBuild | Boolean | No | Whether or not the project should be force built |
...
. This will be overridden to true for partial deployment project |
...
**only if the project has multiple build environments
Defaults
If some information is not included in the JSON object, the following default values will be used:
Attributes | Type | Value | Description |
---|
description | String | nullResponse
Snapshot JSON objects can having the following attributes:
Attributes | Type | Description |
---|
snapshotId | Long | The id of the snapshot |
snapshotName | String | The name of the snapshot, which is the time when the snapshot was created |
snapshotStatus | String | The status of the snapshot. Possible values are: - COMPLETED - The snapshot was successfully assembled, but has not yet been sent to pipeline for execution.
- FAILED - The snapshot failed to be assembled (which could mean the underlying build failed).
- FAILED TO INITIATE - The snapshot was assembled, but failed to be sent to the pipeline for execution.
- INITIATED - The snapshot has been sent to the pipeline for execution.
- PENDING - The snapshot is in the process of being assembled and set to the pipeline for execution.
|
description | String | The description of the snapshot |
projectsList<Project>List<SnapshotVersionPojo> | The version information about the projects associated with the |
releaseA list of projects associated with the snapshotElements of snapshotVersions has following attributes:
The Attributes | Type | Description |
---|
projectId | Long |
project ids associated with the release | The id of the project |
projectStreamId | Long | The id of the Stream which the project/package was built from. |
projectVersionId | Long | The version id of the project |
packageName | String |
packages associated with the release | The name of the package (used for partial deployment projects only) |
projectVersionIdbuildEnvironmentId | Long | The only build environment associated with the project, otherwise an error occurs | The build environment associated with the project |
forceBuild | Boolean | false | Whether or not the project should be force builtLong | New project version | The version id of the project to use instead of creating a new version | Boolean | Whether or not the project was told to request all files |
snapshotVersionStatus | String | The current status of the individual project version within the snapshot. Possible values are: - PENDING - The project is has not yet been built for the snapshot.
- SUBMITTED - The project is currently being built for the snapshot.
- COMPLETED - The project has been built successfully for the snapshot.
- FAILED - The project has failed to build.
- EXISTING - The snapshot is utilizing an already built version of the project.
|
Response Codes
HTTP Code | Description |
---|
201 | Snapshot created |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Release not found |
500 | Unexpected internal server error |
Example
If the POST request sent to http://host:port/flexdeploy/rest/v1/releasereleases/12345/snapshot receives the following JSON environment object,
Code Block |
---|
theme | Eclipse |
---|
title | POST JSON |
---|
|
{
"action" : "createSnapshot",
"description": "example snapshot creation",
"projectssnapshotVersionInputs": [
{
"projectId": 10000,
"packageName": "package1",
"projectVersionId": 10001
},
{
"projectId": 10000,
"packageName": "package2",
"forceBuild": true
},
{
"projectId": 10002,
"buildEnvironmentId": 10003
} ]
} |
The following snapshot object will then be created in FlexDeploy:
Code Block |
---|
theme | Eclipse |
---|
title | POST JSON |
---|
|
{
"snapshotId": 10005,
"snapshotName": "07-09-2018 12:12:03",
"description": "example snapshot creation",
"snapshotStatus": "PENDING",
"projectssnapshotVersions": [
{
"projectId": 10000,
"packageName": "package1",
"projectVersionId": 10001,
"requestAllFiles": false,
"snapshotVersionStatus": "PENDINGEXISTING"
},
{
"projectId": 10000,
"packageName": "package2",
"projectVersionId": null,
"requestAllFiles": false,
"snapshotVersionStatus": "PENDING"
},
{
"projectId": 10002,
"packageName": null,
"projectVersionId": null,
"requestAllFiles": false,
"snapshotVersionStatus": "PENDING"
}]
} |
POST (promote to release)
Project versions can be promoted to a release through this POST service. Promoting a project to release will combine the specified version of the specified project with the versions of the other projects used in the last snapshot into a new snapshot.
Request
POST will receive a snapshot input JSON object and return a snapshot JSON object. Snapshot input JSON objects can have the following attributes:
Attributes | Type | Required | Description |
---|
releaseId | URL | Yes | Path parameter for the release Id where the snapshot will be added |
action | String | Yes | should be set to promoteToRelease for this API. |
description | String | No | The description of the snapshot |
snapshotVersionInputs | List<SnapshotVersionInputPojo> | Yes | One and only one element is required for promote to release action. |
Elements of snapshotVersionInputs has following attributes:
Attributes | Type | Required | Description |
---|
projectId | Long | Yes | Project associated with release. |
projectVersionId | Long | Yes | The version id of the project. If using packageName, version for package must be provided. |
packageName | String | No | The name of the package (used for partial deployment projects only) associated with release. If Partial deployment project and packageName is not supplied it will be considered all files type version. |
Response
Snapshot JSON objects can having the following attributes:
Attributes | Type | Description |
---|
snapshotId | Long | The id of the snapshot |
snapshotName | String | The name of the snapshot, which is the time when the snapshot was created |
snapshotStatus | String | The status of the snapshot. Possible values are: - COMPLETED - The snapshot was successfully assembled, but has not yet been sent to pipeline for execution.
- FAILED - The snapshot failed to be assembled (which could mean the underlying build failed).
- FAILED TO INITIATE - The snapshot was assembled, but failed to be sent to the pipeline for execution.
- INITIATED - The snapshot has been sent to the pipeline for execution.
- PENDING - The snapshot is in the process of being assembled and set to the pipeline for execution.
|
description | String | The description of the snapshot |
snapshotVersions | List<SnapshotVersionPojo> | The version information about the projects associated with the snapshot |
Elements of snapshotVersions has following attributes:
Attributes | Type | Description |
---|
projectId | Long | The id of the project |
projectStreamId | Long | The id of the Stream which the project/package was built from. |
projectVersionId | Long | The version id of the project |
packageName | String | The name of the package (used for partial deployment projects only) |
requestAllFiles | Boolean | Whether or not the project was told to request all files |
snapshotVersionStatus | String | The current status of the individual project version within the snapshot. Possible values are: - PENDING - The project is has not yet been built for the snapshot.
- SUBMITTED - The project is currently being built for the snapshot.
- COMPLETED - The project has been built successfully for the snapshot.
- FAILED - The project has failed to build.
- EXISTING - The snapshot is utilizing an already built version of the project.
|
Response Codes
HTTP Code | Description |
---|
201 | Snapshot created |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Release not found |
500 | Unexpected internal server error |
Example
If the previous snapshot had the following attributes:
Code Block |
---|
theme | Eclipse |
---|
title | Current JSON |
---|
|
{
"snapshotId": 10005,
"snapshotName": "07-09-2018 12:12:03",
"description": "",
"snapshotStatus": "INITIATED",
"snapshotVersions": [
{
"projectId": 10000,
"packageName": "package1",
"projectVersionId": 10001,
"requestAllFiles": false,
"snapshotVersionStatus": "EXISTING"
},
{
"projectId": 10000,
"packageName": "package2",
"projectVersionId": 10040,
"requestAllFiles": false,
"snapshotVersionStatus": "COMPLETED"
} |
...
,
{
"projectId": 10002,
"packageName": null,
"projectVersionId": 10065,
"requestAllFiles": false,
"snapshotVersionStatus": "COMPLETED"
}]
} |
And a POST request was sent to http://host:port/flexdeploy/rest/v1/releases/{releaseId}/snapshot with the following JSON object input:
Code Block |
---|
theme | Eclipse |
---|
title | POST JSON |
---|
|
{
"action" : "promoteToRelease",
"description": "example snapshot creation",
"snapshotVersionInputs": [
{
"projectId": 10000,
"packageName": "package1",
"projectVersionId": 10025
} ]
} |
The following Snapshot JSON object will begin:
Code Block |
---|
theme | Eclipse |
---|
title | Response JSON |
---|
|
{
"snapshotId": 10025,
"snapshotName": "07-09-2018 12:15:03",
"description": "",
"snapshotStatus": "INITIATED",
"snapshotVersions": [
{
"projectId": 10000,
"packageName": "package1",
"projectVersionId": 10025,
"requestAllFiles": false,
"snapshotVersionStatus": "EXISTING"
},
{
"projectId": 10000,
"packageName": "package2",
"projectVersionId": 10040,
"requestAllFiles": false,
"snapshotVersionStatus": "EXISTING"
},
{
"projectId": 10002,
"packageName": null,
"projectVersionId": 10065,
"requestAllFiles": false,
"snapshotVersionStatus": "EXISTING"
}]
} |