Versions Compared

Key

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

This POST service will perform the same action found on the Deployment Request Form off the project screen. It will initiate a request to deploy the project specified with the project Id. The service will return the workflowRequestId which workflow request. Workflow request id from return data can be used by the getWorkflowRequestStatus call with Workflow Request API to determine when the workflow execution is complete.

Info
titleAPI URL

http://host:port/flexdeploy/rest/v1/project/{Id}/deploy

...

This is required for partial deployments, but not for full deployments
ParameterRequiredTypeDescription
environmentIdYLongThis is the environment id, not the environment name that is seen on most screens.
instanceIdsNArray of Long

The list of instances where the deployment will occur. Make sure to enter the instance id, not the instance name that is seen on most screens.

If not provided, all deploy instances configured for Project will be used for deployment.

projectIdYLongThe Id of the project to deploy.packageDetailsN*Array of PackageInfo.

Included to indicate what should be deployed in a partial deployment.

See more info on PackageInfo below.

forceDeploy
NBooleanValues are true or false. Indicates that the deployment should occur even when the projectVersionId is already deployed to that instance. Defaults to false.
exceptionToWindowNBooleanValues are true or false. Indicates that the deployment is an exception to the deployment window. Defaults to false.
projectVersionIdNYLongThe id of the project version to be deployed. If not specified, the most recently built projectVersionId will be deployed. 
startTimeNString

The time when the deployment will be started. Format should yyyy-MM-dd'T'HH:mm:ssXXX.

For example, 2019-03-16T21:17:52-06:00

workflowVersionOverrideNStringOptionally, the version of the workflow can be overridden.
inputs NArraySee Common Parameters below.
flexFieldsNArraySee Common Parameters below.
changeNumberchangeTicketsNArray of StringTicket number for the given deployment, using the configured Change Management System.

...

AttributeRequiredTypeDescription
codeYStringThe code of the FlexField
valueNStringThe value of the FlexField

...

Response

packageName
AttributeRequiredTypeDescription
warningMessageNStringThe name of the package to deploy. If blank, all files will be assumed.
priorityNIntegerThe priority of the package. If it is not indicated, then FlexDeploy will deploy the packages in the order they are provided in the JSON request.
projectVersionIdY*LongThe id of the project version to deploy. This parameter is not required if useLatestPackageVersion is true.
useLatestPackageVersionNBooleanUses the most recent package version. Defaults to false.

Response

Returns the workflow request id that was just submitted.
AttributeTypeDescription
workflowRequestIdStringString

Indicates any warning message in the event where the request was successful but no new deployment was initiated.  

For example: Project Version is already deployed and force deploy wasn't specified

warningCodeStringMatching warning code for the warning message.  
workflowRequestsArray

Array of workflow request objects

Response Codes

HTTP CodeDescription
200Project version already deployed
201
Project was built
Deploy request initiated successfully
400Bad request
401
Unauthorized
Authentication failure
403Authorization failure (no access to resource)
404Project not found
500Unexpected internal server error

Example Deploy Request

We can deploy a project with

...

Id 6298858 with the following request:

Example 1:

Info
titleAPI URLs

http://host:port/flexdeploy/rest/v1/project/100046298858/deploy

We send request by this payload:

Code Block
languagejs
themeEclipse
{
	        "instanceIds" : [1000013535],
	        "environmentId" :12345,
	 418564,
        "forceDeploy" : "true",
        "projectVersionId" : 11053771
}


In response, we will receive an array of workflowRequests:

Code Block
languagejs
themeEclipse
{
    "isException": false,
    ",
	"inputs":
	[
		{
			"code":"RESTART_SEVER",
			"value":"true"
		},
		{
			"code":"COMMENT",
			"value":"Deploying from REST API"
		}
	]
}

In response, we will receive the workflowRequestId:

...

requestedStartTime": null,
    "predeployRequestedStartTime": null,
    "stopOnPkgError": false,
    "groupRequestId": null,
    "requestStatus": "READY",
    "deploymentStrategy": null,
    "oldWeight": null,
    "newWeight": null,
    "routeRule": null,
    "finishDeployment": null,
    "instances": [
        {
            "instanceCode": "EBS2",
            "createdOn": null,
            "createdBy": null,
            "instanceId": 3535,
            "workflowRequestId": 208087
        }
    ],
    "projectWorkflowId": 6298861,
    "predeployWorkflowExecId": null,
    "flexField1": null,
    "flexField3": null,
    "flexField4": null,
    "flexField2": null,
    "flexField5": null,
    "flexField6": null,
    "flexField7": null,
    "flexField8": null,
    "flexField9": null,
    "flexField10": null,
    "allFilesRequested": false,
    "workflowVersionOverride": null,
    "force": true,
    "createdOn": "2023-01-24T15:40:10.296+0000",
    "createdBy": "fdadmin",
    "updatedOn": "2023-01-24T15:40:10.517+0000",
    "updatedBy": "fdadmin",
    "versionNumber": 2,
    "pipelineStageStepExecId": null,
    "pipelineStageExecId": null,
    "relDefinitionId": null,
    "relSnapshotId": null,
    "triggerType": "MANUAL",
    "folderId": 943036,
    "workflowRequestId": 208087,
    "projectId": 6298858,
    "environmentId": 418564,
    "inputs": [],
    "projectStreamId": 6298859,
    "projectVersionId": 11053771,
    "workflowId": 481140,
    "workflowType": "DEPLOY",
    "priority": 1
}