You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ab...@apache.org on 2019/01/23 13:12:00 UTC
[lucene-solr] 01/02: SOLR-9735: Fix v2 API for
AutoscalingHistoryHandler.
This is an automated email from the ASF dual-hosted git repository.
ab pushed a commit to branch branch_7x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
commit 6a4ef4ea3dc67a21508f9b001d088e61e188a407
Author: Andrzej Bialecki <ab...@apache.org>
AuthorDate: Thu Oct 26 12:14:30 2017 +0200
SOLR-9735: Fix v2 API for AutoscalingHistoryHandler.
---
.../handler/admin/AutoscalingHistoryHandler.java | 13 +++++
.../src/resources/apispec/autoscaling.history.json | 61 ++++++++++++++++++++++
2 files changed, 74 insertions(+)
diff --git a/solr/core/src/java/org/apache/solr/handler/admin/AutoscalingHistoryHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/AutoscalingHistoryHandler.java
index b494011..0af348f 100644
--- a/solr/core/src/java/org/apache/solr/handler/admin/AutoscalingHistoryHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/admin/AutoscalingHistoryHandler.java
@@ -18,11 +18,14 @@ package org.apache.solr.handler.admin;
import java.lang.invoke.MethodHandles;
import java.util.Collections;
+import java.util.Collection;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Optional;
+import org.apache.solr.api.Api;
+import org.apache.solr.api.ApiBag;
import org.apache.solr.client.solrj.impl.CloudSolrClient;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.cloud.autoscaling.SystemLogListener;
@@ -149,4 +152,14 @@ public class AutoscalingHistoryHandler extends RequestHandlerBase implements Per
return Category.ADMIN;
}
+ @Override
+ public Boolean registerV2() {
+ return Boolean.TRUE;
+ }
+
+ @Override
+ public Collection<Api> getApis() {
+ return ApiBag.wrapRequestHandlers(this, "autoscaling.history");
+ }
+
}
diff --git a/solr/solrj/src/resources/apispec/autoscaling.history.json b/solr/solrj/src/resources/apispec/autoscaling.history.json
new file mode 100644
index 0000000..dadd6cb
--- /dev/null
+++ b/solr/solrj/src/resources/apispec/autoscaling.history.json
@@ -0,0 +1,61 @@
+{
+ "documentation": "https://lucene.apache.org/solr/guide/solrcloud-autoscaling-api.html",
+ "description": "Autoscaling history handler allows retrieving past autoscaling events recorded in the .system collection.",
+ "methods": [
+ "GET"
+ ],
+ "url": {
+ "paths": [
+ "/cluster/autoscaling/history"
+ ],
+ "params": {
+ "collection": {
+ "type": "string",
+ "description": "Collection where autoscaling events are stored, '.system' by default.",
+ "default": ".system"
+ },
+ "q": {
+ "type": "string",
+ "description": "Arbitrary query to limit the selected events.",
+ "default": "*:*"
+ },
+ "sort": {
+ "type": "string",
+ "description": "Sorting criteria for returned events.",
+ "default": "id asc"
+ },
+ "action": {
+ "type": "string",
+ "description": "Trigger action name to select"
+ },
+ "message": {
+ "type": "string",
+ "description": "Event message to select"
+ },
+ "trigger": {
+ "type": "string",
+ "description": "Trigger name to select"
+ },
+ "type": {
+ "type": "string",
+ "description": "Event type to select"
+ },
+ "node": {
+ "type": "string",
+ "description": "Node name to select"
+ },
+ "stage": {
+ "type": "string",
+ "description": "Processing stage to select"
+ },
+ "beforeAction": {
+ "type": "string",
+ "description": "Action name to select events before the action was executed"
+ },
+ "afterAction": {
+ "type": "string",
+ "description": "Action name to select events after the action was executed"
+ }
+ }
+ }
+}