forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into auto-follow-license
* master: (30 commits) Include fallback settings when checking dependencies (elastic#33522) [DOCS] Fixing formatting issues in breaking changes CRUD: Disable wait for refresh tests with delete Test: Fix test name (elastic#33510) HLRC: split ingest request converters (elastic#33435) Logging: Configure the node name when we have it (elastic#32983) HLRC: split xpack request converters (elastic#33444) HLRC: split watcher request converters (elastic#33442) HLRC: add enable and disable user API support (elastic#33481) [DOCS] Fixes formatting error TEST: Ensure merge triggered in _source retention test (elastic#33487) [ML] Add a file structure determination endpoint (elastic#33471) HLRC: ML Forecast Job (elastic#33506) HLRC: split migration request converters (elastic#33436) HLRC: split snapshot request converters (elastic#33439) Make Watcher validation message copy/pasteable Removes redundant test method in SQL tests (elastic#33498) HLRC: ML Post Data (elastic#33443) Pass Directory instead of DirectoryService to Store (elastic#33466) Collapse package structure for metrics aggs (elastic#33463) ...
- Loading branch information
Showing
415 changed files
with
5,472 additions
and
3,240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
client/rest-high-level/src/main/java/org/elasticsearch/client/GraphRequestConverters.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Licensed to Elasticsearch under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch 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.elasticsearch.client; | ||
|
||
import org.apache.http.client.methods.HttpGet; | ||
import org.elasticsearch.protocol.xpack.graph.GraphExploreRequest; | ||
|
||
import java.io.IOException; | ||
|
||
public class GraphRequestConverters { | ||
|
||
static Request explore(GraphExploreRequest exploreRequest) throws IOException { | ||
String endpoint = RequestConverters.endpoint(exploreRequest.indices(), exploreRequest.types(), "_xpack/graph/_explore"); | ||
Request request = new Request(HttpGet.METHOD_NAME, endpoint); | ||
request.setEntity(RequestConverters.createEntity(exploreRequest, RequestConverters.REQUEST_BODY_CONTENT_TYPE)); | ||
return request; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
client/rest-high-level/src/main/java/org/elasticsearch/client/IngestRequestConverters.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/* | ||
* Licensed to Elasticsearch under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch 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.elasticsearch.client; | ||
|
||
import org.apache.http.client.methods.HttpDelete; | ||
import org.apache.http.client.methods.HttpGet; | ||
import org.apache.http.client.methods.HttpPost; | ||
import org.apache.http.client.methods.HttpPut; | ||
import org.elasticsearch.action.ingest.DeletePipelineRequest; | ||
import org.elasticsearch.action.ingest.GetPipelineRequest; | ||
import org.elasticsearch.action.ingest.PutPipelineRequest; | ||
import org.elasticsearch.action.ingest.SimulatePipelineRequest; | ||
|
||
import java.io.IOException; | ||
|
||
public class IngestRequestConverters { | ||
|
||
static Request getPipeline(GetPipelineRequest getPipelineRequest) { | ||
String endpoint = new RequestConverters.EndpointBuilder() | ||
.addPathPartAsIs("_ingest/pipeline") | ||
.addCommaSeparatedPathParts(getPipelineRequest.getIds()) | ||
.build(); | ||
Request request = new Request(HttpGet.METHOD_NAME, endpoint); | ||
|
||
RequestConverters.Params parameters = new RequestConverters.Params(request); | ||
parameters.withMasterTimeout(getPipelineRequest.masterNodeTimeout()); | ||
return request; | ||
} | ||
|
||
static Request putPipeline(PutPipelineRequest putPipelineRequest) throws IOException { | ||
String endpoint = new RequestConverters.EndpointBuilder() | ||
.addPathPartAsIs("_ingest/pipeline") | ||
.addPathPart(putPipelineRequest.getId()) | ||
.build(); | ||
Request request = new Request(HttpPut.METHOD_NAME, endpoint); | ||
|
||
RequestConverters.Params parameters = new RequestConverters.Params(request); | ||
parameters.withTimeout(putPipelineRequest.timeout()); | ||
parameters.withMasterTimeout(putPipelineRequest.masterNodeTimeout()); | ||
|
||
request.setEntity(RequestConverters.createEntity(putPipelineRequest, RequestConverters.REQUEST_BODY_CONTENT_TYPE)); | ||
return request; | ||
} | ||
|
||
static Request deletePipeline(DeletePipelineRequest deletePipelineRequest) { | ||
String endpoint = new RequestConverters.EndpointBuilder() | ||
.addPathPartAsIs("_ingest/pipeline") | ||
.addPathPart(deletePipelineRequest.getId()) | ||
.build(); | ||
Request request = new Request(HttpDelete.METHOD_NAME, endpoint); | ||
|
||
RequestConverters.Params parameters = new RequestConverters.Params(request); | ||
parameters.withTimeout(deletePipelineRequest.timeout()); | ||
parameters.withMasterTimeout(deletePipelineRequest.masterNodeTimeout()); | ||
|
||
return request; | ||
} | ||
|
||
static Request simulatePipeline(SimulatePipelineRequest simulatePipelineRequest) throws IOException { | ||
RequestConverters.EndpointBuilder builder = new RequestConverters.EndpointBuilder().addPathPartAsIs("_ingest/pipeline"); | ||
if (simulatePipelineRequest.getId() != null && !simulatePipelineRequest.getId().isEmpty()) { | ||
builder.addPathPart(simulatePipelineRequest.getId()); | ||
} | ||
builder.addPathPartAsIs("_simulate"); | ||
String endpoint = builder.build(); | ||
Request request = new Request(HttpPost.METHOD_NAME, endpoint); | ||
RequestConverters.Params params = new RequestConverters.Params(request); | ||
params.putParam("verbose", Boolean.toString(simulatePipelineRequest.isVerbose())); | ||
request.setEntity(RequestConverters.createEntity(simulatePipelineRequest, RequestConverters.REQUEST_BODY_CONTENT_TYPE)); | ||
return request; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.