Getting a specified flow instance by filter (GET)

Description

URL

scheme://domain:port/platform/ws/flow/instances

Description

Gets the flow instances by filter.

HTTP Method

GET

Parameters

Name

Description

id

Optional. Flow id.

flowname

Optional. Flow definition name.

username

Optional. Flow definition owner. Use the keyword "all" to return flow definitions owned by all users.

state

Optional. Flow instance state. Possible values:

  • Running
  • Exit
  • Killed
  • Done
  • Suspended

start

Optional. The start index for flow instance paging.

pagesize

Optional. Maximum number of flow instances that are returned.

Request

Request

Request Information

Method

GET

Request-URI

/platform/ws/flow/instances

or

/platform/ws/flow/instances?id=%d&flowname=%s&username=%s&state=%s&start=%d&pagesize=%d

Request-Header

Name

Value

Accept

application/xml or application/json

Message-Body

empty

Response

Response Code

  • 200 Successful: Request was successful.
  • 400 Bad Request: The request is not valid.
  • 403 Forbidden: Access restricted by role-based access control permissions.
  • 404 Not Found: No flow instances that match the specified criteria found.
  • 500 Internal Server Error: Exception occurred

Response-Header

Name

Value

Content-Type

application/xml or application/json

Message-body

Success Message

If successful, returns flow definition list information.

{
    "pseudoFlowInstances": {
        "total": 2,
        "pseudoFlowInstance": [
            {
                "id": 101,
                "user": "jsmith",
                "name": "flow1",
                "fullName": "101:jsmith:flow1",
                "state": "Done",
                "status": 0,
                "workDirectory": "/home/jsmith",
                "lastUpdateTime": "2018-08-14 14:11:15 GMT+08:00",
                "startTime": "2018-08-14 14:01:15 GMT+08:00",
                "endTime": "2018-08-14 14:11:15 GMT+08:00"
            },
            {
                "id": 102,
                "user": "jsmith",
                "name": "flow1",
                "fullName": "102:jsmith:flow1",
                "state": "Running",
                "status": 0,
                "workDirectory": "/home/jsmith”,
                " lastUpdateTime": "2018-08-14 14:13:15 GMT+08:00",
                "startTime": "2018-08-14 14:13:15 GMT+08:00",
                "endTime": ""
            }
        ]
    }
}
Failure Message

If not successful, returns an error message.

{
    "error": {
        "message": "%s"
    }
}

Example: Get flow instances by user

# Request
GET /platform/ws/flow/instances?username=jsmith
Accept: application/json;


# Response
200 Successful
Content-Type: application/json;
{
    "pseudoFlowInstances": {
        "total": 2,
        "pseudoFlowInstance": [
            {
                "id": 101,
                "user": "jsmith",
                "name": "flow1",
                "fullName": "101:jsmith:flow1",
                "state": "Done",
                "status": 0,
                "workDirectory": "/home/jsmith",
                " lastUpdateTime": "2018-08-14 14:11:15 GMT+08:00",
                "startTime": "2018-08-14 14:01:15 GMT+08:00",
                "endTime": "2018-08-14 14:11:15 GMT+08:00"
            },
            {
                "id": 102,
                "user": "jsmith",
                "name": "flow1",
                "fullName": "102:jsmith:flow1",
                "state": "Running",
                "status": 0,
                "workDirectory": "/home/jsmith",
                "lastUpdateTime": "2018-08-14 14:13:15 GMT+08:00",
                "startTime": "2018-08-14 14:13:15 GMT+08:00",
                "endTime": ""
            }
        ]
    }
}

# Request
GET /platform/ws/flow/definitions?username=jsmith
Accept: application/xml;


# Response
200 Successful
Content-Type: application/xml;
<pseudoFlowInstances total="2">
	<pseudoFlowInstance>
		<id>101</id>
		<user>jsmith</user>
		<name>flow1</name>
		<fullName>101:jsmith:flow1</fullName>
		<state>Done</state>
		<status>0</status>
		<workDirectory>/home/jsmith</workDirectory>
		< lastUpdateTime>2018-08-14 14:11:15 GMT+08:00</ lastUpdateTime>
		<startTime>2018-08-14 14:01:15 GMT+08:00</startTime>
		<endTime>2018-08-14 14:11:15 GMT+08:00</endTime>
	</pseudoFlowInstance>
	<pseudoFlowInstance>
		<id>102</id>
		<user>jsmith</user>
		<name>flow1</name>
		<fullName>102:jsmith:flow1</fullName>
		<state>Running</state>
		<status>0</status>
		<workDirectory>/home/jsmith</workDirectory>
		< lastUpdateTime>2018-08-14 14:13:15 GMT+08:00</ lastUpdateTime>
		<startTime>2018-08-14 14:13:15 GMT+08:00</startTime>
		<endTime></endTime>
	</pseudoFlowInstance>
</pseudoFlowInstances>