Project API Deploy
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 workflow request. Workflow request id from return data can be used with Workflow Request API to determine when the execution is complete.
API URL
http://host:port/flexdeploy/rest/v1/project/{Id}/deploy
Request
Parameter | Required | Type | Description |
---|---|---|---|
environmentId | Y | Long | This is the environment id, not the environment name that is seen on most screens. |
instanceIds | N | Array 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. |
projectId | Y | Long | The Id of the project to deploy. |
forceDeploy | N | Boolean | Values are true or false. Indicates that the deployment should occur even when the projectVersionId is already deployed to that instance. Defaults to false. |
exceptionToWindow | N | Boolean | Values are true or false. Indicates that the deployment is an exception to the deployment window. Defaults to false. |
projectVersionId | Y | Long | The id of the project version to be deployed. |
startTime | N | String | 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 |
workflowVersionOverride | N | String | Optionally, the version of the workflow can be overridden. |
inputs | N | Array | See Common Parameters below. |
flexFields | N | Array | See Common Parameters below. |
changeTickets | N | Array of String | Ticket number for the given deployment, using the configured Change Management System. |
Input
This is a list of code/value pairs for the workflow inputs. Not all inputs need to be supplied. If an input has a default value that is acceptable for the workflow to run, it does not need to be supplied.
Attribute | Required | Type | Description |
---|---|---|---|
code | Y | String | The code of the input |
value | N | String | The value of the input |
FlexField
This is the list of the code/value pairs for the FlexFields (not the display name). Not all FlexFields need to be supplied. If a FlexFields has a default value or options that are acceptable for the workflow to run, it does not need to be changed.
Attribute | Required | Type | Description |
---|---|---|---|
code | Y | String | The code of the FlexField |
value | N | String | The value of the FlexField |
Response
Attribute | Type | Description |
---|---|---|
warningMessage | String | 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 |
warningCode | String | Matching warning code for the warning message. |
workflowRequests | Array | Array of workflow request objects |
Response Codes
HTTP Code | Description |
---|---|
200 | Project version already deployed |
201 | Deploy request initiated successfully |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Project not found |
500 | Unexpected internal server error |
Example Deploy Request
We can deploy a project with Id 6298858 with the following request:
Example 1:
API URLs
We send request by this payload:
{ "instanceIds" : [3535], "environmentId" : 418564, "forceDeploy" : "true", "projectVersionId" : 11053771 }
In response, we will receive an array of workflowRequests:
{ "isException": false, "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 }
- style