public class PutRepositoryRequest extends AcknowledgedRequest<PutRepositoryRequest>
Registers a repository with given name, type and settings. If the repository with the same name already exists in the cluster, the new repository will replace the existing repository.
TransportRequest.Empty
DEFAULT_ACK_TIMEOUT, timeout
DEFAULT_MASTER_NODE_TIMEOUT, masterNodeTimeout
Constructor and Description |
---|
PutRepositoryRequest() |
PutRepositoryRequest(java.lang.String name)
Constructs a new put repository request with the provided name.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
name()
The name of the repository.
|
PutRepositoryRequest |
name(java.lang.String name)
Sets the name of the repository.
|
void |
readFrom(StreamInput in)
Set this object's fields from a StreamInput.
|
Settings |
settings()
Returns repository settings
|
PutRepositoryRequest |
settings(java.util.Map<java.lang.String,java.lang.Object> source)
Sets the repository settings.
|
PutRepositoryRequest |
settings(Settings.Builder settings)
Sets the repository settings
|
PutRepositoryRequest |
settings(Settings settings)
Sets the repository settings
|
PutRepositoryRequest |
settings(java.lang.String source)
Deprecated.
use
settings(String, XContentType) to avoid content type auto-detection |
PutRepositoryRequest |
settings(java.lang.String source,
XContentType xContentType)
Sets the repository settings.
|
PutRepositoryRequest |
source(java.util.Map<java.lang.String,java.lang.Object> repositoryDefinition)
Parses repository definition.
|
java.lang.String |
type()
Returns repository type
|
PutRepositoryRequest |
type(java.lang.String type)
The type of the repository
"fs" - shared filesystem repository
|
ActionRequestValidationException |
validate() |
boolean |
verify()
Returns true if repository should be verified after creation
|
PutRepositoryRequest |
verify(boolean verify)
Sets whether or not the repository should be verified after creation
|
void |
writeTo(StreamOutput out)
Write this object's fields to a StreamOutput.
|
ackTimeout, readTimeout, timeout, timeout, timeout, writeTimeout
masterNodeTimeout, masterNodeTimeout, masterNodeTimeout
getShouldStoreResult
getParentTask, setParentTask
remoteAddress, remoteAddress
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
masterNodeTimeout
createTask, getDescription, setParentTask
public PutRepositoryRequest()
public PutRepositoryRequest(java.lang.String name)
public ActionRequestValidationException validate()
validate
in class ActionRequest
public PutRepositoryRequest name(java.lang.String name)
name
- repository namepublic java.lang.String name()
public PutRepositoryRequest type(java.lang.String type)
type
- repository typepublic java.lang.String type()
public PutRepositoryRequest settings(Settings settings)
settings
- repository settingspublic PutRepositoryRequest settings(Settings.Builder settings)
settings
- repository settings@Deprecated public PutRepositoryRequest settings(java.lang.String source)
settings(String, XContentType)
to avoid content type auto-detectionsource
- repository settings in json or yaml formatpublic PutRepositoryRequest settings(java.lang.String source, XContentType xContentType)
source
- repository settings in json or yaml formatxContentType
- the content type of the sourcepublic PutRepositoryRequest settings(java.util.Map<java.lang.String,java.lang.Object> source)
source
- repository settingspublic Settings settings()
public PutRepositoryRequest verify(boolean verify)
public boolean verify()
public PutRepositoryRequest source(java.util.Map<java.lang.String,java.lang.Object> repositoryDefinition)
repositoryDefinition
- repository definitionpublic void readFrom(StreamInput in) throws java.io.IOException
Streamable
readFrom
in interface Streamable
readFrom
in class AcknowledgedRequest<PutRepositoryRequest>
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Streamable
writeTo
in interface Streamable
writeTo
in class AcknowledgedRequest<PutRepositoryRequest>
java.io.IOException