@Inject public RestGetIndexTemplateAction(Settings settings, RestController controller) { super(settings); controller.registerHandler(GET, "/_template", this); controller.registerHandler(GET, "/_template/{name}", this); }
public void testThatRelevantHttpHeadersBecomeRequestHeaders() throws Exception { String relevantHeaderName = "relevant_" + randomHeaderKey; for (RestController restController : internalCluster().getInstances(RestController.class)) { restController.registerRelevantHeaders(relevantHeaderName); } try (Response response = getRestClient() .performRequest( "GET", "/" + queryIndex + "/_search", Collections.emptyMap(), null, new BasicHeader(randomHeaderKey, randomHeaderValue), new BasicHeader(relevantHeaderName, randomHeaderValue))) { assertThat(response.getStatusLine().getStatusCode(), equalTo(200)); List<RequestAndHeaders> searchRequests = getRequests(SearchRequest.class); assertThat(searchRequests, hasSize(greaterThan(0))); for (RequestAndHeaders requestAndHeaders : searchRequests) { assertThat(requestAndHeaders.headers.containsKey(relevantHeaderName), is(true)); // was not specified, thus is not included assertThat(requestAndHeaders.headers.containsKey(randomHeaderKey), is(false)); } } }
@Inject public RestGetAliasesAction(Settings settings, Client client, RestController controller) { super(settings, client); controller.registerHandler(GET, "/_alias/", this); controller.registerHandler(GET, "/_alias/{name}", this); controller.registerHandler(GET, "/{index}/_alias/{name}", this); controller.registerHandler(GET, "/{index}/_alias", this); }
protected RestPutStoredScriptAction( Settings settings, RestController controller, boolean registerDefaultHandlers) { super(settings); if (registerDefaultHandlers) { controller.registerHandler(POST, "/_scripts/{lang}/{id}", this); controller.registerHandler(PUT, "/_scripts/{lang}/{id}", this); } }
@Inject public RestMainAction( Settings settings, Version version, Client client, RestController controller) { super(settings, client); this.version = version; controller.registerHandler(GET, "/", this); controller.registerHandler(HEAD, "/", this); }
@Inject public RestAnalyzeAction(Settings settings, Client client, RestController controller) { super(settings, client); controller.registerHandler(GET, "/_analyze", this); controller.registerHandler(GET, "/{index}/_analyze", this); controller.registerHandler(POST, "/_analyze", this); controller.registerHandler(POST, "/{index}/_analyze", this); }
@Inject public RestIndicesStatsAction(Settings settings, RestController controller, Client client) { super(settings, controller, client); controller.registerHandler(GET, "/_stats", this); controller.registerHandler(GET, "/_stats/{metric}", this); controller.registerHandler(GET, "/_stats/{metric}/{indexMetric}", this); controller.registerHandler(GET, "/{index}/_stats", this); controller.registerHandler(GET, "/{index}/_stats/{metric}", this); }
@Inject public RestNodesInfoAction( Settings settings, Client client, RestController controller, SettingsFilter settingsFilter) { super(settings, client); controller.registerHandler(RestRequest.Method.GET, "/_cluster/nodes", this); controller.registerHandler(RestRequest.Method.GET, "/_cluster/nodes/{nodeId}", this); this.settingsFilter = settingsFilter; }
@Inject public RestGetSettingsAction( Settings settings, Client client, RestController controller, SettingsFilter settingsFilter) { super(settings, client); controller.registerHandler(GET, "/_settings", this); controller.registerHandler(GET, "/{index}/_settings", this); this.settingsFilter = settingsFilter; }
@Inject public RestDeleteByQueryAction( Settings settings, RestController controller, Client client, IndicesQueriesRegistry indicesQueriesRegistry) { super(settings, controller, client); this.indicesQueriesRegistry = indicesQueriesRegistry; controller.registerHandler(DELETE, "/{index}/_query", this); controller.registerHandler(DELETE, "/{index}/{type}/_query", this); }
@Inject public RestSuggestAction( Settings settings, RestController controller, Client client, IndicesQueriesRegistry queryRegistry, Suggesters suggesters) { super(settings, client); this.queryRegistry = queryRegistry; this.suggesters = suggesters; controller.registerHandler(POST, "/_suggest", this); controller.registerHandler(GET, "/_suggest", this); controller.registerHandler(POST, "/{index}/_suggest", this); controller.registerHandler(GET, "/{index}/_suggest", this); }
@Inject protected RestJRStateAction(Settings settings, Client client, RestController controller) { super(settings, client); String baseUrl = baseRestMgmUrl(); controller.registerHandler( org.elasticsearch.rest.RestRequest.Method.GET, baseUrl + "state", this); }
@Inject public DropboxHelpAction(Settings settings, Client client, RestController controller) { super(settings, client); // Define Dropbox REST Endpoints controller.registerHandler(Method.GET, "/_dropbox/", this); }
@Inject public RestIndicesExistsAction( Settings settings, Client client, RestController controller, SettingsFilter settingsFilter) { super(settings, client); controller.registerHandler(HEAD, "/{index}", this); this.settingsFilter = settingsFilter; }
@Inject public RestGetIndexTemplateAction( Settings settings, Client client, RestController controller, SettingsFilter settingsFilter) { super(settings, client); this.settingsFilter = settingsFilter; controller.registerHandler(GET, "/_template/{name}", this); }
@Inject public RestIndexPutAliasAction(Settings settings, RestController controller) { super(settings); controller.registerHandler(PUT, "/{index}/_alias/{name}", this); controller.registerHandler(PUT, "/_alias/{name}", this); controller.registerHandler(PUT, "/{index}/_aliases/{name}", this); controller.registerHandler(PUT, "/_aliases/{name}", this); controller.registerHandler(PUT, "/{index}/_alias", this); controller.registerHandler(PUT, "/_alias", this); controller.registerHandler(POST, "/{index}/_alias/{name}", this); controller.registerHandler(POST, "/_alias/{name}", this); controller.registerHandler(POST, "/{index}/_aliases/{name}", this); controller.registerHandler(POST, "/_aliases/{name}", this); controller.registerHandler(PUT, "/{index}/_aliases", this); // we cannot add POST for "/_aliases" because this is the _aliases api already defined in // RestIndicesAliasesAction }
protected RestDeleteIndexedScriptAction( Settings settings, RestController controller, boolean registerDefaultHandlers, Client client) { super(settings, controller, client); if (registerDefaultHandlers) { controller.registerHandler(DELETE, "/_scripts/{lang}/{id}", this); } }
@Inject public RestNodesStatsAction(Settings settings, Client client, RestController controller) { super(settings, client); controller.registerHandler(GET, "/_nodes/stats", this); controller.registerHandler(GET, "/_nodes/{nodeId}/stats", this); controller.registerHandler(GET, "/_nodes/stats/{metric}", this); controller.registerHandler(GET, "/_nodes/{nodeId}/stats/{metric}", this); controller.registerHandler(GET, "/_nodes/stats/{metric}/{indexMetric}", this); controller.registerHandler(GET, "/_nodes/stats/{metric}/{indexMetric}/{fields}", this); controller.registerHandler(GET, "/_nodes/{nodeId}/stats/{metric}/{indexMetric}", this); controller.registerHandler(GET, "/_nodes/{nodeId}/stats/{metric}/{indexMetric}/{fields}", this); }
@Inject public RestClusterSearchShardsAction( Settings settings, Client client, RestController controller) { super(settings, client); controller.registerHandler(GET, "/_search_shards", this); controller.registerHandler(POST, "/_search_shards", this); controller.registerHandler(GET, "/{index}/_search_shards", this); controller.registerHandler(POST, "/{index}/_search_shards", this); controller.registerHandler(GET, "/{index}/{type}/_search_shards", this); controller.registerHandler(POST, "/{index}/{type}/_search_shards", this); }
@Inject public RestMultiSearchAction(Settings settings, Client client, RestController controller) { super(settings, client); controller.registerHandler(GET, "/_msearch", this); controller.registerHandler(POST, "/_msearch", this); controller.registerHandler(GET, "/{index}/_msearch", this); controller.registerHandler(POST, "/{index}/_msearch", this); controller.registerHandler(GET, "/{index}/{type}/_msearch", this); controller.registerHandler(POST, "/{index}/{type}/_msearch", this); this.allowExplicitIndex = settings.getAsBoolean("rest.action.multi.allow_explicit_index", true); }
@Inject public RestPercolateAction(Settings settings, RestController controller) { super(settings); controller.registerHandler(GET, "/{index}/{type}/_percolate", this); controller.registerHandler(POST, "/{index}/{type}/_percolate", this); RestPercolateExistingDocHandler existingDocHandler = new RestPercolateExistingDocHandler(settings); controller.registerHandler(GET, "/{index}/{type}/{id}/_percolate", existingDocHandler); controller.registerHandler(POST, "/{index}/{type}/{id}/_percolate", existingDocHandler); RestCountPercolateDocHandler countHandler = new RestCountPercolateDocHandler(settings); controller.registerHandler(GET, "/{index}/{type}/_percolate/count", countHandler); controller.registerHandler(POST, "/{index}/{type}/_percolate/count", countHandler); RestCountPercolateExistingDocHandler countExistingDocHandler = new RestCountPercolateExistingDocHandler(settings); controller.registerHandler( GET, "/{index}/{type}/{id}/_percolate/count", countExistingDocHandler); controller.registerHandler( POST, "/{index}/{type}/{id}/_percolate/count", countExistingDocHandler); }
@Inject public RestDeleteAction(Settings settings, RestController controller) { super(settings); controller.registerHandler(DELETE, "/{index}/{type}/{id}", this); }
@Inject public RestNodesAction(Settings settings, RestController controller, Client client) { super(settings, controller, client); controller.registerHandler(GET, "/_cat/nodes", this); }
@Inject public RestThreadPoolAction(Settings settings, RestController controller) { super(settings); controller.registerHandler(GET, "/_cat/thread_pool", this); controller.registerHandler(GET, "/_cat/thread_pool/{thread_pool_patterns}", this); }
@Inject public RestMasterAction(Settings settings, Client client, RestController controller) { super(settings, client); controller.registerHandler(GET, "/_cat/master", this); }
@Inject public RestUpdateAction(Settings settings, Client client, RestController controller) { super(settings, client); controller.registerHandler(POST, "/{index}/{type}/{id}/_update", this); }
@Inject public RestIndicesAliasesAction(Settings settings, Client client, RestController controller) { super(settings, client); controller.registerHandler(POST, "/_aliases", this); }
@Inject public RestPutWarmerAction(Settings settings, Client client, RestController controller) { super(settings, client); controller.registerHandler(PUT, "/{index}/_warmer/{name}", this); controller.registerHandler(PUT, "/{index}/{type}/_warmer/{name}", this); }
@Inject public RestExplainAction(Settings settings, Client client, RestController controller) { super(settings, client); controller.registerHandler(GET, "/{index}/{type}/{id}/_explain", this); }
@Inject public TestResponseHeaderRestAction(Settings settings, RestController controller, Client client) { super(settings, controller, client); controller.registerHandler(RestRequest.Method.GET, "/_protected", this); }