Class PutRepositoryRequest

All Implemented Interfaces:
AckedRequest, Writeable, org.elasticsearch.core.RefCounted, TaskAwareRequest, org.elasticsearch.xcontent.ToXContent, org.elasticsearch.xcontent.ToXContentObject

public class PutRepositoryRequest extends AcknowledgedRequest<PutRepositoryRequest> implements org.elasticsearch.xcontent.ToXContentObject
Register repository request.

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.

  • Constructor Details

    • PutRepositoryRequest

      public PutRepositoryRequest(StreamInput in) throws IOException
      Throws:
      IOException
    • PutRepositoryRequest

      public PutRepositoryRequest()
    • PutRepositoryRequest

      public PutRepositoryRequest(String name)
      Constructs a new put repository request with the provided name.
  • Method Details

    • validate

      Specified by:
      validate in class ActionRequest
    • name

      public PutRepositoryRequest name(String name)
      Sets the name of the repository.
      Parameters:
      name - repository name
    • name

      public String name()
      The name of the repository.
      Returns:
      repository name
    • type

      public PutRepositoryRequest type(String type)
      The type of the repository
      • "fs" - shared filesystem repository
      Parameters:
      type - repository type
      Returns:
      this request
    • type

      public String type()
      Returns repository type
      Returns:
      repository type
    • settings

      public PutRepositoryRequest settings(Settings settings)
      Sets the repository settings
      Parameters:
      settings - repository settings
      Returns:
      this request
    • settings

      public PutRepositoryRequest settings(Settings.Builder settings)
      Sets the repository settings
      Parameters:
      settings - repository settings
      Returns:
      this request
    • settings

      public PutRepositoryRequest settings(String source, org.elasticsearch.xcontent.XContentType xContentType)
      Sets the repository settings.
      Parameters:
      source - repository settings in json or yaml format
      xContentType - the content type of the source
      Returns:
      this request
    • settings

      public PutRepositoryRequest settings(Map<String,Object> source)
      Sets the repository settings.
      Parameters:
      source - repository settings
      Returns:
      this request
    • settings

      public Settings settings()
      Returns repository settings
      Returns:
      repository settings
    • verify

      public PutRepositoryRequest verify(boolean verify)
      Sets whether or not the repository should be verified after creation
    • verify

      public boolean verify()
      Returns true if repository should be verified after creation
    • source

      public PutRepositoryRequest source(Map<String,Object> repositoryDefinition)
      Parses repository definition.
      Parameters:
      repositoryDefinition - repository definition
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Overrides:
      writeTo in class AcknowledgedRequest<PutRepositoryRequest>
      Throws:
      IOException
    • toXContent

      public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.elasticsearch.xcontent.ToXContent
      Throws:
      IOException