Skip to content

Consolidate discovery handlers into a single unified DiscoveryHandlers #142

@bburda

Description

@bburda

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

  1. 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
  1. Remove the handlers/discovery/ folder entirely (8 files removed)
  2. 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 request

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions