gerlowskija commented on code in PR #2144: URL: https://github.com/apache/solr/pull/2144#discussion_r1450959834
########## solr/api/src/java/org/apache/solr/client/api/endpoint/RequestCoreCommandStatusApi.java: ########## @@ -0,0 +1,51 @@ +/* + * 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.Parameter; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import org.apache.solr.client.api.model.SolrJerseyResponse; + +/** + * V2 API for checking the status of a core-level asynchronous command. + * + * <p>This API (GET /api/cores/command-status/someId is analogous to the v1 + * /admin/cores?action=REQUESTSTATUS command. It is not to be confused with the more robust + * asynchronous command support offered under the v2 `/cluster/command-status` path (or the + * corresponding v1 path `/solr/admin/collections?action=REQUESTSTATUS`). Async support at the core + * level differs in that command IDs are local to individual Solr nodes and are not persisted across + * restarts. + * + * @see org.apache.solr.client.api.model.RequestCoreCommandStatusResponseBody + */ +@Path("/cores/command-status/") Review Comment: I'm not sure about "expected", but it's definitely odd haha. If we wanted, we could have it validate the core and throw a `SolrException(ErrorCode.NOT_FOUND, "...")` if the specified core doesn't exist? > Or maybe someone else can think up a third option that avoids the ambiguity while saving us from needing to provide a path-param that may not always make sense... Some v2 APIs start their path with "node" to indicate that the request is relevant only to the receiving node. Like `/api/node/health` (which reports the health of the receiving node) or `/api/node/key` (which returns the public encryption key of the receiving node). Maybe that's how we solve our path problem here - we could pick a path starting with `/api/node` instead of trying to squeeze it under `/cores` or elsewhere. It fits well conceptually IMO. The status of these commands is already node-specific, i.e. a "request-status" to 'NodeA' can only tell you about tasks run on 'NodeA'. So an API like `/api/nodes/commands/requestId` makes a lot of sense here IMO. And it goes well with the API we'll eventually have for tracking cluster-wide tasks/commands: `/api/cluster/commands/someRequestId` Wdyt? If you like the approach I can add the changes in here. Sorry for waffling on this so many times! -- 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