-
Notifications
You must be signed in to change notification settings - Fork 25k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HLRC support for Index Templates V2 (#54838)
* HLRC support for Index Templates V2 This change adds High Level Rest Client support for Index Templates V2. Relates to #53101
- Loading branch information
1 parent
99b9a18
commit b8ca70b
Showing
13 changed files
with
757 additions
and
28 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
35 changes: 35 additions & 0 deletions
35
...gh-level/src/main/java/org/elasticsearch/client/indices/DeleteIndexTemplateV2Request.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.indices; | ||
|
||
import org.elasticsearch.client.TimedRequest; | ||
|
||
public class DeleteIndexTemplateV2Request extends TimedRequest { | ||
|
||
private final String name; | ||
|
||
public DeleteIndexTemplateV2Request(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
} |
80 changes: 80 additions & 0 deletions
80
...-high-level/src/main/java/org/elasticsearch/client/indices/GetIndexTemplateV2Request.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,80 @@ | ||
/* | ||
* 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.indices; | ||
|
||
import org.elasticsearch.client.TimedRequest; | ||
import org.elasticsearch.client.Validatable; | ||
import org.elasticsearch.common.Nullable; | ||
import org.elasticsearch.common.unit.TimeValue; | ||
|
||
/** | ||
* A request to read the content of index templates | ||
*/ | ||
public class GetIndexTemplateV2Request implements Validatable { | ||
|
||
private final String name; | ||
|
||
private TimeValue masterNodeTimeout = TimedRequest.DEFAULT_MASTER_NODE_TIMEOUT; | ||
private boolean local = false; | ||
|
||
/** | ||
* Create a request to read the content of index template. If no template name is provided, all templates will | ||
* be read | ||
* | ||
* @param name the name of template to read | ||
*/ | ||
public GetIndexTemplateV2Request(String name) { | ||
this.name = name; | ||
} | ||
|
||
/** | ||
* @return the name of index template this request is requesting | ||
*/ | ||
public String name() { | ||
return name; | ||
} | ||
|
||
/** | ||
* @return the timeout for waiting for the master node to respond | ||
*/ | ||
public TimeValue getMasterNodeTimeout() { | ||
return masterNodeTimeout; | ||
} | ||
|
||
public void setMasterNodeTimeout(@Nullable TimeValue masterNodeTimeout) { | ||
this.masterNodeTimeout = masterNodeTimeout; | ||
} | ||
|
||
public void setMasterNodeTimeout(String masterNodeTimeout) { | ||
final TimeValue timeValue = TimeValue.parseTimeValue(masterNodeTimeout, getClass().getSimpleName() + ".masterNodeTimeout"); | ||
setMasterNodeTimeout(timeValue); | ||
} | ||
|
||
/** | ||
* @return true if this request is to read from the local cluster state, rather than the master node - false otherwise | ||
*/ | ||
public boolean isLocal() { | ||
return local; | ||
} | ||
|
||
public void setLocal(boolean local) { | ||
this.local = local; | ||
} | ||
} |
Oops, something went wrong.