Java api: add name setter to delete index template request and make default constructor public for AnalyzeRequest and DeleteIndexTemplateRequest
Closes #8122 Closes #8123
This commit is contained in:
parent
fc28bc73f8
commit
ee26ab8bb4
|
@ -18,10 +18,8 @@
|
|||
*/
|
||||
package org.elasticsearch.action.admin.indices.analyze;
|
||||
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.support.single.custom.SingleCustomOperationRequest;
|
||||
import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
|
@ -48,8 +46,7 @@ public class AnalyzeRequest extends SingleCustomOperationRequest<AnalyzeRequest>
|
|||
|
||||
private String field;
|
||||
|
||||
AnalyzeRequest() {
|
||||
|
||||
public AnalyzeRequest() {
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -34,7 +34,7 @@ public class DeleteIndexTemplateRequest extends MasterNodeRequest<DeleteIndexTem
|
|||
|
||||
private String name;
|
||||
|
||||
DeleteIndexTemplateRequest() {
|
||||
public DeleteIndexTemplateRequest() {
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -44,6 +44,14 @@ public class DeleteIndexTemplateRequest extends MasterNodeRequest<DeleteIndexTem
|
|||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the index template name to delete.
|
||||
*/
|
||||
public DeleteIndexTemplateRequest name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionRequestValidationException validate() {
|
||||
ActionRequestValidationException validationException = null;
|
||||
|
|
|
@ -33,4 +33,12 @@ public class DeleteIndexTemplateRequestBuilder extends MasterNodeOperationReques
|
|||
public DeleteIndexTemplateRequestBuilder(ElasticsearchClient client, DeleteIndexTemplateAction action, String name) {
|
||||
super(client, action, new DeleteIndexTemplateRequest(name));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the name of the index template to delete.
|
||||
*/
|
||||
public DeleteIndexTemplateRequestBuilder setName(String name) {
|
||||
request.name(name);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue