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
httpClientFactory
IHttpClientFactoryoptionsMonitor
IOptionsMonitor<EurekaClientOptions>eurekaServiceUriStateManager
EurekaServiceUriStateManagertimeProvider
TimeProviderlogger
ILogger<EurekaClient>
Methods
DeregisterAsync(string, string, CancellationToken)
Deregisters an application instance.
public Task DeregisterAsync(string appName, string instanceId, CancellationToken cancellationToken)
Parameters
appName
stringThe name of the app to deregister.
instanceId
stringThe ID of the instance to deregister.
cancellationToken
CancellationTokenThe 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
cancellationToken
CancellationTokenThe 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
vipAddress
stringThe Virtual Internet Protocol address whose instances to return.
cancellationToken
CancellationTokenThe 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
cancellationToken
CancellationTokenThe 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
appName
stringThe name of the app to send a heartbeat for.
instanceId
stringThe ID of the instance to send a heartbeat for.
lastDirtyTimeUtc
DateTime?The date and time (in UTC) when the instance was last dirty.
cancellationToken
CancellationTokenThe 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
instance
InstanceInfoThe instance to register.
cancellationToken
CancellationTokenThe token to monitor for cancellation requests.
Returns
Exceptions
- EurekaTransportException
The operation failed because none of the Eureka servers responded with success.