Skip to content

route: route list requires --service-id; surface alternative or aggregate #42

@shreemaan-abhishek

Description

@shreemaan-abhishek

Surfaced in Run 2 GA smoke testing (docs/ga-test-report.md, R2-2). Filed for tracking; post-GA candidate unless we want to block on UX.

Problem

```
$ a7 route list -g default
Error: --service-id is required by API7 EE
```

API7 EE rejects `GET /apisix/admin/routes` without a `service_id` query param, which the a7 CLI surfaces verbatim. The user has no way to see all routes in a gateway group via the CLI without iterating services manually.

Options

  1. Auto-aggregate. The existing e2e helper `fetchRoutesForServices` in `pkg/cmd/config/configutil/configutil.go` iterates services and fetches routes per-service. Port the same approach into `a7 route list` so `-g ` without `--service-id` returns all routes in the group.
  2. Improve the error. Keep current behavior but rewrite the error to point at the workaround: "--service-id is required by API7 EE; pass --service-id or run `a7 service list` to discover services".
  3. Status quo. Document the requirement in the user guide and the route command help text; do nothing in code.

Lean: option 2 for GA (one-line code change), option 1 as a follow-up enhancement.

Tests

Whichever path is chosen, add an E2E:

  • option 1: `TestRoute_ListAcrossServices` creates two services + two routes, asserts `route list -g default` returns both.
  • option 2: `TestRoute_ListWithoutServiceID_ErrorMessage` asserts the error mentions `--service-id` and `service list`.

Part of #22.

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions