SOLR-9735: Fix v2 API for AutoscalingHistoryHandler.

This commit is contained in:
Andrzej Bialecki 2017-10-26 12:14:30 +02:00
parent 4674d26408
commit 99f5760142
2 changed files with 74 additions and 0 deletions

View File

@ -17,10 +17,13 @@
package org.apache.solr.handler.admin;
import java.lang.invoke.MethodHandles;
import java.util.Collection;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
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;
@ -146,4 +149,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");
}
}

View File

@ -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"
}
}
}
}