API pipeline - RapturePlatform/Rapture GitHub Wiki

Pipeline API

The Pipeline Api is used to configure the Rapture System pipeline for running tasks within a cluster of Rapture Servers.

removeServerCategory

HttpPipelineApi pipelineApi = new HttpPipelineApi(loginApi);
void retVal = pipelineApi.removeServerCategory(category);
retVal = baseAPI.doPipeline_RemoveServerCategory(category);

Entitlement: /admin/main

Deletes a given category.

Function Parameters

Parameter Type Description
category String

Return value

Type Description
void

getServerCategories

HttpPipelineApi pipelineApi = new HttpPipelineApi(loginApi);
List<String> retVal = pipelineApi.getServerCategories();
retVal = baseAPI.doPipeline_GetServerCategories();

Entitlement: /admin/main

List server categories.

Function Parameters

This function takes no parameters.

Return value

Type Description
List

getBoundExchanges

HttpPipelineApi pipelineApi = new HttpPipelineApi(loginApi);
List<CategoryQueueBindings> retVal = pipelineApi.getBoundExchanges(category);
retVal = baseAPI.doPipeline_GetBoundExchanges(category);

Entitlement: /admin/main

Get bound exchanges for a category

Function Parameters

Parameter Type Description
category String

Return value

Type Description
List

deregisterPipelineExchange

HttpPipelineApi pipelineApi = new HttpPipelineApi(loginApi);
void retVal = pipelineApi.deregisterPipelineExchange(name);
retVal = baseAPI.doPipeline_DeregisterPipelineExchange(name);

Entitlement: /admin/main

Removes an exchange.

Function Parameters

Parameter Type Description
name String

Return value

Type Description
void

getExchanges

HttpPipelineApi pipelineApi = new HttpPipelineApi(loginApi);
List<String> retVal = pipelineApi.getExchanges();
retVal = baseAPI.doPipeline_GetExchanges();

Entitlement: /admin/main

Retrieves all registered exchanges.

Function Parameters

This function takes no parameters.

Return value

Type Description
List

getExchange

HttpPipelineApi pipelineApi = new HttpPipelineApi(loginApi);
RaptureExchange retVal = pipelineApi.getExchange(name);
retVal = baseAPI.doPipeline_GetExchange(name);

Entitlement: /admin/main

Retrieves an exchange object by name.

Function Parameters

Parameter Type Description
name String

Return value

Type Description
RaptureExchange
Types used in this function

RaptureExchange

*A RaptureExchange is the coordination point for a task based pipeline.

Clients put RapturePipelineTask instances onto an exchange, which then routes that task to a set of queues that are then consumed.

This class defines the config of an exchange *

Field Type
domain String
name String
exchangeType RaptureExchangeType
queueBindings List(RaptureExchangeQueue)

publishMessageToCategory

HttpPipelineApi pipelineApi = new HttpPipelineApi(loginApi);
void retVal = pipelineApi.publishMessageToCategory(task);
retVal = baseAPI.doPipeline_PublishMessageToCategory(task);

Entitlement: /admin/main

Publishes a message. This message will be published to the category specified in the RapturePipelineTask object. If no category is specified, an error is thrown. This type of message should be handled by only one of the servers belonging to this category; in other words, it is not a broadcast.

Function Parameters

Parameter Type Description
task RapturePipelineTask

Return value

Type Description
void
Types used in this function

RapturePipelineTask

Represents a task that has been submitted to the Rapture pipeline. Includes the task's status, type, and categories associated with it.

Field Type
status PipelineTaskStatus
taskType PipelineTaskType
priority int
categoryList List
taskId String
content String
contentType String
epoch Long

broadcastMessageToCategory

HttpPipelineApi pipelineApi = new HttpPipelineApi(loginApi);
void retVal = pipelineApi.broadcastMessageToCategory(task);
retVal = baseAPI.doPipeline_BroadcastMessageToCategory(task);

Entitlement: /admin/main

This message will be broadcasted to all servers belonging to the category specified in the RapturePipelineTaskobject. If no category is specified, an error is thrown.

Function Parameters

Parameter Type Description
task RapturePipelineTask

Return value

Type Description
void
Types used in this function

RapturePipelineTask

Represents a task that has been submitted to the Rapture pipeline. Includes the task's status, type, and categories associated with it.

Field Type
status PipelineTaskStatus
taskType PipelineTaskType
priority int
categoryList List
taskId String
content String
contentType String
epoch Long

broadcastMessageToAll

HttpPipelineApi pipelineApi = new HttpPipelineApi(loginApi);
void retVal = pipelineApi.broadcastMessageToAll(task);
retVal = baseAPI.doPipeline_BroadcastMessageToAll(task);

Entitlement: /admin/main

This message will be broadcasted to all servers connected to the pipeline system.

Function Parameters

Parameter Type Description
task RapturePipelineTask

Return value

Type Description
void
Types used in this function

RapturePipelineTask

Represents a task that has been submitted to the Rapture pipeline. Includes the task's status, type, and categories associated with it.

Field Type
status PipelineTaskStatus
taskType PipelineTaskType
priority int
categoryList List
taskId String
content String
contentType String
epoch Long

getStatus

HttpPipelineApi pipelineApi = new HttpPipelineApi(loginApi);
PipelineTaskStatus retVal = pipelineApi.getStatus(taskId);
retVal = baseAPI.doPipeline_GetStatus(taskId);

Entitlement: /admin/main

