Class OperationHandlers

Class Documentation

class OperationHandlers

Handlers for operation-related REST API endpoints (services and actions).

Handlers:

  • GET /{entity}/operations - List all operations (7.14.3)

  • GET /{entity}/operations/{op-id} - Get operation details (7.14.4)

  • GET /{entity}/operations/{op-id}/executions - List executions (7.14.5)

  • POST /{entity}/operations/{op-id}/executions - Start execution (7.14.6)

  • GET /{entity}/operations/{op-id}/executions/{exec-id} - Get execution status (7.14.7)

  • PUT /{entity}/operations/{op-id}/executions/{exec-id} - Update execution (7.14.9)

  • DELETE /{entity}/operations/{op-id}/executions/{exec-id} - Terminate execution (7.14.8)

Public Functions

inline explicit OperationHandlers(HandlerContext &ctx)

Construct operation handlers with shared context.

Parameters:

ctx – The shared handler context

void handle_list_operations(const httplib::Request &req, httplib::Response &res)

Handle GET /components/{component_id}/operations - list all operations.

void handle_get_operation(const httplib::Request &req, httplib::Response &res)

Handle GET /{entity}/operations/{op-id} - get operation details.

void handle_create_execution(const httplib::Request &req, httplib::Response &res)

Handle POST /{entity}/operations/{op-id}/executions - execution start.

void handle_list_executions(const httplib::Request &req, httplib::Response &res)

Handle GET /{entity}/operations/{op-id}/executions - list executions.

void handle_get_execution(const httplib::Request &req, httplib::Response &res)

Handle GET /{entity}/operations/{op-id}/executions/{exec-id} - execution status.

void handle_cancel_execution(const httplib::Request &req, httplib::Response &res)

Handle DELETE /{entity}/operations/{op-id}/executions/{exec-id} - cancel execution.

void handle_update_execution(const httplib::Request &req, httplib::Response &res)

Handle PUT /{entity}/operations/{op-id}/executions/{exec-id} - update execution.

Executes the given capability on the provided operation execution. Supported capabilities for ROS 2 actions: stop (maps to cancel). Unsupported: execute (re-execute), freeze, reset (I/O control specific).