Class QueryOptions
Namespace: Consul
Assembly: Consul.dll
QueryOptions are used to parameterize a query
public class QueryOptions
Inheritance
Inherited Members
object.Equals(object) , object.Equals(object, object) , object.GetHashCode() , object.GetType() , object.MemberwiseClone() , object.ReferenceEquals(object, object) , object.ToString()
Fields
Default
public static readonly QueryOptions Default
Field Value
Properties
Consistency
The consistency level required for the operation.
public ConsistencyMode Consistency { get; set; }
Property Value
Datacenter
Providing a datacenter overwrites the DC provided by the Config.
public string Datacenter { get; set; }
Property Value
MaxAge
MaxAge limits how old a cached value will be returned if UseCache is true. If there is a cached response that is older than the MaxAge, it is treated as a cache miss and a new fetch invoked. If the fetch fails, the error is returned. Clients that wish to allow for stale results on error can set StaleIfError to a longer duration to change this behavior. It is ignored if the endpoint supports background refresh caching. See https://www.consul.io/api/features/caching.html for more details.
public TimeSpan? MaxAge { get; set; }
Property Value
TimeSpan ?
Namespace
Namespace is the name of the namespace to send along for the request when no other Namespace is present in the QueryOptions. Namespace is an Enterprise-only feature.
public string Namespace { get; set; }
Property Value
Near
Near is used to provide a node name that will sort the results in ascending order based on the estimated round trip time from that node. Setting this to "_agent" will use the agent's node for the sort.
public string Near { get; set; }
Property Value
StaleIfError
StaleIfError specifies how stale the client will accept a cached response if the servers are unavailable to fetch a fresh one. Only makes sense when UseCache is true and MaxAge is set to a lower, non-zero value. It is ignored if the endpoint supports background refresh caching. See https://www.consul.io/api/features/caching.html for more details.
public TimeSpan? StaleIfError { get; set; }
Property Value
TimeSpan ?
Token
Token is used to provide a per-request ACL token which overrides the agent's default token.
public string Token { get; set; }
Property Value
UseCache
WaitIndex is used to enable a blocking query. Waits until the timeout or the next index is reached. UseCache requests that the agent cache results locally. See https://www.consul.io/api/features/caching.html for more details on the semantics.
public bool UseCache { get; set; }
Property Value
WaitIndex
WaitIndex is used to enable a blocking query. Waits until the timeout or the next index is reached
public ulong WaitIndex { get; set; }
Property Value
WaitTime
WaitTime is used to bound the duration of a wait. Defaults to that of the Config, but can be overridden.
public TimeSpan? WaitTime { get; set; }
Property Value
TimeSpan ?