epugh commented on code in PR #4775: URL: https://github.com/apache/solr/pull/4775#discussion_r3826053297
########## solr/api/src/java/org/apache/solr/client/api/endpoint/NodePropertiesApi.java: ########## @@ -0,0 +1,38 @@ +/* + * 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 jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.QueryParam; +import org.apache.solr.client.api.model.NodePropertiesResponse; + +/** V2 API definition for listing JRE system properties on a Solr node. */ +@Path("/node/properties") +public interface NodePropertiesApi { + + @GET + @Operation( + summary = "List system properties for the target Solr node.", + tags = {"node"}) + NodePropertiesResponse getNodeProperties( + @Parameter(description = "Optional name of a single system property to return.") + @QueryParam("name") Review Comment: Should this be a query param or a path? /node/properties makes sense for listing. Should it be /node/properties/my.special.property ? Versus /node/properties?name=my.special.property? To be restful> ########## solr/api/src/java/org/apache/solr/client/api/model/NodePropertiesResponse.java: ########## @@ -0,0 +1,31 @@ +/* + * 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.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Map; + +/** Response body for the {@code GET /api/node/properties} endpoint. */ +public class NodePropertiesResponse extends SolrJerseyResponse { + + public static final String SYSTEM_PROPERTIES = "system.properties"; + + @Schema(description = "JRE system properties for the Solr node. Secret values are redacted.") + @JsonProperty(SYSTEM_PROPERTIES) + public Map<String, String> systemProperties; Review Comment: is it really as simple as a string/string? Great. ########## solr/core/src/test/org/apache/solr/handler/admin/api/V2NodeAPIMappingTest.java: ########## @@ -143,11 +125,6 @@ private SolrParams captureConvertedCoreV1Params(String path, String method, Stri path, method, new ModifiableSolrParams(), v2RequestBody, mockCoresHandler); } - private SolrParams captureConvertedPropertiesV1Params( Review Comment: nice! ########## solr/core/src/java/org/apache/solr/handler/admin/PropertiesRequestHandler.java: ########## @@ -16,24 +16,27 @@ */ package org.apache.solr.handler.admin; +import static org.apache.solr.client.api.model.NodePropertiesResponse.SYSTEM_PROPERTIES; import static org.apache.solr.common.params.CommonParams.NAME; -import java.io.IOException; import java.util.Collection; -import java.util.Enumeration; -import org.apache.solr.api.AnnotatedApi; +import java.util.List; +import java.util.Map; import org.apache.solr.api.Api; +import org.apache.solr.api.JerseyResource; import org.apache.solr.common.util.NamedList; import org.apache.solr.common.util.SimpleOrderedMap; import org.apache.solr.core.CoreContainer; -import org.apache.solr.core.NodeConfig; import org.apache.solr.handler.RequestHandlerBase; -import org.apache.solr.handler.admin.api.NodePropertiesAPI; +import org.apache.solr.handler.admin.api.GetNodeProperties; import org.apache.solr.request.SolrQueryRequest; import org.apache.solr.response.SolrQueryResponse; import org.apache.solr.security.AuthorizationContext; /** + * v1 implementation of {@code GET /admin/info/properties}. Business logic lives in {@link Review Comment: great! -- 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]
