Table of Contents

Class EurekaClient

Namespace
Steeltoe.Discovery.Eureka
Assembly
Steeltoe.Discovery.Eureka.dll

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 IHttpClientFactory
optionsMonitor IOptionsMonitor<EurekaClientOptions>
eurekaServiceUriStateManager EurekaServiceUriStateManager
timeProvider TimeProvider
logger ILogger<EurekaClient>

Methods

DeregisterAsync(string, string, CancellationToken)

Deregisters an application instance.

public Task DeregisterAsync(string appName, string instanceId, CancellationToken cancellationToken)

Parameters

appName string

The name of the app to deregister.

instanceId string

The ID of the instance to deregister.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task

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 CancellationToken

The token to monitor for cancellation requests.

Returns

Task<ApplicationInfoCollection>

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 string

The Virtual Internet Protocol address whose instances to return.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task<ApplicationInfoCollection>

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 CancellationToken

The token to monitor for cancellation requests.

Returns

Task<ApplicationInfoCollection>

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 string

The name of the app to send a heartbeat for.

instanceId string

The ID of the instance to send a heartbeat for.

lastDirtyTimeUtc DateTime?

The date and time (in UTC) when the instance was last dirty.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task

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 InstanceInfo

The instance to register.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task

Exceptions

EurekaTransportException

The operation failed because none of the Eureka servers responded with success.