Ejemplo n.º 1
0
 public override async Task<PingResult> Ping(DeploymentEnvironment target)
 {
     var url = _urlSelector(target);
     var client = new HttpClient(
         new WebRequestHandler() { 
             CachePolicy = new RequestCachePolicy(RequestCacheLevel.BypassCache) 
         });
     try
     {
         var resp = await client.GetAsync(url);
         return HttpResponseResult(url, resp);
     }
     catch (HttpRequestException hrex)
     {
         WebException wex = hrex.InnerException as WebException;
         if (wex != null)
         {
             return WebExceptionResult(url, wex);
         }
         return UnknownErrorResult(url);
     }
     catch (Exception)
     {
         return UnknownErrorResult(url);
     }
 }
Ejemplo n.º 2
0
 private EnvironmentStatus CreateStatus(DeploymentEnvironment env, IList<PingResult> pings)
 {
     return new EnvironmentStatus()
     {
         Title = env.Title,
         Name = env.Name,
         Description = env.Description,
         Url = env.Url,
         PingResults = pings ?? new List<PingResult>()
     };
 }
Ejemplo n.º 3
0
 public abstract Task<PingResult> Ping(DeploymentEnvironment target);
Ejemplo n.º 4
0
 private EnvironmentStatus CreateStatus(DeploymentEnvironment env)
 {
     return CreateStatus(env, null);
 }