Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

Snapshots can be created through this API using a POST service.

Base URL for Snapshot REST API

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

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:

AttributesTypeDescription
projectIdLongThe id of the project
projectVersionIdLongThe version id of the project
packageNameStringThe name of the package (used for partial deployment projects only)
buildEnvironmentIdLongThe build environment associated with the project
forceBuildBooleanWhether or not the project should be force built

Snapshot JSON objects can having the following attributes:

AttributesTypeDescription

snapshotId

LongThe id of the snapshot
snapshotNameStringThe name of the snapshot, which is the time when the snapshot was created
snapshotStatusStringThe status of the snapshot
descriptionStringThe description of the snapshot
snapshotVersionsList<SnapshotVersionPojo>The version information about the projects associated with the snapshot

SnapshotVersion has following attributes:

AttributesTypeDescription
projectIdLongThe id of the project
projectStreamIdLongStream included in release for the project.
projectVersionIdLongThe version id of the project
packageNameStringThe name of the package (used for partial deployment projects only)
requestAllFilesBooleanWhether or not the project was told to request all files
snapshotVersionStatusStringThe current status of the snapshot


Back to Top


POST (create snapshot)

This POST service will create a new snapshot with the same attributes as the given JSON object.

API URL

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

Parameters

AttributesTypeRequiredDescription
descriptionStringNoThe description of the snapshot
projectsList<Project>NoA list of projects associated with the snapshot
projectIdLongYesThe id of the project
packageNameStringYes*The name of the package (used for partial deployment projects only)
projectVersionIdLongNoThe version id of the project
buildEnvironmentIdLongYesThe build environment associated with the project (used for projects with multiple build environments)
forceBuildBooleanNoWhether or not the project should be force built

*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:

AttributesTypeValueDescription
descriptionStringnullThe description of the snapshot
projectsList<Project>projects associated with the releaseA list of projects associated with the snapshot
projectIdLongproject ids associated with the releaseThe id of the project
packageNameStringpackages associated with the releaseThe name of the package (used for partial deployment projects only)
projectVersionIdLongNew project versionThe version id of the project to use instead of creating a new version
buildEnvironmentIdLongThe only build environment associated with the project, otherwise an error occursThe build environment associated with the project
forceBuildBooleanfalseWhether or not the project should be force built

Example

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

POST JSON
{
	"description": "example snapshot creation",
	"projects": [
	{
		"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:

POST JSON
{
	"snapshotId": 10005,
	"snapshotName": "07-09-2018 12:12:03",
	"description": "example snapshot creation",
	"snapshotStatus": "PENDING",
	"projects": [
	{
		"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)

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.

URL for promoting a project version to a release

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


Promoting a project version to a release has the following parameters

AttributesTypeRequiredDescription
projectIdURLYesThe id of the project
projectVersionIdURLYesThe id of the version of the project
releaseIdIntegerYesThe id of the release
descriptionStringNoThe description of the snapshot that will be made
packageNameStringOnly for partial deployment projectsThe name of the package of the partial deployment project

If the previous snapshot had the following attributes:

Current Snapshot Details
{
	"snapshotId": 10005,
	"snapshotName": "07-09-2018 12:12:03",
	"description": "Existing Snapshot",
	"snapshotStatus": "CURRENT",
	"projects": [
	{
		"projectId": 10000,
		"packageName": "package1",
		"projectVersionId": 10100,
		"requestAllFiles": false,
		"snapshotVersionStatus": "EXISTING"
	},
	{
		"projectId": 10000,
		"packageName": "package2",
		"projectVersionId": 10010,
		"requestAllFiles": false,
		"snapshotVersionStatus": "EXISTING"
	},
	{
		"projectId": 10002,
		"packageName": null,
		"projectVersionId": 10050,
		"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:

POST JSON
{
	"releaseId": 13000,
	"packageName": "package1"
}

The following Snapshot JSON object will begin:

Response JSON
{
	"snapshotId": 12010,
	"snapshotName": "07-09-2018 12:12:03",
	"description": "example snapshot creation",
	"snapshotStatus": "PENDING",
	"projects": [
	{
		"projectId": 10000,
		"packageName": "package1",
		"projectVersionId": 11001,
		"requestAllFiles": false,
		"snapshotVersionStatus": "EXISTING"
	},
	{
		"projectId": 10000,
		"packageName": "package2",
		"projectVersionId": 10010,
		"requestAllFiles": false,
		"snapshotVersionStatus": "EXISTING"
	},
	{
		"projectId": 10002,
		"packageName": null,
		"projectVersionId": 11001,
		"requestAllFiles": false,
		"snapshotVersionStatus": "EXISTING"
	}
}

Back to Top

  • No labels