Beispiel #1
0
 public Task <CreateHealthCheckResponse> CreateHealthCheckAsync(
     string name,
     string uri,
     int port,
     string path,
     string searchString = null,
     int failureTreshold = 1,
     CancellationToken cancellationToken = default(CancellationToken))
 => _locker.Lock(() => _client.CreateHealthCheckAsync(new CreateHealthCheckRequest()
 {
     CallerReference   = name,
     HealthCheckConfig = new HealthCheckConfig()
     {
         FullyQualifiedDomainName = uri,
         Port             = port,
         ResourcePath     = path,
         RequestInterval  = 10,
         FailureThreshold = failureTreshold,
         SearchString     = searchString,
         Type             = searchString.IsNullOrEmpty() ? HealthCheckType.HTTP : HealthCheckType.HTTP_STR_MATCH,
         EnableSNI        = false,
         MeasureLatency   = false,
     }
 }, cancellationToken).EnsureAnyStatusCodeAsync(System.Net.HttpStatusCode.OK, System.Net.HttpStatusCode.Created));