Versions Compared

Key

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

AnchorTopTopScheduled Tasks can be accessed through this API using GET. This API can also run and cancel scheduled tasks based on task id and other parameters.

...

Table of Contents
maxLevel2

Each function returns a JSON scheduled task object. The scheduled task object has these attributes:

...

Each scheduled task can be one of four different types: Step, Gate, Application, and Project.

Step Scheduled Task

...

Gate Scheduled Task

...

Application Scheduled Task

...

The folder request Id of the application scheduled task.

...

Project Scheduled Task

...

Include Page

...

titleBase URL for Scheduled Tasks REST API

...

http://host:port/flexdeploy/rest/v1/tasks/scheduled

REST V1 Authentication
REST V1 Authentication

Table of Contents
maxLevel2

GET

GET by TaskId

This GET service will find a scheduled task with the given task Id and return the JSON representation of the object. 

Info
titleAPI URL

http://host:port/flexdeploy/rest/v1/tasks/scheduled/{Id}

...

Request

Parameter

Type

Required

Description

Id

URLYesThis is a URL parameter for the Id which is used to find and return a scheduled task.

Include Page
REST V1 Scheduled Task Response
REST V1 Scheduled Task Response

Example

If we had a scheduled task in our database with an Id of 10000 and the following attributes

...

Code Block
themeEclipse
titleScheduled Task - 10000
{
   "projectVersionName": "1.0.11",
   "projectName": "Scheduled Tasks Project",
   "workflowRequestId": 656423,
   "projectId": 576267,
   "scheduledDate": "2099-03-16 22:17:52.0",
   "taskId": 14332,
   "requestType": "Project",
   "flexFields": [],
   "environmentId": 77954,
   "status": "PENDING",
   "notes": null
}

...

GET (Using Query Parameters)

...

Tip

The query parameters are not case sensitive. Searching by name=EXAMPLE is the same as searching by name=example.

...

Request

Parameter

Type

Required

Description

workflowRequestIdURLNoThis is a URL query parameter for the workflow request Id which is used to search the scheduled tasks.
folderRequestIdURLNoThis is a URL query parameter for the folder request Id which is used to search the scheduled tasks.
pipelineStageGateExecIdURLNoThis is a URL query parameter for the pipeline stage gate execution Id which is used to search the scheduled tasks.
pipelineStageStepExecIdURLNoThis is a URL query parameter for the pipeline stage step execution Id which is used to search the scheduled tasks.
projectIdURLNoThis is a URL query parameter for the project Id which is used to search the scheduled tasks.
applicationIdURLNoThis is a URL query parameter for the application Id which is used to search the scheduled tasks.
environmentIdURLNoThis is a URL query parameter for the environment Id which is used to search the scheduled tasks.
notesURLNoThis is a URL query parameter for notes added to the task when running or canceling it.

Include Page
REST V1 Scheduled Task Response
REST V1 Scheduled Task Response

Example

If we had a scheduled task in our database with the following attributes

...

Code Block
themeEclipse
titleApproval Task
{
   "projectVersionName": "1.0.11",
   "projectName": "Scheduled Tasks Project",
   "workflowRequestId": 656423,
   "projectId": 10002,
   "scheduledDate": "2099-03-16 22:17:52.0",
   "taskId": 14332,
   "requestType": "Project",
   "flexFields": [],
   "environmentId": 77954,
   "status": "PENDING",
   "notes": null
}

...

Run Now By TaskId

This PUT service will run a scheduled task with the given Id.

Info
titleAPI URL

http://host:port/flexdeploy/rest/v1/tasks/scheduled/runnow/{Id}

...

Request

AttributesTypeRequiredDescription
IdLongYesThe Id of the scheduled task you wish to run
notesStringNoThis is a URL query parameter to add notes to the task when running it..

Include Page
REST V1 Scheduled Task Response
REST V1 Scheduled Task Response

Example

If we had a scheduled task in our database with the following attributes

...

Code Block
themeEclipse
titleApproval Task
{
   "projectVersionName": "1.0.11",
   "projectName": "Scheduled Tasks Project",
   "workflowRequestId": 656423,
   "projectId": 576267,
   "scheduledDate": "2099-03-16 22:17:52.0",
   "taskId": 14332,
   "requestType": "Project",
   "flexFields": [],
   "environmentId": 77954,
   "status": "APPROVED",
   "notes": "Approved by George"
}

Back to Top

Run Now using Query Parameters

...

Info
titleReturned Tasks

Only one scheduled task can be run at a time. If more than one task matches the query parameters an exception will be thrown.

...

Request

Parameter

Type

Required

Description

workflowRequestIdURLNoThis is a URL query parameter for the workflow request Id which is used to search the scheduled tasks.
folderRequestIdURLNoThis is a URL query parameter for the folder request Id which is used to search the scheduled tasks.
pipelineStageGateExecIdURLNoThis is a URL query parameter for the pipeline stage gate execution Id which is used to search the scheduled tasks.
pipelineStageStepExecIdURLNoThis is a URL query parameter for the pipeline stage step execution Id which is used to search the scheduled tasks.
projectIdURLNoThis is a URL query parameter for the project Id which is used to search the scheduled tasks.
applicationIdURLNoThis is a URL query parameter for the application Id which is used to search the scheduled tasks.
environmentIdURLNoThis is a URL query parameter for the environment Id which is used to search the scheduled tasks.
notesURLNoThis is a URL query parameter to add notes to the task when running it.

Include Page
REST V1 Scheduled Task Response
REST V1 Scheduled Task Response

Example

If we had a scheduled task in our database with the following attributes

...

Code Block
themeEclipse
titleApproval Task
{
   "projectVersionName": "1.0.11",
   "projectName": "Scheduled Tasks Project",
   "workflowRequestId": 656423,
   "projectId": 10002,
   "scheduledDate": "2099-03-16 22:17:52.0",
   "taskId": 14332,
   "requestType": "Project",
   "flexFields": [],
   "environmentId": 77954,
   "status": "APPROVED",
   "notes": "Approved by George"
}

...

Cancel By TaskId

This PUT service will reject a scheduled task with the given Id.

Info
titleAPI URL

http://host:port/flexdeploy/rest/v1/tasks/scheduled/cancel/{Id}

...

Request

AttributesTypeRequiredDescription
IdLongYesThe Id of the scheduled task you wish to cancel
notesStringNoThis is a URL query parameter to add notes to the task when canceling it.

Include Page
REST V1 Scheduled Task Response
REST V1 Scheduled Task Response

Example

If we had a scheduled task in our database with the following attributes

...

Code Block
themeEclipse
titleApproval Task
{
   "projectVersionName": "1.0.11",
   "projectName": "Scheduled Tasks Project",
   "workflowRequestId": 656423,
   "projectId": 10002,
   "scheduledDate": "2099-03-16 22:17:52.0",
   "taskId": 14332,
   "requestType": "Project",
   "flexFields": [],
   "environmentId": 77954,
   "status": "REJECTED",
   "notes": null
}

Back to Top

Cancel using Query Parameters

...

Info
titleReturned Tasks

Only one scheduled task can be canceled at a time. If more than one task matches the query parameters an exception will be thrown.

...

Request

Parameter

Type

Required

Description

workflowRequestIdURLNoThis is a URL query parameter for the workflow request Id which is used to search the scheduled tasks.
folderRequestIdURLNoThis is a URL query parameter for the folder request Id which is used to search the scheduled tasks.
pipelineStageGateExecIdURLNoThis is a URL query parameter for the pipeline stage gate execution Id which is used to search the scheduled tasks.
pipelineStageStepExecIdURLNoThis is a URL query parameter for the pipeline stage step execution Id which is used to search the scheduled tasks.
projectIdURLNoThis is a URL query parameter for the project Id which is used to search the scheduled tasks.
applicationIdURLNoThis is a URL query parameter for the application Id which is used to search the scheduled tasks.
environmentIdURLNoThis is a URL query parameter for the environment Id which is used to search the scheduled tasks.
notesURLNoThis is a URL query parameter to add notes to the task when canceling it.

Include Page
REST V1 Scheduled Task Response
REST V1 Scheduled Task Response

Example

If we had a scheduled task in our database with the following attributes

Code Block
themeEclipse
titleApproval Task
{
   "projectVersionName": "1.0.11",
   "projectName": "Scheduled Tasks Project",
   "workflowRequestId": 656423,
   "projectId": 10002,
   "scheduledDate": "2099-03-16 22:17:52.0",
   "taskId": 14332,
   "requestType": "Project",
   "flexFields": [],
   "environmentId": 77954,
   "status": "PENDING",
   "notes": null
}

When we run a PUT request at the following URL

http://host:port/flexdeploy/rest/v1/tasks/scheduled/cancel?projectid=10002&notes=Approved+by+George

...

Code Block
themeEclipse
titleApproval Task
{
   "projectVersionName": "1.0.11",
   "projectName": "Scheduled Tasks Project",
   "workflowRequestId": 656423,
   "projectId": 10002,
   "scheduledDate": "2099-03-16 22:17:52.0",
   "taskId": 14332,
   "requestType": "Project",
   "flexFields": [],
   "environmentId": 77954,
   "status": "REJECTED",
   "notes": "Approved by George"
}

...