k8ssandra / management-api-for-apache-cassandra

RESTful / Secure Management Sidecar for Apache Cassandra
Apache License 2.0
72 stars 51 forks source link

Management API Resources Refactor #359

Open Miles-Garnsey opened 1 year ago

Miles-Garnsey commented 1 year ago

The resources in management API are a little unwieldy given we are moving to have 3 API versions.

Ideally, the following might be a nicer structure:

  1. models packages should exist under the API versions they relate to. Having a single models package might reduce duplication, but it doesn't allow the API to evolve as safely.
  2. Nothing should be shared between API versions.
  3. All Resources classes should sit under a package corresponding to the API version they relate to. V1 APIs are currently in the resources root package.
  4. The tests for resources are largely sitting under a root directory and do not mirror the structure of the production code. in one instance, tests for v0 and v1 endpoints are in the same class, which makes tracing test failures challenging without extensive knowledge of the codebase.

┆Issue is synchronized with this Jira Story by Unito ┆Issue Number: MAPI-26