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

Version 1 Next »

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

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

AttributesTypeDescription
snapshotNameStringThe name of the snapshot is automatically generated at the time of creation
descriptionStringThe description of the snapshot
projectsList<Project>A list of projects associated with the snapshot

Projects have the following attributes:

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

Back to Top


POST

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

Parameters

AttributesRequiredTypeDescription
releaseIdYesURLThe release to create a snapshot from
snapshotNameNoStringThe name of the snapshot is automatically generated at the time of creation
descriptionNoStringThe description of the snapshot
projectsNoList<Project>A list of projects associated with the snapshot
projectIdYesLongThe id of the project
packageNameYes*StringThe name of the package (used for partial deployment projects only)
projectVersionIdNoLongThe version id of the project to use instead of creating a new version
buildEnvironmentIdNoLongThe build environment associated with the project
forceBuildNoBooleanWhether or not the project should be force built

*only if it's a partial deployment project

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 release creation",
	"projects": [
	{
		"projectId": 10000,
		"packageName": "package1",
		"projectVersionId": 10001
	},
	{
		"projectId": 10000,
		"packageName": "package2",
		"forceBuild": true
	},
	{
		"projectId": 10002,
		"buildEnvironmentId": 10003
	}
}

The following environment object will then be created as a new row in the database.

Environment Post Return JSON
{
   "description": "This is Environment 1",
   "instances": [15100],
   "isActive": true,
   "environmentCode": "ENV1",
   "sortNumber": 1,
   "environmentId": 11101,
   "isBuildEnvironment": true,
   "environmentName": "Env 1"
}

Back to Top


PUT

This PUT service will update all attributes of an environment with the given Id based on the attributes of a JSON object parameters.

Sample PUT JSON Request
{
   "description": "This is Put 1",
   "instances": [15100],
   "isActive": false,
   "environmentCode": "PUT1",
   "sortNumber": 6,
   "environmentId": 00000,
   "isBuildEnvironment": true,
   "environmentName": "Put 1"
}

Parameters

Parameters

Type

Required

Description

IdURLYesThis is a URL parameter for the Id which is used to find and return an environment with.
descriptionStringNoThis is the description that the environment's description will be updated to.
instancesList<Long>NoThis is the list of Instance Ids that will be assigned to the environment that is being updated.
isActiveBooleanYesThis is the isActive boolean that the environment's isActive boolean will be updated to.
environmentCodeStringYesThis is the Code that the environment's Code will be updated to.
sortNumberIntegerYesThis is the sort number that the environment's sort number will be updated to.
environmentIdLongYesThis is the Id place holder. This Id will not be updated in the environment.
isBuildEnvironmentBooleanYesThis is the isBuildEnvironment boolean that the environment's isBuildEnvironment boolean will be updated to.
environmentNameStringYesThis is the name that the environment's name will be updated to.

Example

If we had an environment in our database with an Id of 11101 and had the following attributes

Environment PUT JSON
{
   "description": "This is Environment 1" 
   "instances": [15100],
   "isActive": true,
   "environmentCode": "ENV1",
   "sortNumber": 1,
   "environmentId": 11101,
   "isBuildEnvironment": true,
   "environmentName": "Env 1"
}

When we run a PUT request at the following URL

http://host:port/flexdeploy/rest/topology/environment/11101

And the PUT request receives the following JSON environment object,

Environment PUT Receive JSON
{
   "description": "This is the updated Environment 1",
   "instances": [15101],
   "isActive": true,
   "environmentCode": "PUT2",
   "sortNumber": 2,
   "environmentId": 11101,
   "isBuildEnvironment": false,
   "environmentName": "PUT 2"
}


The PUT request would then update the environment with Id 11101 and return the  following JSON environment object

Environment PUT Return JSON
{
   "description": "This is the updated Environment 1",
   "instances": [15101],
   "isActive": true,
   "environmentCode": "PUT2",
   "sortNumber": 2,
   "environmentId": 11101,
   "isBuildEnvironment": false,
   "environmentName": "PUT 2"
}


Back to Top


PATCH

This PATCH service will update an existing environment with the information passed through a JSON object. If an attribute of the JSON is null it will not be updated in the environment.


Parameters

Parameters

Type

Required

Description

IdURLYesThis is a URL parameter for the Id which is used to find and return an environment with.
descriptionStringNoThis is the description that the environment's description will be updated to.
instancesList<Long>NoThis is the list of instance Ids that will be assigned to the environment that is being updated.
isActiveBooleanNoThis is the isActive boolean that the environment's isActive boolean will be updated to.
environmentCodeStringNoThis is the code that the environment's code will be update to.
sortNumberIntegerNoThis is the sort number that the environment's sort number will be updated to.
environmentIdLongNoThis is the Id place holder. It will not change the environment's Id that is being updated. 
isBuildEnvironmentBooleanNoThis is the isActive boolean that the environment's isActive boolean will be updated to.
environmentNameStringNoThis is the name that the environment's name will be updated to.

Example

If we had an environment in our database with an Id of 11101 and had the following attributes

Environment PATCH JSON
{
   "description": "This is Environment 1",
   "instances": [15101],
   "isActive": true,
   "environmentCode": "ENV1",
   "sortNumber": 1,
   "environmentId": 11101,
   "isBuildEnvironment": false,
   "environmentName": "Env 1"
}

When we run a PATCH request at the following URL

http://host:port/flexdeploy/rest/topology/environment/11101

And the PATCH request receives the following JSON environment object,

Environment PATCH Receive JSON
{
   "description": "This is Patch with some null attributes",
   "instances": [15102,15103],
   "isActive": null,
   "environmentCode": null,
   "sortNumber": 7,
   "environmentId": null,
   "isBuildEnvironment": false,
   "environmentName": "Patch with some null"
}

The PATCH request would then update the environment with Id 11101 and return the  following JSON environment object

Environment PATCH Return JSON
{
   "description": "This is Patch with some null attributes",
   "instances": [15102,15103],
   "isActive": true,
   "environmentCode": "ENV1",
   "sortNumber": 7,
   "environmentId": 11101,
   "isBuildEnvironment": false,
   "environmentName": "Patch with some null"
}

Back to Top



  • No labels