Skip to main content

Class ConsulClientConfiguration

Namespace: Consul
Assembly: Consul.dll

Represents the configuration options for a Consul client.

public class ConsulClientConfiguration

Inheritance​

object ← ConsulClientConfiguration

Inherited Members​

object.Equals(object) , object.Equals(object, object) , object.GetHashCode() , object.GetType() , object.MemberwiseClone() , object.ReferenceEquals(object, object) , object.ToString()

Constructors​

ConsulClientConfiguration()​

Creates a new instance of a Consul client configuration.

public ConsulClientConfiguration()

Exceptions​

ConsulConfigurationException

An error that occured while building the configuration.

Properties​

Address​

The Uri to connect to the Consul agent.

public Uri Address { get; set; }

Property Value​

Uri

ClientCertificate​

TLS Client Certificate used to secure a connection to a Consul agent. Not supported on Mono. This is only needed if an authenticating service exists in front of Consul; Token is used for ACL authentication by Consul. This is not the same as RPC Encryption with TLS certificates.

[Obsolete("Use of ClientCertificate should be converted to adding to the HttpHandler's ClientCertificates list in the ConsulClient constructor.This property will be removed in a future release.", false)]
public X509Certificate2 ClientCertificate { set; }

Property Value​

X509Certificate2

Exceptions​

PlatformNotSupportedException

Setting this property will throw a PlatformNotSupportedException on Mono

Datacenter​

Datacenter to provide with each request. If not provided, the default agent datacenter is used.

public string Datacenter { get; set; }

Property Value​

string

HttpAuth​

Credentials to use for access to the HTTP API. This is only needed if an authenticating service exists in front of Consul; Token is used for ACL authentication by Consul.

[Obsolete("Use of HttpAuth should be converted to setting the HttpHandler's Credential property in the ConsulClient constructorThis property will be removed in a future release.", false)]
public NetworkCredential HttpAuth { set; }

Property Value​

NetworkCredential

Namespace​

Namespace is the name of the namespace to send along for the request when no other Namespace is present in the QueryOptions

public string Namespace { get; set; }

Property Value​

string

Token​

Token is used to provide an ACL token which overrides the agent's default token. This ACL token is used for every request by clients created using this configuration.

public string Token { get; set; }

Property Value​

string

WaitTime​

WaitTime limits how long a Watch will block. If not provided, the agent default values will be used.

public TimeSpan? WaitTime { get; set; }

Property Value​

TimeSpan ?

  • Constructors
    • ConsulClientConfiguration()
  • Properties
    • Address
    • ClientCertificate
    • Datacenter
    • HttpAuth
    • Namespace
    • Token
    • WaitTime