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 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
titleAPI URLs

http://host:port/flexdeploy/rest/v1/project/{id}/execute


Request

Attributes

Required

Type

Description

idYURLThis 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: yyyy-MM-dd'T'HH:mm:ssXXX

workflowVersionOverride

N

String

Optionally, specify a workflow version to override the active workflow version.

inputs

N

Array

This is a list of code/value pairs for the 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.

flexFields

N

Array

This is a list of the code/value pairs for the Flexfields. Not all FlexFields need to be supplied. If a FlexField has a default value or options that are acceptable for the workflow to run, it does not need to be changed.

Response

Attributes

Type

Description

warningMessageString

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

warningCodeStringMatching warning code for the warning message.  

workflowRequests

Array

Array of workflow request objects

Response Codes

HTTP CodeDescription
201Project was found and executed
400Bad request
401Unauthorized
500Unexpected 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
themeEclipse
{
	"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
themeEclipse
{
    "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
        }
    ]
}