C# Class ServiceStack.Discovery.Consul.ConsulClient

Consul client deals with consul api calls
Exibir arquivo Open project: MacLeanElectrical/servicestack-discovery-consul Class Usage Examples

Public Methods

Method Description
GetService ( string serviceName, string tagName ) : ConsulServiceResponse

Gets the service

GetServices ( string serviceName ) : ServiceStack.Discovery.Consul.ConsulServiceResponse[]

Returns a list of catalog services and tags

RegisterHealthChecks ( ) : void

Registers service health checks with consul

RegisterService ( ServiceRegistration registration ) : void

Registers the servicestack apphost with the local consul agent

UnregisterService ( string serviceId ) : void

Removes a service registation (and it's associated health checks) from consul

Private Methods

Method Description
GetConsulServiceResponses ( string response ) : ServiceStack.Discovery.Consul.ConsulServiceResponse[]

Method Details

GetService() public static method

Gets the service
throws exception if no service available for dto
public static GetService ( string serviceName, string tagName ) : ConsulServiceResponse
serviceName string The global service name for servicestack services
tagName string the tagName to find the service for
return ConsulServiceResponse

GetServices() public static method

Returns a list of catalog services and tags
throws exception if unable to get services
public static GetServices ( string serviceName ) : ServiceStack.Discovery.Consul.ConsulServiceResponse[]
serviceName string
return ServiceStack.Discovery.Consul.ConsulServiceResponse[]

RegisterHealthChecks() public static method

Registers service health checks with consul
throws exception if unable to register health checks
public static RegisterHealthChecks ( ) : void
return void

RegisterService() public static method

Registers the servicestack apphost with the local consul agent
throws exception if registration was not successful
public static RegisterService ( ServiceRegistration registration ) : void
registration ServiceRegistration
return void

UnregisterService() public static method

Removes a service registation (and it's associated health checks) from consul
throws exception if unregistration was not successful
public static UnregisterService ( string serviceId ) : void
serviceId string the id of the service to unregister
return void