Gets the status for a published RapturePipelineTask.

Function Parameters

Parameter Type Description
taskId String

Return value

Type Description
PipelineTaskStatus
Types used in this function

PipelineTaskStatus

Contains details about the current tasks on a pipeline.

Field Type
currentState PipelineTaskState
taskId String
relatedTaskId String
creationTime Date
startExecutionTime Date
endExecutionTime Date
suspensionCount int
output List(String)

queryTasks

HttpPipelineApi pipelineApi = new HttpPipelineApi(loginApi);
List<RapturePipelineTask> retVal = pipelineApi.queryTasks(query);
retVal = baseAPI.doPipeline_QueryTasks(query);

Entitlement: /admin/main

Queries for pipeline statuses.

Function Parameters

Parameter Type Description
query String

Return value

Type Description
List

queryTasksOld

HttpPipelineApi pipelineApi = new HttpPipelineApi(loginApi);
List<RapturePipelineTask> retVal = pipelineApi.queryTasksOld(query);
retVal = baseAPI.doPipeline_QueryTasksOld(query);

Entitlement: /admin/main

Queries for pipeline statuses.

Function Parameters

Parameter Type Description
query TableQuery

Return value

Type Description
List
Types used in this function

TableQuery

Describes a query made against a table.

Field Type
fieldTests List(TableSelect)
fieldReturns List(String)
sortFields List(TableColumnSort)
skip int
limit int

getLatestTaskEpoch

HttpPipelineApi pipelineApi = new HttpPipelineApi(loginApi);
Long retVal = pipelineApi.getLatestTaskEpoch();
retVal = baseAPI.doPipeline_GetLatestTaskEpoch();

Entitlement: /admin/main

On the task information, get the latest epoch (the maximum message id).

Function Parameters

This function takes no parameters.

Return value

Type Description
Long

drainPipeline

HttpPipelineApi pipelineApi = new HttpPipelineApi(loginApi);
void retVal = pipelineApi.drainPipeline(exchange);
retVal = baseAPI.doPipeline_DrainPipeline(exchange);

Entitlement: /admin/main

Drain an exchange - remove all messages.

Function Parameters

Parameter Type Description
exchange String

Return value

Type Description
void

registerExchangeDomain

HttpPipelineApi pipelineApi = new HttpPipelineApi(loginApi);
void retVal = pipelineApi.registerExchangeDomain(domainURI, config);
retVal = baseAPI.doPipeline_RegisterExchangeDomain(domainURI, config);

Entitlement: /admin/main

Registers a new exchange domain.

Function Parameters

Parameter Type Description
domainURI String
config String

Return value

Type Description
void

deregisterExchangeDomain

HttpPipelineApi pipelineApi = new HttpPipelineApi(loginApi);
void retVal = pipelineApi.deregisterExchangeDomain(domainURI);
retVal = baseAPI.doPipeline_DeregisterExchangeDomain(domainURI);

Entitlement: /admin/main

Removes an exchange domain.

Function Parameters

Parameter Type Description
domainURI String

Return value

Type Description
void

getExchangeDomains

HttpPipelineApi pipelineApi = new HttpPipelineApi(loginApi);
List<String> retVal = pipelineApi.getExchangeDomains();
retVal = baseAPI.doPipeline_GetExchangeDomains();

Entitlement: /admin/main

Retrieves all registered exchange domains.

Function Parameters

This function takes no parameters.

Return value

Type Description
List

setupStandardCategory

HttpPipelineApi pipelineApi = new HttpPipelineApi(loginApi);
void retVal = pipelineApi.setupStandardCategory(category);
retVal = baseAPI.doPipeline_SetupStandardCategory(category);

Entitlement: /admin/main

Sets up the default queue-exchanges and bindings for a given category.

Function Parameters

Parameter Type Description
category String

Return value

Type Description
void

makeRPC

HttpPipelineApi pipelineApi = new HttpPipelineApi(loginApi);
Map<String,Object> retVal = pipelineApi.makeRPC(queueName, fnName, params, timeoutInSeconds);
retVal = baseAPI.doPipeline_MakeRPC(queueName, fnName, params, timeoutInSeconds);

Entitlement: /user/call

Make an RPC call using a pair of queues on the pipeline of the default exchange. I notice that the exchange is removed from the above call which seems to be a bit of a regression

Function Parameters

Parameter Type Description
queueName String
fnName String
params Map<String,Object>
timeoutInSeconds Long

Return value

Type Description
Map<String,Object>

createTopicExchange

HttpPipelineApi pipelineApi = new HttpPipelineApi(loginApi);
void retVal = pipelineApi.createTopicExchange(domain, exchange);
retVal = baseAPI.doPipeline_CreateTopicExchange(domain, exchange);

Entitlement: /admin/main

Create a topic exchange that can be used to pub/sub on

Function Parameters

Parameter Type Description
domain String
exchange String

Return value

Type Description
void

publishTopicMessage

HttpPipelineApi pipelineApi = new HttpPipelineApi(loginApi);
void retVal = pipelineApi.publishTopicMessage(domain, exchange, topic, message);
retVal = baseAPI.doPipeline_PublishTopicMessage(domain, exchange, topic, message);

Entitlement: /admin/main

Publish on topic exchange (Subscription has to go low level)

Function Parameters

Parameter Type Description
domain String
exchange String
topic String
message String

Return value

Type Description
void
⚠️ **GitHub.com Fallback** ⚠️