Class BulkDataHandlers
Defined in File bulkdata_handlers.hpp
Class Documentation
-
class BulkDataHandlers
HTTP handlers for SOVD bulk-data endpoints.
Provides handlers for listing bulk-data categories, descriptors, and downloading bulk-data files (rosbags) for any entity type.
Supports SOVD entity paths:
/apps/{id}/bulk-data[/{category}[/{id}]]
/components/{id}/bulk-data[/{category}[/{id}]]
/areas/{id}/bulk-data[/{category}[/{id}]]
/functions/{id}/bulk-data[/{category}[/{id}]]
Nested entities (subareas, subcomponents)
Public Functions
-
explicit BulkDataHandlers(HandlerContext &ctx)
Construct BulkDataHandlers.
- Parameters:
ctx – Handler context for sending responses and accessing FaultManager
-
void handle_list_categories(const httplib::Request &req, httplib::Response &res)
GET {entity-path}/bulk-data - List bulk-data categories.
Returns available bulk-data categories for an entity. Currently only “rosbags” category is supported.
- Parameters:
req – HTTP request
res – HTTP response
-
void handle_list_descriptors(const httplib::Request &req, httplib::Response &res)
GET {entity-path}/bulk-data/{category} - List bulk-data descriptors.
Returns BulkDataDescriptor array for the specified category. For “rosbags” category, returns descriptors for all rosbags associated with faults from this entity.
- Parameters:
req – HTTP request
res – HTTP response
-
void handle_download(const httplib::Request &req, httplib::Response &res)
GET {entity-path}/bulk-data/{category}/{id} - Download bulk-data file.
Downloads the bulk-data file (rosbag) identified by the ID. Validates that the rosbag belongs to the specified entity.
- Parameters:
req – HTTP request
res – HTTP response
-
void handle_upload(const httplib::Request &req, httplib::Response &res)
POST {entity-path}/bulk-data/{category} - Upload bulk-data file.
Accepts multipart/form-data with:
”file” (required): the file to upload
”description” (optional): text description
”metadata” (optional): JSON string with additional metadata
Returns 201 with ItemDescriptor JSON on success.
- Parameters:
req – HTTP request
res – HTTP response
-
void handle_delete(const httplib::Request &req, httplib::Response &res)
DELETE {entity-path}/bulk-data/{category}/{id} - Delete bulk-data file.
Removes an uploaded bulk-data item. Returns 204 on success, 404 if not found. Only items uploaded via POST can be deleted (rosbags managed by fault system cannot).
- Parameters:
req – HTTP request
res – HTTP response
Public Static Functions
-
static std::string get_rosbag_mimetype(const std::string &format)
Get MIME type for rosbag format.
- Parameters:
format – Storage format (“mcap”, “sqlite3”, “db3”)
- Returns:
MIME type string