Class AddIndexBlockRequest

All Implemented Interfaces:
IndicesRequest, IndicesRequest.Replaceable, AckedRequest, org.opensearch.core.common.io.stream.Writeable, TaskAwareRequest

@PublicApi(since="1.0.0") public class AddIndexBlockRequest extends AcknowledgedRequest<AddIndexBlockRequest> implements IndicesRequest.Replaceable
A request to add a block to an index.
Opensearch.api:
  • Constructor Details

    • AddIndexBlockRequest

      public AddIndexBlockRequest(org.opensearch.core.common.io.stream.StreamInput in) throws IOException
      Throws:
      IOException
    • AddIndexBlockRequest

      public AddIndexBlockRequest(IndexMetadata.APIBlock block, String... indices)
      Constructs a new request for the specified block and indices
  • Method Details

    • validate

      Specified by:
      validate in class ActionRequest
    • indices

      public String[] indices()
      Returns the indices to be blocked
      Specified by:
      indices in interface IndicesRequest
    • indices

      public AddIndexBlockRequest indices(String... indices)
      Sets the indices to be blocked
      Specified by:
      indices in interface IndicesRequest.Replaceable
      Parameters:
      indices - the indices to be blocked
      Returns:
      the request itself
    • indicesOptions

      public IndicesOptions indicesOptions()
      Specifies what type of requested indices to ignore and how to deal with wildcard expressions. For example indices that don't exist.
      Specified by:
      indicesOptions in interface IndicesRequest
      Returns:
      the desired behaviour regarding indices to ignore and wildcard indices expressions
    • indicesOptions

      public AddIndexBlockRequest indicesOptions(IndicesOptions indicesOptions)
      Specifies what type of requested indices to ignore and how to deal wild wildcard expressions. For example indices that don't exist.
      Parameters:
      indicesOptions - the desired behaviour regarding indices to ignore and wildcard indices expressions
      Returns:
      the request itself
    • getBlock

      public IndexMetadata.APIBlock getBlock()
      Returns the block to be added
    • writeTo

      public void writeTo(org.opensearch.core.common.io.stream.StreamOutput out) throws IOException
      Specified by:
      writeTo in interface org.opensearch.core.common.io.stream.Writeable
      Overrides:
      writeTo in class AcknowledgedRequest<AddIndexBlockRequest>
      Throws:
      IOException