-
Notifications
You must be signed in to change notification settings - Fork 2
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
Summary
Consolidate discovery handlers into a single unified DiscoveryHandlers class to reduce code duplication and improve maintainability.
Previously, we had 4 separate handler files (area_handlers, component_handlers, app_handlers, function_handlers) in handlers/discovery/ folder with ~1600 lines of code total. Many methods were duplicated across entity types (data, operations, configurations, faults endpoints).
Proposed solution
- Create unified DiscoveryHandlers class with entity-agnostic handlers for discovery operations:
- Areas: handle_list_areas, handle_get_area, handle_area_components, handle_get_subareas, handle_get_contains
- Components: handle_list_components, handle_get_component, handle_get_subcomponents, handle_get_hosts, handle_component_depends_on
- Apps: handle_list_apps, handle_get_app, handle_app_depends_on
- Functions: handle_list_functions, handle_get_function, handle_function_hosts
- Remove the handlers/discovery/ folder entirely (8 files removed)
- Update rest_server.hpp/cpp to use single discovery_handlers_ member instead of 4 separate handlers
Additional context
This follows the same pattern already established for resource handlers (DataHandlers, OperationHandlers, ConfigHandlers, FaultHandlers) which are entity-agnostic and work with any SOVD entity type.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request