Environments can be accessed and modified through this API using GET this allows for the retrieval of workflow executions and there logs.
Authentication - Use Basic Authentication for this API.
Base URL for Environment REST API
Most functions return a JSON workflow execution object. The workflow execution object has these attributes:
Attributes | Type | Description |
---|---|---|
workflowExecutionId | Long | This is the unique id of the workflow execution |
dockerImageName | String | This is the name of the docker image |
environmentId | Long | This is the unique Id of the environment |
executionStatus | String | This is the status of the execution i.e. Success, Failure, Running |
instanceId | Long | This is the unique Id of the instance |
parentWorkflowExecutionId | Long | This is the unique id of a parent execution, if one exists |
predeployWorkflowExecutionId | Long | This is the unique id of a pre-deploy execution, if one was used |
projectId | Long | This is the unique Id of the project |
projectVersionId | Long | This is the unique Id of the project version |
projectWorkflowId | Long | This is the unique Id of the project workflow |
endTime | Timestamp | This is the time the execution ended, if it has ended |
startTime | Timestamp | This is the time the execution started |
workflowRequestId | Long | This is the unique id of the workflow request |
workflowVersionId | Long | This is the unique id of the workflow version |
createdOn | Timestamp | This is the time the execution was created |
createdBy | String | This is the user who created the execution |
updatedOn | Timestamp | This is the time the execution was updated |
updatedBy | String | This is the user who updated the execution last |
versionNumber | Integer | This the version number of the execution |
workflowState | String | This is the state of the workflow |
workflowId | Long | This is the id of the workflow |
workflowType | String | This is the type of the workflow |
reviewStatus | String | This is the status of the review |
abortedOn | Timestamp | This is when the execution was aborted if applicable |
abortedBy | String | This is who aborted the execution if applicable |
GET
There are two implementations of GET. One will find a workflow execution with the given Id and return the JSON representation of the workflow execution. The other will find a list of workflow executions matching the parameters supplied to it.
GET by ID
This GET service will find an environment with the given Id and return the JSON representation of the object.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
workflowExecutionId | URL | Yes | This is a URL parameter for the Id which is used to find and return an environment |
Response Codes
HTTP Code | Description |
---|---|
200 | Workflow Execution was found and returned |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Workflow Execution not found |
500 | Unexpected internal server error |
Example
If we had an workflow execution in our database with an Id of 1174966 and had the following attributes
{ "workflowVersionId": 228650, "workflowState": "<State Info>", "parentWorkflowExecutionId": null, "dockerImageName": null, "projectWorkflowId": 4113, "predeployWorkflowExecId": null, "createdOn": "2022-03-21T17:58:30.933+0000", "createdBy": "fdadmin", "updatedOn": "2022-03-21T17:58:40.085+0000", "updatedBy": "fdadmin", "versionNumber": 7, "reviewStatus": null, "endTime": "2022-03-21T17:58:40.071+0000", "abortedBy": null, "abortedOn": null, "workflowExecutionId": 1174966, "executionStatus": "Success", "workflowType": "DEPLOY", "startTime": "2022-03-21T17:58:32.500+0000", "workflowRequestId": 268609, "projectId": 4107, "environmentId": 11595, "projectVersionId": 1966876, "workflowId": 4126, "instanceId": 4204 }
When we run a GET request at the following URL
http://host:port/flexdeploy/rest/v1/workflowexecution/1174966
The GET request would return the following JSON environment object
{ "workflowVersionId": 228650, "workflowState": "<State Info>", "parentWorkflowExecutionId": null, "dockerImageName": null, "projectWorkflowId": 4113, "predeployWorkflowExecId": null, "createdOn": "2022-03-21T17:58:30.933+0000", "createdBy": "fdadmin", "updatedOn": "2022-03-21T17:58:40.085+0000", "updatedBy": "fdadmin", "versionNumber": 7, "reviewStatus": null, "endTime": "2022-03-21T17:58:40.071+0000", "abortedBy": null, "abortedOn": null, "workflowExecutionId": 1174966, "executionStatus": "Success", "workflowType": "DEPLOY", "startTime": "2022-03-21T17:58:32.500+0000", "workflowRequestId": 268609, "projectId": 4107, "environmentId": 11595, "projectVersionId": 1966876, "workflowId": 4126, "instanceId": 4204 }
GET (Using Query Parameters)
This GET service will return a list of environments in the form of JSON objects based on the query parameters code and name. Environments are only returned if they match all of the specified query parameters. If no query parameters are given this request will return the entire list of environments.
API URLs
http://host:port/flexdeploy/rest/v1/workflowExecution?
Append the following character sequences to the above URL to specify Query parameters.
Use '&' between successive query parameters:
workflowExecutionId={workflowExecutionId}
workflowRequestId={workflowRequestId}
The query parameters are not case sensitive. Searching by name=NAME is the same as searching by name=name.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
workflowExecutionId | URL | No | Search by workflow execution id |
workflowRequestId | URL | No | Search by workflow request id |
parentWorkflwoRequestId | URL | No | Search by parent workflow execution id |
projectId | URL | No | Search by project id |
projectVersionId | URL | No | Search by project version id |
projectWorkflowId | URL | No | Search by project workflow id |
workflowVersionid | URL | No | Search by project id |
environmentId | URL | No | Search by environment id |
instanceId | URL | No | Search by instance id |
predeployWorkflowExecId | URL | No | Search by predeploy workflow execution Id |
executionStatus | URL | No | Search by execution status |
dockerImageName | URL | No | Search by docker image name |
workflowId | URL | No | Search by workflow Id |
workflowType | URL | No | Search by workflow type |
reviewStatus | URL | No | Search by review status |
limit | URL | No | Limit the number of results. i.e. if set to 10, only 10 executions will be returned. if not included all will be returned. |
offset | URL | No | Offset of the results. This will offset the results. i.e. if you set the limit to 10, and now you want the next 10, set the offset to 10 and it will skip the first 10. |
Response Codes
HTTP Code | Description |
---|---|
200 | Matching Workflow Executions returned |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
500 | Unexpected internal server error |
Example
If we had a workflow execution in our database with an Id of 1174966 and had the following attributes
{ "workflowVersionId": 228650, "workflowState": "<State Info>", "parentWorkflowExecutionId": null, "dockerImageName": null, "projectWorkflowId": 4113, "predeployWorkflowExecId": null, "createdOn": "2022-03-21T17:58:30.933+0000", "createdBy": "fdadmin", "updatedOn": "2022-03-21T17:58:40.085+0000", "updatedBy": "fdadmin", "versionNumber": 7, "reviewStatus": null, "endTime": "2022-03-21T17:58:40.071+0000", "abortedBy": null, "abortedOn": null, "workflowExecutionId": 1174966, "executionStatus": "Success", "workflowType": "DEPLOY", "startTime": "2022-03-21T17:58:32.500+0000", "workflowRequestId": 268609, "projectId": 4107, "environmentId": 11595, "projectVersionId": 1966876, "workflowId": 4126, "instanceId": 4204 }
When we run a GET request at the following URL
http://host:port/flexdeploy/rest/v1/workflowexecution?workflowRequestId=268609
The GET request would return the following JSON workflow execution object
[ { "workflowVersionId": 228650, "workflowState": "<State Info>", "parentWorkflowExecutionId": null, "dockerImageName": null, "projectWorkflowId": 4113, "predeployWorkflowExecId": null, "createdOn": "2022-03-21T17:58:30.933+0000", "createdBy": "fdadmin", "updatedOn": "2022-03-21T17:58:40.085+0000", "updatedBy": "fdadmin", "versionNumber": 7, "reviewStatus": null, "endTime": "2022-03-21T17:58:40.071+0000", "abortedBy": null, "abortedOn": null, "workflowExecutionId": 1174966, "executionStatus": "Success", "workflowType": "DEPLOY", "startTime": "2022-03-21T17:58:32.500+0000", "workflowRequestId": 268609, "projectId": 4107, "environmentId": 11595, "projectVersionId": 1966876, "workflowId": 4126, "instanceId": 4204 } ]
GET Logs
This GET service will download all logs associated with this execution as a zip file.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
workflowExecutionId | URL | Yes | This is a URL parameter for the Id which is used to find and return an environment |
Result
logs.zip contains a folder named after the endpoint Id and then zero or more text files “PluginLogs_<Request_Id>_<Project_Id>.txt”