Table of Contents

Class ConsistencyPolicy

Namespace
Microsoft.Azure.Management.CosmosDB.Fluent.Models
Assembly
Microsoft.Azure.Management.CosmosDB.Fluent.dll

The consistency policy for the Cosmos DB database account.

public class ConsistencyPolicy
Inheritance
ConsistencyPolicy
Inherited Members

Constructors

ConsistencyPolicy()

Initializes a new instance of the ConsistencyPolicy class.

public ConsistencyPolicy()

ConsistencyPolicy(DefaultConsistencyLevel, long?, int?)

Initializes a new instance of the ConsistencyPolicy class.

public ConsistencyPolicy(DefaultConsistencyLevel defaultConsistencyLevel, long? maxStalenessPrefix = null, int? maxIntervalInSeconds = null)

Parameters

defaultConsistencyLevel DefaultConsistencyLevel

The default consistency level and configuration settings of the Cosmos DB account. Possible values include: 'Eventual', 'Session', 'BoundedStaleness', 'Strong', 'ConsistentPrefix'

maxStalenessPrefix long?

When used with the Bounded Staleness consistency level, this value represents the number of stale requests tolerated. Accepted range for this value is 1 – 2,147,483,647. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'.

maxIntervalInSeconds int?

When used with the Bounded Staleness consistency level, this value represents the time amount of staleness (in seconds) tolerated. Accepted range for this value is 5 - 86400. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'.

Properties

DefaultConsistencyLevel

Gets or sets the default consistency level and configuration settings of the Cosmos DB account. Possible values include: 'Eventual', 'Session', 'BoundedStaleness', 'Strong', 'ConsistentPrefix'

public DefaultConsistencyLevel DefaultConsistencyLevel { get; set; }

Property Value

DefaultConsistencyLevel

MaxIntervalInSeconds

Gets or sets when used with the Bounded Staleness consistency level, this value represents the time amount of staleness (in seconds) tolerated. Accepted range for this value is 5 - 86400. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'.

public int? MaxIntervalInSeconds { get; set; }

Property Value

int?

MaxStalenessPrefix

Gets or sets when used with the Bounded Staleness consistency level, this value represents the number of stale requests tolerated. Accepted range for this value is 1 – 2,147,483,647. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'.

public long? MaxStalenessPrefix { get; set; }

Property Value

long?

Methods

Validate()

Validate the object.

public virtual void Validate()

Exceptions

Microsoft.Rest.ValidationException

Thrown if validation fails