-
Notifications
You must be signed in to change notification settings - Fork 808
SOLR-12224: Add APIs to read collection properties #4071
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SOLR-12224: Add APIs to read collection properties #4071
Conversation
API is available at: `GET /api/collections/collName/properties`
API available at: `GET /api/collections/collName/properties/propName`
epugh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a quick skim and it looks good. Also just a nice PR to read, and maybe model other adding of APIs on!
HoustonPutman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect PR. No notes
|
Might be good to have an API to update more than one value at once, but it doesn't have to be done here. |
|
Thanks all for the review! |
Prior to this PR Solr allowed users to write collection properties but never read them. This commit adds two new APIs to serve this need: the first for listing all properties (`GET /api/collections/someCollName/properties`) and the second for fetching a single property by name (`GET /api/collections/someCollName/properties/somePropName`). Corresponding SolrJ "SolrRequest" and "SolrResponse" classes are also generated based on the OAS definition for these new APIs.
Prior to this PR Solr allowed users to write collection properties but never read them. This commit adds two new APIs to serve this need: the first for listing all properties (`GET /api/collections/someCollName/properties`) and the second for fetching a single property by name (`GET /api/collections/someCollName/properties/somePropName`). Corresponding SolrJ "SolrRequest" and "SolrResponse" classes are also generated based on the OAS definition for these new APIs.
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.