This POST service will perform the same action found on the Execute Utility Project Request Form off the project screen. It will initiate a request to execute the project with the Project ID specified in the URL. The service will return the workflowRequestId
which can be used by the getWorkflowRequestStatus (version 0)
call return workflow request. Workflow request id from return data can be used with Workflow Request API to determine when the workflow execution is complete.
Info | ||
---|---|---|
| ||
http://host:port/flexdeploy/rest/v1/project/{id}/execute |
Request
Attributes | Required | Type | Description |
---|---|---|---|
id | Y | URL | This is a URL path parameter for the id which is used to execute a project. |
environmentId | Y | Long | The Id of the Environment the project should be executed in. |
instanceIds | N | List<Long> | A list of Instance Ids that the project should be executed on. If not supplied, the project will execute on the instances that are associated to the utility project. |
exceptionToWindow | N | Boolean | Values are true or false. Indicates that the deployment is an exception to the deployment window. Defaults to false. |
startTime | N | DateTime | The time when the deployment will be started. The expected time format is: |
workflowVersionOverride | N | String | Optionally, specify a workflow version to override the active workflow version. |
inputs | N | Array | This is a list of |
flexFields | N | Array | This is a list of the |
Response
Attributes | Type | Description |
---|---|---|
warningMessage | String | Indicates any warning message in the event where the request was successful but no execution was initiated. |
warningCode | String | Matching warning code for the warning message. |
workflowRequests | Array | Array of workflow request objects |
Response Codes
HTTP Code | Description |
---|---|
201 | Project was found and executed |
400 | Bad request |
401 | Unauthorized |
500 | Unexpected internal server error |
Example
We can execute a Utility Project with Id 10004 with this request:
URL: http://host:port/flexdeploy/rest/v1/project/10004/execute
Code Block | ||
---|---|---|
| ||
{ "environmentId":10045, "instanceIds":[10044], "exceptionToWindow":false, "startTime":"2018-07-20T11:31:06Z", "workflowVersionOverride":"1.0", "inputs":[ {"code":"INPUT1","value":"Test"}, {"code":"INPUT2","value":"1234"} ], "flexFields":[ {"code":"FLEXFIELD1","value":"123"}, {"code":"FLEXFIELD2","value":"abc"} ] } |
In response, we will receive an array of workflowRequests:
Code Block | ||
---|---|---|
| ||
{ "warningCode": null, "warningMessage": null, "wfrequests": [ { "packageName": null, "workflowOverrideVersion": null, "stopOnPackageError": null, "workflowRequestStatus": "READY", "exceptionToWindow": false, "projectName": "Util", "workflowRequestId": 11819, "requestAllFiles": false, "projectStreamId": 29802, "projectVersionName": "1.0.1", "projectVersionId": 29809, "environmentId": 11210, "folderRequestId": null, "folderPath": "FlexDeploy/HR Utils", "flexFields": [], "projectId": 29801, "folderId": 10001, "requestedStartTime": null, "folderVersionId": null, "folderName": "HR Utils", "requestedBy": "fdadmin", "releaseDefinitionId": null, "cmsissues": "", "force": true, "releaseSnapshotId": null } ] } |