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 18 Next »

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

Base URL for Snapshot REST API

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

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/releases/{releaseId}/snapshot

Parameters

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

AttributesTypeRequiredDescription
actionStringYes

should be set to createSnapshot for this API.

descriptionStringNoThe description of the snapshot
snapshotVersionInputsList<SnapshotVersionInputPojo>No
  • A list of project versions to be built or existing versions to be associated with 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.

Elements of snapshotVersionInputs has following attributes:

AttributesTypeRequiredDescription
projectIdLongYesProject associated with release.
projectVersionIdLongNoThe version id of the project. If project version is not supplied new build will be performed.
packageNameString

Yes for partial deploy,

otherwise 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.
buildEnvironmentIdLongNoThe build environment associated with the project. 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.

Response

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

Elements of snapshotVersions 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

Example

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

POST JSON
{
	"action" : "createSnapshot"
    "description": "example snapshot creation",
	"snapshotVersionInputs": [
	{
		"projectId": 10000,
		"packageName": "package1",
		"projectVersionId": 10001
	},
	{
		"projectId": 10000,
		"packageName": "package2",
	},
	{
		"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",
	"snapshotVersions": [
	{
		"projectId": 10000,
		"packageName": "package1",
		"projectVersionId": 10001,
		"requestAllFiles": false,
		"snapshotVersionStatus": "EXISTING"
	},
	{
		"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/releases/{releaseId}/snapshot

Parameters

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

AttributesTypeRequiredDescription
actionStringYesshould be set to promoteToRelease for this API.
descriptionStringNoThe description of the snapshot
snapshotVersionInputsList<SnapshotVersionInputPojo>YesOne and only one element is required for promote to release action.

Elements of snapshotVersionInputs has following attributes:

AttributesTypeRequiredDescription
projectIdLongYesProject associated with release.
projectVersionIdLongYesThe version id of the project. If using packageName, version for package must be provided.
packageNameStringNoThe 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:

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

Elements of snapshotVersions 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

Example

If the previous snapshot had the following attributes:

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/releases/{releaseId}/snapshot with the following JSON object input:

POST JSON
{
	"action" : "promoteToRelease"
    "description": "example snapshot creation",
	"snapshotVersionInputs": [
	{
		"projectId": 10000,
		"packageName": "package1",
		"projectVersionId": 10025
	} ]
}

The following Snapshot JSON object will begin:

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"
	}]
}

Back to Top

  • No labels