Class EurekaClient
Sends HTTP requests to Eureka servers.
public sealed class EurekaClient
- Inheritance
-
EurekaClient
- Inherited Members
Constructors
EurekaClient(IHttpClientFactory, IOptionsMonitor<EurekaClientOptions>, EurekaServiceUriStateManager, TimeProvider, ILogger<EurekaClient>)
public EurekaClient(IHttpClientFactory httpClientFactory, IOptionsMonitor<EurekaClientOptions> optionsMonitor, EurekaServiceUriStateManager eurekaServiceUriStateManager, TimeProvider timeProvider, ILogger<EurekaClient> logger)
Parameters
httpClientFactoryIHttpClientFactoryoptionsMonitorIOptionsMonitor<EurekaClientOptions>eurekaServiceUriStateManagerEurekaServiceUriStateManagertimeProviderTimeProviderloggerILogger<EurekaClient>
Methods
DeregisterAsync(string, string, CancellationToken)
Deregisters an application instance.
public Task DeregisterAsync(string appName, string instanceId, CancellationToken cancellationToken)
Parameters
appNamestringThe name of the app to deregister.
instanceIdstringThe ID of the instance to deregister.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
Exceptions
- EurekaTransportException
The operation failed because none of the Eureka servers responded with success.
GetApplicationsAsync(CancellationToken)
Queries for all application instances.
public Task<ApplicationInfoCollection> GetApplicationsAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
Exceptions
- EurekaTransportException
The operation failed because none of the Eureka servers responded with success.
GetByVipAsync(string, CancellationToken)
Queries for all application instances under a particular VIP address.
public Task<ApplicationInfoCollection> GetByVipAsync(string vipAddress, CancellationToken cancellationToken)
Parameters
vipAddressstringThe Virtual Internet Protocol address whose instances to return.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
Exceptions
- EurekaTransportException
The operation failed because none of the Eureka servers responded with success.
GetDeltaAsync(CancellationToken)
Queries for a delta of all application instances.
public Task<ApplicationInfoCollection> GetDeltaAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
Exceptions
- EurekaTransportException
The operation failed because none of the Eureka servers responded with success.
HeartbeatAsync(string, string, DateTime?, CancellationToken)
Sends a heartbeat for an application instance.
public Task HeartbeatAsync(string appName, string instanceId, DateTime? lastDirtyTimeUtc, CancellationToken cancellationToken)
Parameters
appNamestringThe name of the app to send a heartbeat for.
instanceIdstringThe ID of the instance to send a heartbeat for.
lastDirtyTimeUtcDateTime?The date and time (in UTC) when the instance was last dirty.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
Exceptions
- EurekaTransportException
The operation failed because none of the Eureka servers responded with success.
RegisterAsync(InstanceInfo, CancellationToken)
Registers an application instance.
public Task RegisterAsync(InstanceInfo instance, CancellationToken cancellationToken)
Parameters
instanceInstanceInfoThe instance to register.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
Exceptions
- EurekaTransportException
The operation failed because none of the Eureka servers responded with success.