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


##########
solr/core/src/java/org/apache/solr/handler/admin/api/ReloadCoreAPI.java:
##########
@@ -17,52 +17,56 @@
 
 package org.apache.solr.handler.admin.api;
 
-import static org.apache.solr.client.solrj.SolrRequest.METHOD.POST;
-import static org.apache.solr.common.params.CommonParams.ACTION;
-import static org.apache.solr.handler.ClusterAPI.wrapParams;
+import static 
org.apache.solr.client.solrj.impl.BinaryResponseParser.BINARY_CONTENT_TYPE_V2;
 import static 
org.apache.solr.security.PermissionNameProvider.Name.CORE_EDIT_PERM;
 
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-import org.apache.solr.api.Command;
-import org.apache.solr.api.EndPoint;
-import org.apache.solr.api.PayloadObj;
-import org.apache.solr.common.params.CoreAdminParams;
-import org.apache.solr.common.util.ReflectMapWriter;
-import org.apache.solr.handler.admin.CoreAdminHandler;
+import io.swagger.v3.oas.annotations.Parameter;
+import javax.inject.Inject;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import org.apache.solr.api.JerseyResource;
+import org.apache.solr.core.CoreContainer;
+import org.apache.solr.jersey.PermissionName;
+import org.apache.solr.jersey.SolrJerseyResponse;
+import org.apache.solr.request.SolrQueryRequest;
+import org.apache.solr.response.SolrQueryResponse;
 
 /**
- * V2 API for reloading an individual core.
+ * V2 API for reloading collections.
  *
- * <p>The new API (POST /v2/cores/coreName {'reload': {...}}) is equivalent to 
the v1
- * /admin/cores?action=reload command.
- *
- * @see ReloadCorePayload
+ * <p>The new API (POST /v2/core/coreName/reload {...}) is analogous to the v1
+ * /admin/core?action=RELOAD command.
  */
