-
Notifications
You must be signed in to change notification settings - Fork 676
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SOLR-16396: Convert v2 configset APIs to JAX-RS (#2928)
Convert v2 configset APIs to JAX-RS. Naturally this adds the APIs to Solr's growing v2 OAS, and ensures the APIs are included in code-gen artifacts. Also makes slight tweaks to line APIs up with the more REST-ful design chosen for other v2 APIs. - 'clone' (i.e. 'create-from-existing') is now available at `POST /api/configsets {...}` - 'delete' is now available at `DELETE /api/configsets/csName` - 'list' is now available at `GET /api/configsets`
- Loading branch information
1 parent
d0897fc
commit b2d18ca
Showing
15 changed files
with
315 additions
and
312 deletions.
There are no files selected for viewing
This file contains 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
100 changes: 100 additions & 0 deletions
100
solr/api/src/java/org/apache/solr/client/api/endpoint/ConfigsetsApi.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.solr.client.api.endpoint; | ||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.parameters.RequestBody; | ||
import jakarta.ws.rs.DELETE; | ||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.POST; | ||
import jakarta.ws.rs.PUT; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.PathParam; | ||
import jakarta.ws.rs.QueryParam; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import org.apache.solr.client.api.model.CloneConfigsetRequestBody; | ||
import org.apache.solr.client.api.model.ListConfigsetsResponse; | ||
import org.apache.solr.client.api.model.SolrJerseyResponse; | ||
|
||
public interface ConfigsetsApi { | ||
|
||
/** V2 API definition for listing the configsets available to this SolrCloud cluster. */ | ||
@Path("/configsets") | ||
interface List { | ||
@GET | ||
@Operation( | ||
summary = "List the configsets available to Solr.", | ||
tags = {"configsets"}) | ||
ListConfigsetsResponse listConfigSet() throws Exception; | ||
} | ||
|
||
/** | ||
* V2 API definition for creating a (possibly slightly modified) copy of an existing configset | ||
* | ||
* <p>Equivalent to the existing v1 API /admin/configs?action=CREATE | ||
*/ | ||
@Path("/configsets") | ||
interface Clone { | ||
@POST | ||
@Operation( | ||
summary = "Create a new configset modeled on an existing one.", | ||
tags = {"configsets"}) | ||
SolrJerseyResponse cloneExistingConfigSet(CloneConfigsetRequestBody requestBody) | ||
throws Exception; | ||
} | ||
|
||
/** | ||
* V2 API definition for deleting an existing configset. | ||
* | ||
* <p>Equivalent to the existing v1 API /admin/configs?action=DELETE | ||
*/ | ||
@Path("/configsets/{configSetName}") | ||
interface Delete { | ||
@DELETE | ||
@Operation(summary = "Delete an existing configset.", tags = "configsets") | ||
SolrJerseyResponse deleteConfigSet(@PathParam("configSetName") String configSetName) | ||
throws Exception; | ||
} | ||
|
||
/** | ||
* V2 API definitions for uploading a configset, in whole or part. | ||
* | ||
* <p>Equivalent to the existing v1 API /admin/configs?action=UPLOAD | ||
*/ | ||
@Path("/configsets/{configSetName}") | ||
interface Upload { | ||
@PUT | ||
@Operation(summary = "Create a new configset.", tags = "configsets") | ||
SolrJerseyResponse uploadConfigSet( | ||
@PathParam("configSetName") String configSetName, | ||
@QueryParam("overwrite") Boolean overwrite, | ||
@QueryParam("cleanup") Boolean cleanup, | ||
@RequestBody(required = true) InputStream requestBody) | ||
throws IOException; | ||
|
||
@PUT | ||
@Path("{filePath:.+}") | ||
SolrJerseyResponse uploadConfigSetFile( | ||
@PathParam("configSetName") String configSetName, | ||
@PathParam("filePath") String filePath, | ||
@QueryParam("overwrite") Boolean overwrite, | ||
@QueryParam("cleanup") Boolean cleanup, | ||
@RequestBody(required = true) InputStream requestBody) | ||
throws IOException; | ||
} | ||
} |
32 changes: 0 additions & 32 deletions
32
solr/api/src/java/org/apache/solr/client/api/endpoint/ListConfigsetsApi.java
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
Oops, something went wrong.