SOLR-12224: Add APIs to read collection properties #4071
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.
https://issues.apache.org/jira/browse/SOLR-12224
Description
Solr allows users to create collectionproperties with its
/admin/collections?action=COLLECTIONPROPAPI, but doesn't offer any API-based way to read these properties. Users are forced to use SolrJ's ZkStateReader to lookup the collection-properties, or connect to Zookeeper in some other way to read them.Solution
This PR introduces two new v2 endpoints that give users an API-centric way of reading these properties:
GET /api/collections/someCollName/propertiesto list all properties of a collection, andGET /api/collections/someCollName/properties/somePropNameto fetch specific properties by name.These new v2 APIs are implemented via JAX-RS, and appear in Solr's OpenAPI, meaning that they're now included in our SolrJ generation. SolrJ users can call these APIs with the SolrRequest classes
CollectionPropertiesApi.ListCollectionPropertiesandCollectionPropertiesApi.GetCollectionProperty.Tests
Added coverage for new "read" APIs in CollectionsAPISolrJTest, using the generated SolrRequest classes.
Checklist
Please review the following and check all that apply:
mainbranch../gradlew check.