Ejemplo n.º 1
0
 static async Task ReportStatus(string moduleId, MethodResponse response, AnalyzerClient analyzerClient)
 {
     try
     {
         await analyzerClient.ReportResultAsync(new TestOperationResult { Source = moduleId, Result = response.Status.ToString(), CreatedAt = DateTime.UtcNow, Type = "LegacyDirectMethod" });
     }
     catch (Exception e)
     {
         Logger.LogError(e.ToString());
     }
 }
Ejemplo n.º 2
0
 static async Task ReportStatus(string moduleId, HttpStatusCode result, AnalyzerClient analyzerClient)
 {
     try
     {
         await analyzerClient.ReportResultAsync(new TestOperationResult { Source = moduleId, Result = result.ToString(), CreatedAt = DateTime.UtcNow, Type = Enum.GetName(typeof(TestOperationResultType), TestOperationResultType.LegacyDirectMethod) });
     }
     catch (Exception e)
     {
         Logger.LogError(e.ToString());
     }
 }
Ejemplo n.º 3
0
 protected async Task CallAnalyzerToReportStatusAsync(AnalyzerClient analyzerClient, string moduleId, string status)
 {
     try
     {
         await analyzerClient.ReportResultAsync(new TestOperationResult { Source = moduleId, Result = status, CreatedAt = DateTime.UtcNow, Type = "LegacyTwin" });
     }
     catch (Exception e)
     {
         this.Logger.LogError($"Failed call to report status to analyzer: {e}");
     }
 }
Ejemplo n.º 4
0
 static async Task ReportStatus(string moduleId, CloudToDeviceMethodResult result, AnalyzerClient analyzerClient)
 {
     try
     {
         await analyzerClient.ReportResultAsync(new TestOperationResult { Source = moduleId, Result = result.Status.ToString(), CreatedAt = DateTime.UtcNow, Type = "LegacyDirectMethod" });
     }
     catch (Exception e)
     {
         Logger.LogError(e, "Failed call to report status to analyzer");
     }
 }