API async - RapturePlatform/Rapture GitHub Wiki
The Async API works closely with the Pipeline API - it puts tasks onto the Pipeline for future execution. The most often used call is one where a Reflex script is scheduled for execution, using the asyncReflex* calls.
HttpAsyncApi asyncApi = new HttpAsyncApi(loginApi);
String retVal = asyncApi.asyncReflexScript(reflexScript, parameters);
retVal = baseAPI.doAsync_AsyncReflexScript(reflexScript, parameters);
Entitlement: /async/reflex
Run a passed script in an asynchronous manner. Tells Rapture to run the script as part of a predefined internal workflow, and returns workOrderURI that can be used in other calls to retrieve the status. The second parameter is the set of parameters that will be passed to the script upon execution.
Parameter | Type | Description |
---|---|---|
reflexScript | String | |
parameters | Map<String,String> |
Type | Description |
---|---|
String |
HttpAsyncApi asyncApi = new HttpAsyncApi(loginApi);
String retVal = asyncApi.asyncReflexReference(scriptURI, parameters);
retVal = baseAPI.doAsync_AsyncReflexReference(scriptURI, parameters);
Entitlement: /async/reflex
Run a script that has already been loaded onto Rapture in an asynchronous manner. The script is named through its uri. As with asyncReflexScript, the parameters passed in the last parameter to this function are passed to the script upon invocation, and the return value from this function is a workOrderURI that can be used to determine the ultimate status of this WorkOrder.
Parameter | Type | Description |
---|---|---|
scriptURI | String | |
parameters | Map<String,String> |
Type | Description |
---|---|
String |
HttpAsyncApi asyncApi = new HttpAsyncApi(loginApi);
WorkOrderStatus retVal = asyncApi.asyncStatus(taskId);
retVal = baseAPI.doAsync_AsyncStatus(taskId);
Entitlement: /admin/main
Retrieve the status of a given async task. Will return null if the task id is not known to the environment.
Parameter | Type | Description |
---|---|---|
taskId | String |
Type | Description |
---|---|
WorkOrderStatus |
The status of a work order.
Field | Type |
---|---|
workerIds | List |
status | WorkOrderExecutionState |
HttpAsyncApi asyncApi = new HttpAsyncApi(loginApi);
void retVal = asyncApi.setupDefaultWorkflows(force);
retVal = baseAPI.doAsync_SetupDefaultWorkflows(force);
Entitlement: /admin/async
Sets up workflows needed to run any of these scripts. Should be called by Rapture internally on init
Parameter | Type | Description |
---|---|---|
force | boolean |
Type | Description |
---|---|
void |