Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

POST will receive a snapshot input JSON object and return a snapshot JSON object. Snapshot input JSON objects can have the following attributes:

AttributesTypeDescription
actionString
  • createSnapshot
  • promoteToRelease - one and only one snapshotVersionInputs should be provided
descriptionStringThe description of the snapshot
snapshotVersionInputsList<SnapshotVersionInputPojo>A list of project version to be built or associated with the snapshot.

SnapshotVersionInput has following attributes:

...

Info
titleAPI URL

http://host:port/flexdeploy/rest/release/{releaseId}/snapshot

Parameters

AttributesTypeRequiredDescription
actionStringYesshould be set to createSnapshot for this API.
descriptionStringNoThe description of the snapshot
projects
snapshotVersionInputs
List<Project>
List<SnapshotVersionInputPojo>NoA list of
projects
snapshot versions to be built or associated with
the
new snapshot.
Parameters for each element of snapshotVersionInputs. If not supplied all projects configured in Release will be included.
projectIdLongYes
The id of the project
Project associated with release.
packageNameStringYes*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.
projectVersionIdLongNoThe version id of the project. If project version is not supplied new build will be performed.
buildEnvironmentIdLongYes**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.
forceBuildBooleanNoWhether or not the project should be force built. This will be overridden to true for partial deployment project.

*only  only if it's a 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:

...

Example

If the POST request sent to http://host:port/flexdeploy/rest/release/12345/snapshot receives the following JSON environment object,

Code Block
themeEclipse
titlePOST 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
themeEclipse
titlePOST 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": "PENDING"
	},
	{
		"projectId": 10000,
		"packageName": "package2",
		"projectVersionId": null,
		"requestAllFiles": false,
		"snapshotVersionStatus": "PENDING"
	},
	{
		"projectId": 10002,
		"packageName": null,
		"projectVersionId": null,
		"requestAllFiles": false,
		"snapshotVersionStatus": "PENDING"
	}]
}

Back to Top

POST (promote to release)

...

Info
titleURL for promoting a project version to a release

http://host:port/flexdeploy/rest/release/{releaseId}/snapshot

...

Parameters

AttributesTypeRequiredDescription
projectId
action
URL
StringYesshould be set to promoteToRelease for this API.
The id
descriptionStringNoThe description of the
project
snapshot
projectVersionId
snapshotVersionInputs
URL
List<SnapshotVersionInputPojo>
YesThe id of the version of the projectreleaseIdIntegerYesThe id of the releasedescriptionStringNoThe description of the snapshot that will be madepackageNameStringOnly for partial deployment projectsThe name of the package of the partial deployment project
NoA list containing only one project version to be associated with latest snapshot.
Parameters for each element of snapshotVersionInputs. One and only one element is required for promote to release action.
projectIdLongYesProject associated with release.
packageNameStringYes*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.
projectVersionIdLongYesThe version id of the project. If using packageName, version for package must be provided.

Example

If the previous snapshot had the following attributes:

Code Block
themeEclipse
titleCurrent Snapshot DetailsJSON
{
	"snapshotId": 10005,
	"snapshotName": "07-09-2018 12:12:03",
	"description": "Existing Snapshot",
	"snapshotStatus": "CURRENTINITIATED",
	"projectssnapshotVersions": [
	{
		"projectId": 10000,
		"packageName": "package1",
		"projectVersionId": 1010010001,
		"requestAllFiles": false,
		"snapshotVersionStatus": "EXISTING"
	},
	{
		"projectId": 10000,
		"packageName": "package2",
		"projectVersionId": 10010null,
		"requestAllFiles": false,
		"snapshotVersionStatus": "EXISTING"
	},
	{
		"projectId": 10002,
		"packageName": null,
		"projectVersionId": 10050null,
		"requestAllFiles": false,
		"snapshotVersionStatus": "EXISTING"
	}]
}

And a POST request was sent to http://host:port/flexdeploy/rest/project/promote/10000/11001 with the following JSON object input:

Code Block
themeEclipse
titlePOST JSON
{
	"action" : "promoteToRelease"
    "description": "example snapshot creation",
	"snapshotVersionInputs": [
	{
		"releaseIdprojectId": 1300010000,
		"packageName": "package1",
		"projectVersionId": 10025
	} ]
}

The following Snapshot JSON object will begin:

Code Block
themeEclipse
titleResponse JSON
{
	"snapshotId": 1201010025,
	"snapshotName": "07-09-2018 12:1215:03",
	"description": "example snapshot creation",
	"snapshotStatus": "PENDINGINITIATED",
	"projectssnapshotVersions": [
	{
		"projectId": 10000,
		"packageName": "package1",
		"projectVersionId": 1100110025,
		"requestAllFiles": false,
		"snapshotVersionStatus": "EXISTING"
	},
	{
		"projectId": 10000,
		"packageName": "package2",
		"projectVersionId": 10010null,
		"requestAllFiles": false,
		"snapshotVersionStatus": "EXISTING"
	},
	{
		"projectId": 10002,
		"packageName": null,
		"projectVersionId": 11001null,
		"requestAllFiles": false,
		"snapshotVersionStatus": "EXISTING"
	}]
}

Back to Top