epugh opened a new pull request, #4178:
URL: https://github.com/apache/solr/pull/4178
Migrates `org.apache.solr.pkg.PackageAPI` from Solr's homegrown
`@EndPoint`/`@Command` dispatch to standard JAX-RS annotations, consistent with
other V2 APIs (`ClusterFileStore`, `ZookeeperRead`, `ClusterProperty`).
## New REST endpoints
The command-based POST pattern is replaced with RESTful routes:
| Old | New |
|-----|-----|
| `POST /cluster/package {"add":
{"package":"p","version":"v","files":[...]}}` | `POST
/cluster/package/{name}/versions` |
| `POST /cluster/package {"delete": {"pkg":"p","version":"v"}}` | `DELETE
/cluster/package/{name}/versions/{version}` |
| `POST /cluster/package {"refresh": "name"}` | `POST
/cluster/package/{name}/refresh` |
| `GET /cluster/package` | unchanged |
| `GET /cluster/package/{name}` | unchanged |
## Key structural changes
- **`PackageAPI`** — new JAX-RS implementation (`extends JerseyResource
implements PackageApis`); replaces the old `Edit`/`Read` inner classes (~220
lines removed)
- **`PackageStore`** — renamed from the old `PackageAPI`; now clearly a ZK
data/state holder (`Packages`, `PkgVersion`, ZK watcher), not an endpoint class
- **`solr/api` module** — new `PackageApis.java` (JAX-RS interface),
`PackagesResponse.java`, `AddPackageVersionRequestBody.java`; OAS generation
produces `PackageApi` SolrJ request classes automatically
- **`PackageAPITest`** — integration test using `SolrCloudTestCase` (ZK
required) with generated `PackageApi` SolrJ request classes
- **`TestPackages`** — updated to use new endpoints; error path changed from
`/details[0]/errorMessages[0]` to `/msg`
- **`package-manager-internals.adoc`** — updated endpoint reference and curl
examples
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]