-@EndPoint(
-    path = {"/cores/{core}"},
-    method = POST,
-    permission = CORE_EDIT_PERM)
-public class ReloadCoreAPI {
-  private static final String V2_RELOAD_CORE_CMD = "reload";
+@Path("/cores/{coreName}/reload")
+public class ReloadCoreAPI extends JerseyResource {
 
-  private final CoreAdminHandler coreHandler;
+  private final SolrQueryRequest solrQueryRequest;
+  private final SolrQueryResponse solrQueryResponse;
+  private final CoreContainer coreContainer;
 
-  public ReloadCoreAPI(CoreAdminHandler coreHandler) {
-    this.coreHandler = coreHandler;
+  @Inject
+  public ReloadCoreAPI(
+      SolrQueryRequest solrQueryRequest,
+      SolrQueryResponse solrQueryResponse,
+      CoreContainer coreContainer) {
+    this.solrQueryRequest = solrQueryRequest;
+    this.solrQueryResponse = solrQueryResponse;
+    this.coreContainer = coreContainer;
   }
 
-  @Command(name = V2_RELOAD_CORE_CMD)
-  public void reloadCore(PayloadObj<ReloadCorePayload> obj) throws Exception {
-    final String coreName = 
obj.getRequest().getPathTemplateValues().get(CoreAdminParams.CORE);
-
-    final Map<String, Object> v1Params = new HashMap<>();
-    v1Params.put(ACTION, 
CoreAdminParams.CoreAdminAction.RELOAD.name().toLowerCase(Locale.ROOT));
-    v1Params.put(CoreAdminParams.CORE, coreName);
-
-    coreHandler.handleRequestBody(wrapParams(obj.getRequest(), v1Params), 
obj.getResponse());
+  @POST
+  @Produces({"application/json", "application/xml", BINARY_CONTENT_TYPE_V2})
+  @PermissionName(CORE_EDIT_PERM)
+  public SolrJerseyResponse reloadCore(
+      @Parameter(description = "The name of the core to snapshot.", required = 
true)
+          @PathParam("coreName")
+          String coreName) {
+    SolrJerseyResponse solrJerseyResponse = 
instantiateJerseyResponse(ReloadCoreResponse.class);

Review Comment:
   [0] See my comment on L71 below about whether ReloadCoreResponse is really 
needed, or whether we can maybe use  `SolrJerseyResponse.class` as the method 
arg here.



##########
solr/solr-ref-guide/modules/configuration-guide/pages/coreadmin-api.adoc:
##########
@@ -318,11 +318,7 @@ 
http://localhost:8983/solr/admin/cores?action=RELOAD&core=techproducts
 
 [source,bash]
 ----
-curl -X POST http://localhost:8983/api/cores/techproducts -H 'Content-Type: 
application/json' -d '
-  {
-    "reload": {}
-  }
-'
+curl -X POST http://localhost:8983/api/cores/techproducts/reload -H 
'Content-Type: application/json'

Review Comment:
   [0] I'd have to check this to be certain, but we should be able to remove 
the `Content-type` header from this example, since this API ignores the request 
body.



##########
solr/core/src/test/org/apache/solr/handler/admin/api/ReloadCoreAPITest.java:
##########
@@ -0,0 +1,155 @@
+/*
+ * 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.handler.admin.api;
+
+import static org.apache.solr.SolrTestCaseJ4.assumeWorkingMockito;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.mock;
+
+import javax.inject.Singleton;
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.core.Application;
+import javax.ws.rs.core.Response;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.params.ModifiableSolrParams;
+import org.apache.solr.core.CoreContainer;
+import org.apache.solr.jersey.CatchAllExceptionMapper;
+import org.apache.solr.jersey.InjectionFactories;
+import org.apache.solr.jersey.NotFoundExceptionMapper;
+import org.apache.solr.jersey.SolrJacksonMapper;
+import org.apache.solr.request.SolrQueryRequest;
+import org.apache.solr.request.SolrQueryRequestBase;
+import org.apache.solr.response.SolrQueryResponse;
+import org.glassfish.hk2.api.Factory;
+import org.glassfish.hk2.utilities.binding.AbstractBinder;
+import org.glassfish.jersey.process.internal.RequestScoped;
+import org.glassfish.jersey.server.ResourceConfig;
+import org.glassfish.jersey.test.JerseyTest;
+import org.glassfish.jersey.test.TestProperties;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class ReloadCoreAPITest extends JerseyTest {
+  private CoreContainer mockCoreContainer;
+  private ReloadCoreAPI reloadCoreAPI;
+
+  private static final String NON_EXISTENT_CORE = "";
+  private static final String CORE_NAME = "demo";
+
+  @BeforeClass
+  public static void ensureWorkingMockito() {
+    assumeWorkingMockito();
+  }
+
+  @Override
+  public Application configure() {
+    forceSet(TestProperties.CONTAINER_PORT, "0");

Review Comment:
   [0] I love these tests, but the stubbing you've had to do here seems painful.
   
   I'd recommend we skip using JerseyTest here, and instead instantiate and 
call `ReloadCoreAPI` directly, like you've done in your [BACKUPCORE 
PR](https://github.com/apache/solr/pull/1740).



##########
solr/core/src/test/org/apache/solr/handler/admin/api/ReloadCoreAPITest.java:
##########
@@ -0,0 +1,155 @@
+/*
+ * 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.handler.admin.api;
+
+import static org.apache.solr.SolrTestCaseJ4.assumeWorkingMockito;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.mock;
+
+import javax.inject.Singleton;
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.core.Application;
+import javax.ws.rs.core.Response;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.params.ModifiableSolrParams;
+import org.apache.solr.core.CoreContainer;
+import org.apache.solr.jersey.CatchAllExceptionMapper;
+import org.apache.solr.jersey.InjectionFactories;
+import org.apache.solr.jersey.NotFoundExceptionMapper;
+import org.apache.solr.jersey.SolrJacksonMapper;
+import org.apache.solr.request.SolrQueryRequest;
+import org.apache.solr.request.SolrQueryRequestBase;
+import org.apache.solr.response.SolrQueryResponse;
+import org.glassfish.hk2.api.Factory;
+import org.glassfish.hk2.utilities.binding.AbstractBinder;
+import org.glassfish.jersey.process.internal.RequestScoped;
+import org.glassfish.jersey.server.ResourceConfig;
+import org.glassfish.jersey.test.JerseyTest;
+import org.glassfish.jersey.test.TestProperties;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class ReloadCoreAPITest extends JerseyTest {
+  private CoreContainer mockCoreContainer;
+  private ReloadCoreAPI reloadCoreAPI;
+
+  private static final String NON_EXISTENT_CORE = "";
+  private static final String CORE_NAME = "demo";
+
+  @BeforeClass
+  public static void ensureWorkingMockito() {
+    assumeWorkingMockito();
+  }
+
+  @Override
+  public Application configure() {
+    forceSet(TestProperties.CONTAINER_PORT, "0");
+    setUpMocks();
+    ResourceConfig config = new ResourceConfig();
+    config.register(ReloadCoreAPI.class);
+    config.register(CatchAllExceptionMapper.class);
+    config.register(SolrJacksonMapper.class);
+    config.register(NotFoundExceptionMapper.class);
+    config.register(
+        new AbstractBinder() {
+          @Override
+          protected void configure() {
+            bindFactory(new 
InjectionFactories.SingletonFactory<>(mockCoreContainer))
+                .to(CoreContainer.class)
+                .in(Singleton.class);
+          }
+        });
+    config.register(
+        new AbstractBinder() {
+          @Override
+          protected void configure() {
+            bindFactory(
+                    new Factory<SolrQueryRequest>() {
+                      @Override
+                      public SolrQueryRequest provide() {
+                        return new SolrQueryRequestBase(
+                            mockCoreContainer.getCore("demo"), new 
ModifiableSolrParams()) {};
+                      }
+
+                      @Override
+                      public void dispose(SolrQueryRequest instance) {}
+                    })
+                .to(SolrQueryRequest.class)
+                .in(RequestScoped.class);
+          }
+        });
+    config.register(
+        new AbstractBinder() {
+          @Override
+          protected void configure() {
+            bindFactory(
+                    new Factory<SolrQueryResponse>() {
+                      @Override
+                      public SolrQueryResponse provide() {
+                        return new SolrQueryResponse();
+                      }
+
+                      @Override
+                      public void dispose(SolrQueryResponse instance) {}
+                    })
+                .to(SolrQueryResponse.class)
+                .in(RequestScoped.class);
+          }
+        });
+    return config;
+  }
+
+  @Test
+  public void testValidReloadCoreAPIResponse() {
+    final Response response = 
target("/cores/demo/reload").request().post(Entity.json(""));
+    final String responseJsonStr = 
response.readEntity(String.class).toString();
+    assertEquals(200, response.getStatus());
+    assertEquals("{\"responseHeader\":{\"status\":0,\"QTime\":0}}", 
responseJsonStr);
+  }
+
+  @Test
+  public void testNonExistentCoreExceptionResponse() {
+    doThrow(
+            new SolrException(
+                SolrException.ErrorCode.BAD_REQUEST, "No such core: " + 
NON_EXISTENT_CORE))
+        .when(mockCoreContainer)
+        .reload("demo");
+    final Response response =
+        target("/cores/" + NON_EXISTENT_CORE + 
"/reload").request().post(Entity.json(""));
+    final String responseJsonStr = 
response.readEntity(String.class).toString();
+    assertEquals(400, response.getStatus());
+    assertTrue(responseJsonStr.contains("No such core"));
+  }

Review Comment:
   Yeah, that's going to be pretty tough to mock out.  I think our best bet 
here is to test this at a slightly lower level (i.e. by calling 
ReloadCoreAPI.reloadCore directly and verifying the exception that it throws.  
You've done similar stuff in other PRs, so I can use [your own code as an 
example](https://github.com/apache/solr/pull/1740/files#diff-ac75bc632270f1f0d082ebc4d82d4ffed7d162c2ec622aee7b38370fe960f2d2R86)
 😛 )



##########
solr/core/src/java/org/apache/solr/handler/admin/api/ReloadCoreAPI.java:
##########
@@ -17,52 +17,56 @@
 
 package org.apache.solr.handler.admin.api;
 
-import static org.apache.solr.client.solrj.SolrRequest.METHOD.POST;
-import static org.apache.solr.common.params.CommonParams.ACTION;
-import static org.apache.solr.handler.ClusterAPI.wrapParams;
+import static 
org.apache.solr.client.solrj.impl.BinaryResponseParser.BINARY_CONTENT_TYPE_V2;
 import static 
org.apache.solr.security.PermissionNameProvider.Name.CORE_EDIT_PERM;
 
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-import org.apache.solr.api.Command;
-import org.apache.solr.api.EndPoint;
-import org.apache.solr.api.PayloadObj;
-import org.apache.solr.common.params.CoreAdminParams;
-import org.apache.solr.common.util.ReflectMapWriter;
-import org.apache.solr.handler.admin.CoreAdminHandler;
+import io.swagger.v3.oas.annotations.Parameter;
+import javax.inject.Inject;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import org.apache.solr.api.JerseyResource;
+import org.apache.solr.core.CoreContainer;
+import org.apache.solr.jersey.PermissionName;
+import org.apache.solr.jersey.SolrJerseyResponse;
+import org.apache.solr.request.SolrQueryRequest;
+import org.apache.solr.response.SolrQueryResponse;
 
 /**
- * V2 API for reloading an individual core.
+ * V2 API for reloading collections.
  *
- * <p>The new API (POST /v2/cores/coreName {'reload': {...}}) is equivalent to 
the v1
- * /admin/cores?action=reload command.
- *
- * @see ReloadCorePayload
+ * <p>The new API (POST /v2/core/coreName/reload {...}) is analogous to the v1
+ * /admin/core?action=RELOAD command.
  */
-@EndPoint(
-    path = {"/cores/{core}"},
-    method = POST,
-    permission = CORE_EDIT_PERM)
-public class ReloadCoreAPI {
-  private static final String V2_RELOAD_CORE_CMD = "reload";
+@Path("/cores/{coreName}/reload")
+public class ReloadCoreAPI extends JerseyResource {
 
-  private final CoreAdminHandler coreHandler;
+  private final SolrQueryRequest solrQueryRequest;
+  private final SolrQueryResponse solrQueryResponse;
+  private final CoreContainer coreContainer;
 
-  public ReloadCoreAPI(CoreAdminHandler coreHandler) {
-    this.coreHandler = coreHandler;
+  @Inject
+  public ReloadCoreAPI(
+      SolrQueryRequest solrQueryRequest,
+      SolrQueryResponse solrQueryResponse,
+      CoreContainer coreContainer) {
+    this.solrQueryRequest = solrQueryRequest;
+    this.solrQueryResponse = solrQueryResponse;
+    this.coreContainer = coreContainer;
   }
 
-  @Command(name = V2_RELOAD_CORE_CMD)
-  public void reloadCore(PayloadObj<ReloadCorePayload> obj) throws Exception {
-    final String coreName = 
obj.getRequest().getPathTemplateValues().get(CoreAdminParams.CORE);
-
-    final Map<String, Object> v1Params = new HashMap<>();
-    v1Params.put(ACTION, 
CoreAdminParams.CoreAdminAction.RELOAD.name().toLowerCase(Locale.ROOT));
-    v1Params.put(CoreAdminParams.CORE, coreName);
-
-    coreHandler.handleRequestBody(wrapParams(obj.getRequest(), v1Params), 
obj.getResponse());
+  @POST
+  @Produces({"application/json", "application/xml", BINARY_CONTENT_TYPE_V2})
+  @PermissionName(CORE_EDIT_PERM)
+  public SolrJerseyResponse reloadCore(
+      @Parameter(description = "The name of the core to snapshot.", required = 
true)
+          @PathParam("coreName")
+          String coreName) {
+    SolrJerseyResponse solrJerseyResponse = 
instantiateJerseyResponse(ReloadCoreResponse.class);
+    coreContainer.reload(coreName);
+    return solrJerseyResponse;
   }
 
-  public static class ReloadCorePayload implements ReflectMapWriter {}
+  public static class ReloadCoreResponse extends SolrJerseyResponse {}

Review Comment:
   [-1] No need to create an empty Response class if this API doesn't return 
anything beyond what's in a normal `SolrJerseyResponse`; we can just have the 
method above return a SJR instance.



##########
solr/core/src/test/org/apache/solr/handler/admin/api/ReloadCoreAPITest.java:
##########
@@ -0,0 +1,155 @@
+/*
+ * 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.handler.admin.api;
+
+import static org.apache.solr.SolrTestCaseJ4.assumeWorkingMockito;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.mock;
+
+import javax.inject.Singleton;
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.core.Application;
+import javax.ws.rs.core.Response;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.params.ModifiableSolrParams;
+import org.apache.solr.core.CoreContainer;
+import org.apache.solr.jersey.CatchAllExceptionMapper;
+import org.apache.solr.jersey.InjectionFactories;
+import org.apache.solr.jersey.NotFoundExceptionMapper;
+import org.apache.solr.jersey.SolrJacksonMapper;
+import org.apache.solr.request.SolrQueryRequest;
+import org.apache.solr.request.SolrQueryRequestBase;
+import org.apache.solr.response.SolrQueryResponse;
+import org.glassfish.hk2.api.Factory;
+import org.glassfish.hk2.utilities.binding.AbstractBinder;
+import org.glassfish.jersey.process.internal.RequestScoped;
+import org.glassfish.jersey.server.ResourceConfig;
+import org.glassfish.jersey.test.JerseyTest;
+import org.glassfish.jersey.test.TestProperties;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class ReloadCoreAPITest extends JerseyTest {
+  private CoreContainer mockCoreContainer;
+  private ReloadCoreAPI reloadCoreAPI;
+
+  private static final String NON_EXISTENT_CORE = "";
+  private static final String CORE_NAME = "demo";
+
+  @BeforeClass
+  public static void ensureWorkingMockito() {
+    assumeWorkingMockito();
+  }
+
+  @Override
+  public Application configure() {
+    forceSet(TestProperties.CONTAINER_PORT, "0");
+    setUpMocks();
+    ResourceConfig config = new ResourceConfig();
+    config.register(ReloadCoreAPI.class);
+    config.register(CatchAllExceptionMapper.class);
+    config.register(SolrJacksonMapper.class);
+    config.register(NotFoundExceptionMapper.class);
+    config.register(
+        new AbstractBinder() {
+          @Override
+          protected void configure() {
+            bindFactory(new 
InjectionFactories.SingletonFactory<>(mockCoreContainer))
+                .to(CoreContainer.class)
+                .in(Singleton.class);
+          }
+        });
+    config.register(
+        new AbstractBinder() {
+          @Override
+          protected void configure() {
+            bindFactory(
+                    new Factory<SolrQueryRequest>() {
+                      @Override
+                      public SolrQueryRequest provide() {
+                        return new SolrQueryRequestBase(
+                            mockCoreContainer.getCore("demo"), new 
ModifiableSolrParams()) {};
+                      }
+
+                      @Override
+                      public void dispose(SolrQueryRequest instance) {}
+                    })
+                .to(SolrQueryRequest.class)
+                .in(RequestScoped.class);
+          }
+        });
+    config.register(
+        new AbstractBinder() {
+          @Override
+          protected void configure() {
+            bindFactory(
+                    new Factory<SolrQueryResponse>() {
+                      @Override
+                      public SolrQueryResponse provide() {
+                        return new SolrQueryResponse();
+                      }
+
+                      @Override
+                      public void dispose(SolrQueryResponse instance) {}
+                    })
+                .to(SolrQueryResponse.class)
+                .in(RequestScoped.class);
+          }
+        });
+    return config;
+  }
+
+  @Test
+  public void testValidReloadCoreAPIResponse() {
+    final Response response = 
target("/cores/demo/reload").request().post(Entity.json(""));
+    final String responseJsonStr = 
response.readEntity(String.class).toString();
+    assertEquals(200, response.getStatus());
+    assertEquals("{\"responseHeader\":{\"status\":0,\"QTime\":0}}", 
responseJsonStr);
+  }
+
+  @Test
+  public void testNonExistentCoreExceptionResponse() {
+    doThrow(
+            new SolrException(
+                SolrException.ErrorCode.BAD_REQUEST, "No such core: " + 
NON_EXISTENT_CORE))
+        .when(mockCoreContainer)
+        .reload("demo");
+    final Response response =
+        target("/cores/" + NON_EXISTENT_CORE + 
"/reload").request().post(Entity.json(""));
+    final String responseJsonStr = 
response.readEntity(String.class).toString();
+    assertEquals(400, response.getStatus());
+    assertTrue(responseJsonStr.contains("No such core"));
+  }

Review Comment:
   Yeah, that's going to be pretty tough to mock out.  I think our best bet 
here is to test this at a slightly lower level (i.e. by calling 
ReloadCoreAPI.reloadCore directly and verifying the exception that it throws.  
You've done similar stuff in other PRs, so I can use [your own code as an 
example](https://github.com/apache/solr/pull/1740/files#diff-ac75bc632270f1f0d082ebc4d82d4ffed7d162c2ec622aee7b38370fe960f2d2R86)
 😛 )



##########
solr/core/src/java/org/apache/solr/handler/admin/api/ReloadCoreAPI.java:
##########
@@ -17,52 +17,56 @@
 
 package org.apache.solr.handler.admin.api;
 
-import static org.apache.solr.client.solrj.SolrRequest.METHOD.POST;
-import static org.apache.solr.common.params.CommonParams.ACTION;
-import static org.apache.solr.handler.ClusterAPI.wrapParams;
+import static 
org.apache.solr.client.solrj.impl.BinaryResponseParser.BINARY_CONTENT_TYPE_V2;
 import static 
org.apache.solr.security.PermissionNameProvider.Name.CORE_EDIT_PERM;
 
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-import org.apache.solr.api.Command;
-import org.apache.solr.api.EndPoint;
-import org.apache.solr.api.PayloadObj;
-import org.apache.solr.common.params.CoreAdminParams;
-import org.apache.solr.common.util.ReflectMapWriter;
-import org.apache.solr.handler.admin.CoreAdminHandler;
+import io.swagger.v3.oas.annotations.Parameter;
+import javax.inject.Inject;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import org.apache.solr.api.JerseyResource;
+import org.apache.solr.core.CoreContainer;
+import org.apache.solr.jersey.PermissionName;
+import org.apache.solr.jersey.SolrJerseyResponse;
+import org.apache.solr.request.SolrQueryRequest;
+import org.apache.solr.response.SolrQueryResponse;
 
 /**
- * V2 API for reloading an individual core.
+ * V2 API for reloading collections.
  *
- * <p>The new API (POST /v2/cores/coreName {'reload': {...}}) is equivalent to 
the v1
- * /admin/cores?action=reload command.
- *
- * @see ReloadCorePayload
+ * <p>The new API (POST /v2/core/coreName/reload {...}) is analogous to the v1

Review Comment:
   [0] This comment needs updated to match the value in the `@Path` annotation 
below (i.e. `/v2/core` should be changed to `/v2/cores`)
   
   Also, we can probably delete the `{...}` bit, since this request doesn't 
actually take a request body.



-- 
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: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to