Skip to content

Implement GET /components endpoint to list all discovered components across all areas #15

@mfaferek93

Description

@mfaferek93

Feature request / General issue

Implement GET /components endpoint to list all discovered components across all areas in the ROS 2 Medkit Gateway.

Proposal

Add a REST API endpoint at GET /components that returns a comprehensive list of all discovered components in the system. The endpoint should retrieve components from the
entity cache and return them with metadata including:

  • Component ID (formatted as area__name)
  • Component name
  • Parent area
  • Namespace path
  • Topic count
  • Service count

Response format:

 [
    {
      "id": "powertrain__engine",
      "name": "engine",
      "area": "powertrain",
      "namespace": "/powertrain/engine",
      "topic_count": 3,
      "service_count": 1
    },
    ...
  ]

Motivation

This endpoint is essential for:

  1. System-wide visibility: Provides a single API call to discover all components in the robot system
  2. Remote diagnostics: Enables remote tools to quickly understand the complete system topology
  3. Foundation for component operations: Establishes the component listing capability needed before implementing component data read/write endpoints

Alternatives considered

N/A

Additional context

N/A

Acceptance Criteria:

  • curl http://localhost:8080/components returns array of components
  • Response includes all required fields (id, name, area, namespace)
  • colcon test passes all tests
  • README documents the endpoint with curl example

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions