Anchor
...
Include Page |
---|
...
title | Base URL for Scheduled Tasks REST API |
---|
|
Table of Contents | ||
---|---|---|
|
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, Stage, Application, and Project.
Step Scheduled Task
...
Gate Scheduled Task
...
Application Scheduled Task
...
The folder request Id of the application scheduled task.
Project Scheduled Task
...
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.
...
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 | ||
---|---|---|
| ||
Request
Parameter | Type | Required | Description |
---|---|---|---|
Id | URL | Yes | This is a URL parameter for the Id which is used to find and return a scheduled task. |
Include Page | ||||
---|---|---|---|---|
|
Response Codes
HTTP Code | Description |
---|---|
200 | Task was found and returned |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Task not found |
500 | Unexpected internal server error |
Example
If we had a scheduled task in our database with an Id of 10000 and the following attributes
Code Block | ||||
---|---|---|---|---|
| ||||
{
"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
} |
When we run a GET request at the following URL
http://host:port/flexdeploy/rest/v1/tasks/scheduled/10000
The GET request would return the following JSON scheduled task object
Code Block | ||||
---|---|---|---|---|
| ||||
{
"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)
This GET service will return a list of scheduled tasks in the form of JSON objects based on a query parameter for the display name. Scheduled tasks are only returned if they contain the specified parameter. If no query parameters are given this request will return the entire list of scheduled tasks.
Info | ||
---|---|---|
| ||
http://host:port/flexdeploy/rest/v1/tasks/scheduled/{Id} |
Parameters
...
Parameter
...
Type
...
Required
...
Description
...
Id
...
Example
If we had a scheduled task in our database with an Id of 10000 and had the following attributes
Code Block | ||||
---|---|---|---|---|
| ||||
{
"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"
} |
When we run a GET request at the following URL
http://host:port/flexdeploy/rest/tasks/scheduled/10000
The GET request would return the following JSON scheduled task object
Code Block | ||||
---|---|---|---|---|
| ||||
{
"projectVersionName": "1.0.11",
"projectName": "Scheduled Tasks Project",
"workflowRequestId": 656423,
"projectId": 576267,
"scheduledDate": "2099-03-16 22:17:52.0",
"taskId": 14332,
"requestType": " ? Append the following character sequences to the above URL to specify Query parameters.workflowRequestId = {workflowRequestId} folderRequestId = {folderRequestId} pipelineStageGateExecId = {pipelineStageGateExecId} pipelineStageStepExecId = {pipelineStageStepExecId} projectId = {projectId} applicationId = {applicationId} environmentId = {environmentId} notes = {notes} Examples:To return all of the scheduled tasks:http://host:port/flexdeploy/rest/v1/tasks/scheduled To search by project Id only:http://host:port/flexdeploy/rest/v1/tasks/scheduled?projectid=11001 |
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 |
---|---|---|---|
workflowRequestId | Query - Long | No | This is a URL query parameter for the workflow request Id which is used to search the scheduled tasks. |
folderRequestId | Query - Long | No | This is a URL query parameter for the folder request Id which is used to search the scheduled tasks. |
pipelineStageGateExecId | Query - Long | No | This is a URL query parameter for the pipeline stage gate execution Id which is used to search the scheduled tasks. |
pipelineStageStepExecId | Query - Long | No | This is a URL query parameter for the pipeline stage step execution Id which is used to search the scheduled tasks. |
projectId | Query - Long | No | This is a URL query parameter for the project Id which is used to search the scheduled tasks. |
applicationId | Query - Long | No | This is a URL query parameter for the application Id which is used to search the scheduled tasks. |
environmentId | Query - Long | No | This is a URL query parameter for the environment Id which is used to search the scheduled tasks. |
notes | Query - String | No | This is a URL query parameter for notes added to the task when running or canceling it. Equals type search. |
Include Page | ||||
---|---|---|---|---|
|
Response Codes
HTTP Code | Description |
---|---|
200 | Search successful and results returned |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
500 | Unexpected internal server error |
Example
If we had a scheduled task in our database with the following attributes
Code Block | ||||
---|---|---|---|---|
| ||||
{ "projectVersionName": "1.0.11", "projectName": "Scheduled Tasks Project", "flexFieldsworkflowRequestId": []656423, "projectId": 10002, "environmentIdscheduledDate": 77954"2099-03-16 22:17:52.0", "statustaskId": "PENDING" } |
GET (Using Query Parameters)
This GET service will return a list of scheduled tasks in the form of JSON objects based on a query parameter for the display name. Scheduled tasks are only returned if they contain the specified parameter. If no query parameters are given this request will return the entire list of scheduled tasks.
Info | ||
---|---|---|
| ||
14332,
"requestType": "Project",
"flexFields": [],
"environmentId": 77954,
"status": "PENDING",
"notes": null
} |
When we run a GET request at the following URL
http://host:port/flexdeploy/rest/v1/tasks/scheduled?
...
Append the following character sequences to the above URL to specify Query parameters.
workflowRequestId = {workflowRequestId}
folderRequestId = {folderRequestId}
pipelineStageGateExecId = {pipelineStageGateExecId}
pipelineStageStepExecId = {pipelineStageStepExecId}
projectId = {projectId}
applicationId = {applicationId}
environmentId = {environmentId}
Examples:
To return all of the scheduled tasks:
http://host:port/flexdeploy/rest/tasks/scheduled
To search by project Id only:
http://host:port/flexdeploy/rest/tasks/scheduled?projectid=11001
Tip |
---|
The query parameters are not case sensitive. Searching by name=EXAMPLE is the same as searching by name=example. |
Parameters
...
Parameter
...
Type
...
Required
...
Description
...
The GET request would return the following JSON scheduled task object
Code Block | ||||
---|---|---|---|---|
| ||||
{
"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 | ||
---|---|---|
| ||
http://host:port/flexdeploy/rest/v1/tasks/scheduled/runnow/{Id} |
Request
Attributes | Type | Required | Description |
---|---|---|---|
Id | Long | Yes | The Id of the scheduled task you wish to run |
notes | String | No | This is a URL query parameter |
to add notes to the task when running it. |
Include Page | ||||
---|---|---|---|---|
|
Response Codes
HTTP Code | Description |
---|---|
200 | Task was found and schedule set to run immediately |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Task not found |
500 | Unexpected internal server error |
Example
If we had a scheduled task in our database with the following attributes
Code Block | ||||
---|---|---|---|---|
| ||||
{ "projectVersionName": "1.0.11", "projectName": "Scheduled Tasks Project", "workflowRequestId": 656423, "projectId": 10002576267, "scheduledDate": "2099-03-16 22:17:52.0", "taskId": 14332, "requestType": "Project", "flexFields": [], "environmentId": 77954, "status": "PENDING", "notes": null } |
When we run a GET PUT request at the following URL
http://host:port/flexdeploy/rest/v1/tasks/scheduled/runnow/14332?projectid=10002notes=Approved+by+George
The GET PUT request would run the scheduled task and return the the following JSON scheduled task object
Code Block | ||||
---|---|---|---|---|
| ||||
{ "projectVersionName": "1.0.11", "projectName": "Scheduled Tasks Project", "workflowRequestId": 656423, "projectId": 10002576267, "scheduledDate": "2099-03-16 22:17:52.0", "taskId": 14332, "requestType": "Project", "flexFields": [], "environmentId": 77954, "status": "APPROVED", "notes": "PENDINGApproved by George" } |
...
Run Now
...
using Query Parameters
This PUT service will run a scheduled task with the given Idattributes.
Info | ||
---|---|---|
| ||
http://host:port/flexdeploy/rest/v1/tasks/scheduled/runnow/{Id} |
Parameters
...
Example
If we had a scheduled task in our database with the following attributes
Code Block | ||||
---|---|---|---|---|
| ||||
{
"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"
} |
When we run a PUT request at the following URL
http://host:port/flexdeploy/rest/tasks/scheduled/runnow/14332
The PUT request would run the scheduled task and return the following JSON scheduled task object
Code Block | ||||
---|---|---|---|---|
| ||||
{
"projectVersionName": "1.0.11",
"projectName": "Scheduled Tasks Project",
"workflowRequestId": 656423,
"projectId": 576267,
" ? Append the following character sequences to the above URL to specify Query parameters.workflowRequestId = {workflowRequestId} folderRequestId = {folderRequestId} pipelineStageGateExecId = {pipelineStageGateExecId} pipelineStageStepExecId = {pipelineStageStepExecId} projectId = {projectId} applicationId = {applicationId} environmentId = {environmentId} notes = {notes} |
Info | ||
---|---|---|
| ||
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 |
---|---|---|---|
workflowRequestId | URL | No | This is a URL query parameter for the workflow request Id which is used to search the scheduled tasks. |
folderRequestId | URL | No | This is a URL query parameter for the folder request Id which is used to search the scheduled tasks. |
pipelineStageGateExecId | URL | No | This is a URL query parameter for the pipeline stage gate execution Id which is used to search the scheduled tasks. |
pipelineStageStepExecId | URL | No | This is a URL query parameter for the pipeline stage step execution Id which is used to search the scheduled tasks. |
projectId | URL | No | This is a URL query parameter for the project Id which is used to search the scheduled tasks. |
applicationId | URL | No | This is a URL query parameter for the application Id which is used to search the scheduled tasks. |
environmentId | URL | No | This is a URL query parameter for the environment Id which is used to search the scheduled tasks. |
notes | URL | No | This is a URL query parameter to add notes to the task when running it. |
Include Page | ||||
---|---|---|---|---|
|
Response Codes
HTTP Code | Description |
---|---|
200 | Task was found and schedule set to run immediately |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Task not found |
500 | Unexpected internal server error |
Example
If we had a scheduled task in our database with the following attributes
Code Block | ||||
---|---|---|---|---|
| ||||
{ "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", "APPROVEDnotes": null } |
Run Now using Query Parameters
This PUT service will run a scheduled task with the given attributes.
...
title | API URLs |
---|
When we run a PUT request at the following URL
http://host:port/flexdeploy/rest/v1/tasks/scheduled/runnow?
...
Append the following character sequences to the above URL to specify Query parameters.
workflowRequestId = {workflowRequestId}
folderRequestId = {folderRequestId}
pipelineStageGateExecId = {pipelineStageGateExecId}
pipelineStageStepExecId = {pipelineStageStepExecId}
projectId = {projectId}
applicationId = {applicationId}
environmentId = {environmentId}
Info | ||
---|---|---|
| ||
Only one scheduled task can be ran at a time. If more than one task matches the query parameters an exception will be thrown. |
Parameters
...
Parameter
...
Type
...
Required
...
Description
...
Example
If we had a scheduled task in our database with the following attributes
Code Block | ||||
---|---|---|---|---|
| ||||
{
"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"
} |
When we run a PUT request at the following URL
http://host:port/flexdeploy/rest/tasks/scheduled/runnow?projectid=10002
The PUT request would run the scheduled task and return the following JSON scheduled task object
Code Block | ||||
---|---|---|---|---|
| ||||
{
"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"
} |
Cancel By TaskId
This PUT service will reject a scheduled task with the given Id.
Info | ||
---|---|---|
| ||
http://host:port/flexdeploy/rest/tasks/scheduled/cancel/{Id} |
Parameters
...
projectid=10002¬es=Approved+by+George
The PUT request would run the scheduled task and return the following JSON scheduled task object
Code Block | ||||
---|---|---|---|---|
| ||||
{
"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 | ||
---|---|---|
| ||
http://host:port/flexdeploy/rest/v1/tasks/scheduled/cancel/{Id} |
Request
Attributes | Type | Required | Description |
---|---|---|---|
Id | Long | Yes | The Id of the scheduled task you wish to cancel |
notes | String | No | This is a URL query parameter to add notes to the task when canceling it. |
Include Page | ||||
---|---|---|---|---|
|
Response Codes
HTTP Code | Description |
---|---|
200 | Task was found and cancelled |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Task not found |
500 | Unexpected internal server error |
Example
If we had a scheduled task in our database with the following attributes
Code Block | ||||
---|---|---|---|---|
| ||||
{ "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": 77954"PENDING", "statusnotes": "PENDING"null } |
When we run a PUT request at the following URL
http://host:port/flexdeploy/rest/v1/tasks/scheduled/cancel/14332?notes=
The PUT request would cancel the scheduled task and return the following JSON scheduled task object
Code Block | ||||
---|---|---|---|---|
| ||||
{ "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
} |
Cancel using Query Parameters
...
Info | ||
---|---|---|
| ||
http://host:port/flexdeploy/rest/v1/tasks/scheduled/cancel? Append the following character sequences to the above URL to specify Query parameters.workflowRequestId = {workflowRequestId} folderRequestId = {folderRequestId} pipelineStageGateExecId = {pipelineStageGateExecId} pipelineStageStepExecId = {pipelineStageStepExecId} projectId = {projectId} applicationId = {applicationId} environmentId = {environmentId} notes = {notes} |
Info | ||
---|---|---|
| ||
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 |
---|---|---|---|
workflowRequestId | URL | No | This is a URL query parameter for the workflow request Id which is used to search the scheduled tasks. |
folderRequestId | URL | No | This is a URL query parameter for the folder request Id which is used to search the scheduled tasks. |
pipelineStageGateExecId | URL | No | This is a URL query parameter for the pipeline stage gate execution Id which is used to search the scheduled tasks. |
pipelineStageStepExecId | URL | No | This is a URL query parameter for the pipeline stage step execution Id which is used to search the scheduled tasks. |
projectId | URL | No | This is a URL query parameter for the project project Id which is used to search the scheduled tasks. |
applicationId | URL | No | This is a URL query parameter for the application Id which is used to search the scheduled tasks. |
applicationIdenvironmentId | URL | No | This is a URL query parameter for the application environment Id which is used to search the scheduled tasks. |
environmentIdnotes | URL | No | This is a URL query parameter for the environment Id which is used to search the scheduled tasks.to add notes to the task when canceling it. |
Include Page | ||||
---|---|---|---|---|
|
Response Codes
HTTP Code | Description |
---|---|
200 | Task was found and cancelled |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Task not found |
500 | Unexpected internal server error |
Example
If we had a scheduled task in our database with the following attributes
Code Block | ||||
---|---|---|---|---|
| ||||
{ "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¬es=Approved+by+George
The PUT request would cancel the scheduled task and return the following JSON scheduled task object
Code Block | ||||
---|---|---|---|---|
| ||||
{ "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"
} |