Class PutRepositoryRequest

All Implemented Interfaces:
AckedRequest, Writeable, org.elasticsearch.common.util.concurrent.RefCounted, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentObject, TaskAwareRequest

public class PutRepositoryRequest
extends AcknowledgedRequest<PutRepositoryRequest>
implements org.elasticsearch.common.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 java.io.IOException
      Throws:
      java.io.IOException
    • PutRepositoryRequest

      public PutRepositoryRequest()
    • PutRepositoryRequest

      public PutRepositoryRequest​(java.lang.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​(java.lang.String name)
      Sets the name of the repository.
      Parameters:
      name - repository name
    • name

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

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

      public java.lang.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​(java.lang.String source, org.elasticsearch.common.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​(java.util.Map<java.lang.String,​java.lang.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​(java.util.Map<java.lang.String,​java.lang.Object> repositoryDefinition)
      Parses repository definition.
      Parameters:
      repositoryDefinition - repository definition
    • writeTo

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

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