gerlowskija commented on code in PR #4264:
URL: https://github.com/apache/solr/pull/4264#discussion_r3125081423


##########
solr/api/src/java/org/apache/solr/client/api/endpoint/ConfigsetsApi.java:
##########
@@ -95,54 +91,63 @@ interface Download {
           @Extension(properties = {@ExtensionProperty(name = 
RAW_OUTPUT_PROPERTY, value = "true")})
         })
     @Produces("application/zip")
-    Response downloadConfigSet(
-        @PathParam("configSetName") String configSetName,
-        @QueryParam("displayName") String displayName)
-        throws Exception;
+    Response downloadConfigSet(@PathParam("configSetName") String 
configSetName) throws Exception;
   }
 
   /**
    * V2 API definition for reading a single file from an existing configset.
    *
-   * <p>Equivalent to GET /api/configsets/{configSetName}/file?path=...
+   * <p>Returns the raw bytes of the file, suitable for both text and binary 
files.
+   *
+   * <p>Equivalent to GET /api/configsets/{configSetName}/files/{filePath}
    */
   @Path("/configsets/{configSetName}")
   interface GetFile {
     @GET
-    @Path("/file")
-    @Produces(MediaType.TEXT_PLAIN)
+    @Path("/files/{filePath:.+}")
+    @Produces(MediaType.APPLICATION_OCTET_STREAM)
     @Operation(
-        summary = "Get the contents of a file in a configset.",
-        tags = {"configsets"})
-    ConfigSetFileContentsResponse getConfigSetFile(
-        @PathParam("configSetName") String configSetName, @QueryParam("path") 
String filePath)
+        summary = "Get the raw contents of a file in a configset.",
+        tags = {"configsets"},
+        extensions = {
+          @Extension(properties = {@ExtensionProperty(name = 
RAW_OUTPUT_PROPERTY, value = "true")})
+        })
+    StreamingOutput getConfigSetFile(
+        @PathParam("configSetName") String configSetName, 
@PathParam("filePath") String filePath)
         throws Exception;
   }
 
   /**
-   * V2 API definitions for uploading a configset, in whole or part.
+   * V2 API definition for uploading an entire configset as a ZIP archive.
    *
    * <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")
+    @Operation(summary = "Upload a configset as a ZIP archive.", tags = 
"configsets")
     SolrJerseyResponse uploadConfigSet(
         @PathParam("configSetName") String configSetName,
         @QueryParam("overwrite") Boolean overwrite,
         @QueryParam("cleanup") Boolean cleanup,
         @RequestBody(required = true) InputStream requestBody)
         throws IOException;
+  }
 
+  /**
+   * V2 API definition for putting a single file to an existing configset.
+   *
+   * <p>This endpoint allows updating individual configuration files without 
re-uploading the entire
+   * configset. The file path is specified as part of the URL path.
+   */
+  @Path("/configsets/{configSetName}")
+  interface PutFile {
     @PUT
     @Path("{filePath:.+}")
-    @Operation(summary = "Create a new configset.", tags = "configsets")
-    SolrJerseyResponse uploadConfigSetFile(
+    @Operation(summary = "Upload a single file to a configset.", tags = 
"configsets")
+    SolrJerseyResponse putConfigSetFile(
         @PathParam("configSetName") String configSetName,
         @PathParam("filePath") String filePath,
-        @QueryParam("overwrite") Boolean overwrite,

Review Comment:
   Awesome, much clearer, thanks epugh.
   
   At a glance the don't-overwrite behavior feels like something that folks 
wouldn't expect and would be unlikely to actually use.  Maybe a candidate for 
deprecation later on, but definitely not a thing for this PR...



-- 
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]

Reply via email to