Interface IConnectionConfigurationValues
Inherited Members
Namespace: OpenSearch.Net
Assembly: OpenSearch.Net.dll
Syntax
public interface IConnectionConfigurationValues : IDisposable
Properties
| Edit this page View SourceApiKeyAuthenticationCredentials
Api Key authorization credentials to specify with all requests.
Declaration
ApiKeyAuthenticationCredentials ApiKeyAuthenticationCredentials { get; }
Property Value
Type | Description |
---|---|
ApiKeyAuthenticationCredentials |
Remarks
Cannot be used in conjuction with BasicAuthenticationCredentials
BasicAuthenticationCredentials
Basic access authorization credentials to specify with all requests.
Declaration
BasicAuthenticationCredentials BasicAuthenticationCredentials { get; }
Property Value
Type | Description |
---|---|
BasicAuthenticationCredentials |
Remarks
Cannot be used in conjuction with ApiKeyAuthenticationCredentials
BootstrapLock
Provides a semaphoreslim to transport implementations that need to limit access to a resource
Declaration
SemaphoreSlim BootstrapLock { get; }
Property Value
Type | Description |
---|---|
SemaphoreSlim |
ClientCertificates
Use the following certificates to authenticate all HTTP requests. You can also set them on individual request using ClientCertificates
Declaration
X509CertificateCollection ClientCertificates { get; }
Property Value
Type | Description |
---|---|
X509CertificateCollection |
Connection
The connection implementation to use when talking with OpenSearch
Declaration
IConnection Connection { get; }
Property Value
Type | Description |
---|---|
IConnection |
ConnectionLimit
Limits the number of concurrent connections that can be opened to an endpoint. Defaults to 80 (see DefaultConnectionLimit).
For Desktop CLR, this setting applies to the DefaultConnectionLimit property on the ServicePointManager object when creating ServicePoint objects, affecting the default IConnection implementation.
For Core CLR, this setting applies to the MaxConnectionsPerServer property on the HttpClientHandler instances used by the HttpClient inside the default IConnection implementation
Declaration
int ConnectionLimit { get; }
Property Value
Type | Description |
---|---|
int |
ConnectionPool
The connection pool to use when talking with OpenSearch
Declaration
IConnectionPool ConnectionPool { get; }
Property Value
Type | Description |
---|---|
IConnectionPool |
DeadTimeout
The time to put dead nodes out of rotation (this will be multiplied by the number of times they've been dead)
Declaration
TimeSpan? DeadTimeout { get; }
Property Value
Type | Description |
---|---|
TimeSpan? |
DisableAutomaticProxyDetection
Disabled proxy detection on the webrequest, in some cases this may speed up the first connection your appdomain makes, in other cases it will actually increase the time for the first connection. No silver bullet! use with care!
Declaration
bool DisableAutomaticProxyDetection { get; }
Property Value
Type | Description |
---|---|
bool |
DisableDirectStreaming
When set to true will disable (de)serializing directly to the request and response stream and return a byte[] copy of the raw request and response on OpenSearch calls. Defaults to false
Declaration
bool DisableDirectStreaming { get; }
Property Value
Type | Description |
---|---|
bool |
DisableMetaHeader
Declaration
bool DisableMetaHeader { get; }
Property Value
Type | Description |
---|---|
bool |
DisablePings
This signals that we do not want to send initial pings to unknown/previously dead nodes and just send the call straightaway
Declaration
bool DisablePings { get; }
Property Value
Type | Description |
---|---|
bool |
DnsRefreshTimeout
DnsRefreshTimeout for the connections. Defaults to 5 minutes.
Will create new instances of HttpClient after this timeout to force DNS updates
Declaration
TimeSpan DnsRefreshTimeout { get; }
Property Value
Type | Description |
---|---|
TimeSpan |
EnableHttpCompression
Enable gzip compressed requests and responses, do note that you need to configure OpenSearch to set this
Declaration
bool EnableHttpCompression { get; }
Property Value
Type | Description |
---|---|
bool |
EnableTcpStats
Enable statistics about TCP connections to be collected when making a request
Declaration
bool EnableTcpStats { get; }
Property Value
Type | Description |
---|---|
bool |
EnableThreadPoolStats
Enable statistics about thread pools to be collected when making a request
Declaration
bool EnableThreadPoolStats { get; }
Property Value
Type | Description |
---|---|
bool |
Headers
Try to send these headers for every request
Declaration
NameValueCollection Headers { get; }
Property Value
Type | Description |
---|---|
NameValueCollection |
HttpPipeliningEnabled
Whether HTTP pipelining is enabled. The default is true
Declaration
bool HttpPipeliningEnabled { get; }
Property Value
Type | Description |
---|---|
bool |
KeepAliveInterval
KeepAliveInterval - specifies the interval, in milliseconds, between when successive keep-alive packets are sent if no acknowledgement is received.
Declaration
TimeSpan? KeepAliveInterval { get; }
Property Value
Type | Description |
---|---|
TimeSpan? |
KeepAliveTime
KeepAliveTime - specifies the timeout, in milliseconds, with no activity until the first keep-alive packet is sent.
Declaration
TimeSpan? KeepAliveTime { get; }
Property Value
Type | Description |
---|---|
TimeSpan? |
MaxDeadTimeout
The maximum amount of time a node is allowed to marked dead
Declaration
TimeSpan? MaxDeadTimeout { get; }
Property Value
Type | Description |
---|---|
TimeSpan? |
MaxRetries
When a retryable exception occurs or status code is returned this controls the maximum amount of times we should retry the call to OpenSearch
Declaration
int? MaxRetries { get; }
Property Value
Type | Description |
---|---|
int? |
MaxRetryTimeout
Limits the total runtime including retries separately from RequestTimeout
When not specified defaults to RequestTimeout which itself defaults to 60 seconds
Declaration
TimeSpan? MaxRetryTimeout { get; }
Property Value
Type | Description |
---|---|
TimeSpan? |
MemoryStreamFactory
Provides a memory stream factory
Declaration
IMemoryStreamFactory MemoryStreamFactory { get; }
Property Value
Type | Description |
---|---|
IMemoryStreamFactory |
MetaHeaderProvider
Produces the client meta header for a request.
Declaration
MetaHeaderProvider MetaHeaderProvider { get; }
Property Value
Type | Description |
---|---|
MetaHeaderProvider |
NodePredicate
Register a predicate to select which nodes that you want to execute API calls on. Note that sniffing requests omit this predicate and always execute on all nodes. When using an IConnectionPool implementation that supports reseeding of nodes, this will default to omitting cluster_manager only node from regular API calls. When using static or single node connection pooling it is assumed the list of node you instantiate the client with should be taken verbatim.
Declaration
Func<Node, bool> NodePredicate { get; }
Property Value
Type | Description |
---|---|
Func<Node, bool> |
OnRequestCompleted
Allows you to register a callback every time a an API call is returned
Declaration
Action<IApiCallDetails> OnRequestCompleted { get; }
Property Value
Type | Description |
---|---|
Action<IApiCallDetails> |
OnRequestDataCreated
An action to run when the RequestData for a request has been created.
Declaration
Action<RequestData> OnRequestDataCreated { get; }
Property Value
Type | Description |
---|---|
Action<RequestData> |
PingTimeout
The timeout in milliseconds to use for ping requests, which are issued to determine whether a node is alive
Declaration
TimeSpan? PingTimeout { get; }
Property Value
Type | Description |
---|---|
TimeSpan? |
PrettyJson
Forces all requests to have ?pretty=true, causing OpenSearch to return formatted json. Also forces the client to send out formatted json. Defaults to false
Declaration
bool PrettyJson { get; }
Property Value
Type | Description |
---|---|
bool |
ProxyAddress
When set will force all connections through this proxy
Declaration
string ProxyAddress { get; }
Property Value
Type | Description |
---|---|
string |
ProxyPassword
The password for the proxy, when configured
Declaration
SecureString ProxyPassword { get; }
Property Value
Type | Description |
---|---|
SecureString |
ProxyUsername
The username for the proxy, when configured
Declaration
string ProxyUsername { get; }
Property Value
Type | Description |
---|---|
string |
QueryStringParameters
Append these query string parameters automatically to every request
Declaration
NameValueCollection QueryStringParameters { get; }
Property Value
Type | Description |
---|---|
NameValueCollection |
RequestResponseSerializer
The serializer to use to serialize requests and deserialize responses
Declaration
IOpenSearchSerializer RequestResponseSerializer { get; }
Property Value
Type | Description |
---|---|
IOpenSearchSerializer |
RequestTimeout
The timeout in milliseconds for each request to OpenSearch
Declaration
TimeSpan RequestTimeout { get; }
Property Value
Type | Description |
---|---|
TimeSpan |
ServerCertificateValidationCallback
Register a ServerCertificateValidationCallback per request
Declaration
Func<object, X509Certificate, X509Chain, SslPolicyErrors, bool> ServerCertificateValidationCallback { get; }
Property Value
Type | Description |
---|---|
Func<object, X509Certificate, X509Chain, SslPolicyErrors, bool> |
SkipDeserializationForStatusCodes
Configure the client to skip deserialization of certain status codes e.g: you run OpenSearch behind a proxy that returns an unexpected json format
Declaration
IReadOnlyCollection<int> SkipDeserializationForStatusCodes { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<int> |
SniffInformationLifeSpan
Force a new sniff for the cluster when the cluster state information is older than the specified timespan
Declaration
TimeSpan? SniffInformationLifeSpan { get; }
Property Value
Type | Description |
---|---|
TimeSpan? |
SniffsOnConnectionFault
Force a new sniff for the cluster state every time a connection dies
Declaration
bool SniffsOnConnectionFault { get; }
Property Value
Type | Description |
---|---|
bool |
SniffsOnStartup
Sniff the cluster state immediately on startup
Declaration
bool SniffsOnStartup { get; }
Property Value
Type | Description |
---|---|
bool |
StatusCodeToResponseSuccess
Allow you to override the status code inspection that sets Success
Defaults to validating the statusCode is greater or equal to 200 and less then 300
When the request is using HEAD 404 is valid out of the box as well
NOTE: if a request specifies AllowedStatusCodes this takes precedence
Declaration
Func<HttpMethod, int, bool> StatusCodeToResponseSuccess { get; }
Property Value
Type | Description |
---|---|
Func<HttpMethod, int, bool> |
ThrowExceptions
Instead of following a c/go like error checking on response.IsValid do throw an exception (except when SuccessOrKnownError is false) on the client when a call resulted in an exception on either the client or the OpenSearch server.
Reasons for such exceptions could be search parser errors, index missing exceptions, etc...
Declaration
bool ThrowExceptions { get; }
Property Value
Type | Description |
---|---|
bool |
TransferEncodingChunked
Whether the request should be sent with chunked Transfer-Encoding.
Declaration
bool TransferEncodingChunked { get; }
Property Value
Type | Description |
---|---|
bool |
UrlFormatter
Declaration
OpenSearchUrlFormatter UrlFormatter { get; }
Property Value
Type | Description |
---|---|
OpenSearchUrlFormatter |
UserAgent
The user agent string to send with requests. Useful for debugging purposes to understand client and framework versions that initiate requests to OpenSearch
Declaration
string UserAgent { get; }
Property Value
Type | Description |
---|---|
string |