Class RolloverRequest
- java.lang.Object
-
- org.opensearch.client.TimedRequest
-
- org.opensearch.client.indices.rollover.RolloverRequest
-
- All Implemented Interfaces:
Validatable,org.opensearch.common.xcontent.ToXContent,org.opensearch.common.xcontent.ToXContentObject
public class RolloverRequest extends TimedRequest implements org.opensearch.common.xcontent.ToXContentObject
Request class to swap index under an alias upon satisfying conditions
-
-
Field Summary
-
Fields inherited from class org.opensearch.client.TimedRequest
DEFAULT_ACK_TIMEOUT, DEFAULT_MASTER_NODE_TIMEOUT
-
Fields inherited from interface org.opensearch.client.Validatable
EMPTY
-
-
Constructor Summary
Constructors Constructor Description RolloverRequest(java.lang.String alias, java.lang.String newIndexName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RolloverRequestaddMaxIndexAgeCondition(org.opensearch.common.unit.TimeValue age)Adds condition to check if the index is at leastageoldRolloverRequestaddMaxIndexDocsCondition(long numDocs)Adds condition to check if the index has at leastnumDocsRolloverRequestaddMaxIndexSizeCondition(org.opensearch.common.unit.ByteSizeValue size)Adds a size-based condition to check if the index size is at leastsize.RolloverRequestdryRun(boolean dryRun)Sets if the rollover should not be executed when conditions are metjava.lang.StringgetAlias()Returns the alias of the rollover operationjava.util.Map<java.lang.String,org.opensearch.action.admin.indices.rollover.Condition<?>>getConditions()Returns all set conditionsCreateIndexRequestgetCreateIndexRequest()Returns the innerCreateIndexRequest.java.lang.StringgetNewIndexName()Returns the new index name for the rolloverbooleanisDryRun()Returns if the rollover should not be executed when conditions are metorg.opensearch.common.xcontent.XContentBuildertoXContent(org.opensearch.common.xcontent.XContentBuilder builder, org.opensearch.common.xcontent.ToXContent.Params params)-
Methods inherited from class org.opensearch.client.TimedRequest
masterNodeTimeout, setMasterTimeout, setTimeout, timeout
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opensearch.client.Validatable
validate
-
-
-
-
Method Detail
-
getAlias
public java.lang.String getAlias()
Returns the alias of the rollover operation
-
getNewIndexName
public java.lang.String getNewIndexName()
Returns the new index name for the rollover
-
dryRun
public RolloverRequest dryRun(boolean dryRun)
Sets if the rollover should not be executed when conditions are met
-
isDryRun
public boolean isDryRun()
Returns if the rollover should not be executed when conditions are met
-
addMaxIndexAgeCondition
public RolloverRequest addMaxIndexAgeCondition(org.opensearch.common.unit.TimeValue age)
Adds condition to check if the index is at leastageold
-
addMaxIndexDocsCondition
public RolloverRequest addMaxIndexDocsCondition(long numDocs)
Adds condition to check if the index has at leastnumDocs
-
addMaxIndexSizeCondition
public RolloverRequest addMaxIndexSizeCondition(org.opensearch.common.unit.ByteSizeValue size)
Adds a size-based condition to check if the index size is at leastsize.
-
getConditions
public java.util.Map<java.lang.String,org.opensearch.action.admin.indices.rollover.Condition<?>> getConditions()
Returns all set conditions
-
getCreateIndexRequest
public CreateIndexRequest getCreateIndexRequest()
Returns the innerCreateIndexRequest. Allows to configure mappings, settings and aliases for the new index.
-
toXContent
public org.opensearch.common.xcontent.XContentBuilder toXContent(org.opensearch.common.xcontent.XContentBuilder builder, org.opensearch.common.xcontent.ToXContent.Params params) throws java.io.IOException- Specified by:
toXContentin interfaceorg.opensearch.common.xcontent.ToXContent- Throws:
java.io.IOException
-
-