From 82ede903f64812053ed81ee2e42ed94101e6e091 Mon Sep 17 00:00:00 2001 From: Noble Paul Date: Thu, 16 May 2019 08:26:08 +1000 Subject: [PATCH] SOLR-13468: added ref-guide --- .../src/solrcloud-autoscaling-api.adoc | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/solr/solr-ref-guide/src/solrcloud-autoscaling-api.adoc b/solr/solr-ref-guide/src/solrcloud-autoscaling-api.adoc index d91ddc290c8..ba8a148049c 100644 --- a/solr/solr-ref-guide/src/solrcloud-autoscaling-api.adoc +++ b/solr/solr-ref-guide/src/solrcloud-autoscaling-api.adoc @@ -196,6 +196,93 @@ The API is available at `/admin/autoscaling/suggestions`. Here is an example out The suggested `operation` is an API call that can be invoked to remedy the current violation. +=== Inline config + +If there is no autoscaling is configured or if you wish to use a configuration other than the standard one, it is possible to send the autoscaling config json as an inline payload as follows + +[.dynamic-tabs] +-- +[example.tab-pane#v1getcomponent] +==== +[.tab-label]*V1 API* + +[source,bash] +---- +curl -X POST -H 'Content-type:application/json' -d '{ + "cluster-policy": [ + {"replica": 0, "port" : "7574"} + ] +}' http://localhost:8983/solr/admin/autoscaling/suggestions?omitHeader=true +---- +==== + +[example.tab-pane#v2getcomponent] +==== +[.tab-label]*V2 API* + +[source,bash] +---- +curl -X POST -H 'Content-type:application/json' -d '{ +"cluster-policy": [ + {"replica": 0, "port" : "7574"} + ] +}' http://localhost:8983/api/cluster/autoscaling/suggestions?omitHeader=true +---- +==== +-- + +*Output* +[source,json] +{ + "suggestions":[{ + "type":"violation", + "violation":{ + "collection":"mycoll", + "tagKey":7574, + "violation":{ + "replica":{ + "NRT":2, + "count":2}, + "delta":2.0}, + "clause":{ + "replica":0, + "port":"7574", + "collection":"mycoll"}}, + "operation":{ + "method":"POST", + "path":"/c/mycoll", + "command":{"move-replica":{ + "targetNode":"10.0.0.80:8983_solr", + "inPlaceMove":"true", + "replica":"core_node8"}}}}, + { + "type":"violation", + "violation":{ + "collection":"mycoll", + "tagKey":7574, + "violation":{ + "replica":{ + "NRT":2, + "count":2}, + "delta":2.0}, + "clause":{ + "replica":0, + "port":"7574", + "collection":"mycoll"}}, + "operation":{ + "method":"POST", + "path":"/c/mycoll", + "command":{"move-replica":{ + "targetNode":"10.0.0.80:8983_solr", + "inPlaceMove":"true", + "replica":"core_node5"}}}}], + "WARNING":"This response format is experimental. It is likely to change in the future."} + +---- + + + + == History API The history of autoscaling events is available at `/admin/autoscaling/history`. It returns information