Migrate PackageAPI endpoints from @EndPoint/@Command to JAX-RS#4178
Open
epugh wants to merge 9 commits intoapache:mainfrom
Open
Migrate PackageAPI endpoints from @EndPoint/@Command to JAX-RS#4178epugh wants to merge 9 commits intoapache:mainfrom
epugh wants to merge 9 commits intoapache:mainfrom
Conversation
- Replace PackagePayload.AddVersion with AddPackageVersionRequestBody
- Move package name from body to URL: POST /cluster/package/{name}/versions
- Replace delete command pattern with DELETE /cluster/package/{name}/versions/{version}
- Replace refresh command with POST /cluster/package/{name}/refresh
- Update errPath in testAPI from /details[0]/errorMessages[0] to /msg
- Remove all add.pkg assignments (pkg now lives in URL path)
- Replace add.pkg references in verifyComponent() with literal package name strings
- Update import: remove PackagePayload, add AddPackageVersionRequestBody (sorted)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: epugh <22395+epugh@users.noreply.github.com>
…sponse.error field Co-authored-by: epugh <22395+epugh@users.noreply.github.com>
Co-authored-by: epugh <22395+epugh@users.noreply.github.com>
Co-authored-by: epugh <22395+epugh@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrates
org.apache.solr.pkg.PackageAPIfrom Solr's homegrown@EndPoint/@Commanddispatch to standard JAX-RS annotations, consistent with other V2 APIs (ClusterFileStore,ZookeeperRead,ClusterProperty).This has a pretty hefty update to the patterns, but I thought it was better to do it now while v2 api's are "experimental".
New REST endpoints
The command-based POST pattern is replaced with RESTful routes:
POST /cluster/package {"add": {"package":"p","version":"v","files":[...]}}POST /cluster/package/{name}/versionsPOST /cluster/package {"delete": {"pkg":"p","version":"v"}}DELETE /cluster/package/{name}/versions/{version}POST /cluster/package {"refresh": "name"}POST /cluster/package/{name}/refreshGET /cluster/packageGET /cluster/package/{name}Key structural changes
PackageAPI— new JAX-RS implementation (extends JerseyResource implements PackageApis); replaces the oldEdit/Readinner classes (~220 lines removed)PackageStore— renamed from the oldPackageAPI; now clearly a ZK data/state holder (Packages,PkgVersion, ZK watcher), not an endpoint class. THIS WAS A BIG REFACTORINGsolr/apimodule — newPackageApis.java(JAX-RS interface),PackagesResponse.java,AddPackageVersionRequestBody.java; OAS generation producesPackageApiSolrJ request classes automaticallyPackageAPITest— integration test usingSolrCloudTestCase(ZK required) with generatedPackageApiSolrJ request classesTestPackages— updated to use new endpoints; error path changed from/details[0]/errorMessages[0]to/msgpackage-manager-internals.adoc— updated endpoint reference and curl examples