forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
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 Component Templates APIs (elastic#54635)
* HLRC support for Component Templates * hlrc * hlrc * merge fix * removed unused import * checkstyle fixes * metaData -> metadata * move to ClusterClient * checkstyle fixes * checkstyle fixes * checkstyle fixes * method in spec fixed * PR comments * PR comments * PR comments * unused imports fixed * review comment Co-authored-by: Elastic Machine <[email protected]>
- Loading branch information
1 parent
2794572
commit c27022d
Showing
12 changed files
with
759 additions
and
4 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
40 changes: 40 additions & 0 deletions
40
...-level/src/main/java/org/elasticsearch/client/indices/ComponentTemplatesExistRequest.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,40 @@ | ||
/* | ||
* 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.common.Strings; | ||
|
||
/** | ||
* A request to check for the existence of component templates | ||
*/ | ||
public class ComponentTemplatesExistRequest extends GetComponentTemplatesRequest { | ||
|
||
/** | ||
* Create a request to check for the existence of component template. Name must be provided | ||
* | ||
* @param name the name of template to check for the existence of | ||
*/ | ||
public ComponentTemplatesExistRequest(String name) { | ||
super(name); | ||
if (Strings.isNullOrEmpty(name)) { | ||
throw new IllegalArgumentException("must provide component template name"); | ||
} | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
...-level/src/main/java/org/elasticsearch/client/indices/DeleteComponentTemplateRequest.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 DeleteComponentTemplateRequest extends TimedRequest { | ||
|
||
private final String name; | ||
|
||
public DeleteComponentTemplateRequest(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
} |
80 changes: 80 additions & 0 deletions
80
...gh-level/src/main/java/org/elasticsearch/client/indices/GetComponentTemplatesRequest.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 component templates | ||
*/ | ||
public class GetComponentTemplatesRequest 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 component template. If no template name is provided, all templates will | ||
* be read | ||
* | ||
* @param name the name of template to read | ||
*/ | ||
public GetComponentTemplatesRequest(String name) { | ||
this.name = name; | ||
} | ||
|
||
/** | ||
* @return the name of component 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.