Родитель
e2854f6782
Коммит
070663dfcc
|
@ -84,7 +84,17 @@ namespace Microsoft.Azure.IoTSolutions.DeviceSimulation.Services.AzureManagement
|
|||
|
||||
this.ThrowIfError(response);
|
||||
|
||||
return JsonConvert.DeserializeObject<MetricsResponseListModel>(response.Content);
|
||||
var metricsResponseList = JsonConvert.DeserializeObject<MetricsResponseListModel>(response.Content);
|
||||
|
||||
foreach (var responseModel in metricsResponseList.Responses)
|
||||
{
|
||||
if (responseModel.Content.Error != null)
|
||||
{
|
||||
throw new ExternalDependencyException(responseModel.Content.Error.Message);
|
||||
}
|
||||
}
|
||||
|
||||
return metricsResponseList;
|
||||
}
|
||||
|
||||
private bool AccessTokenIsNullOrEmpty()
|
||||
|
|
|
@ -33,6 +33,18 @@ namespace Microsoft.Azure.IoTSolutions.DeviceSimulation.Services.AzureManagement
|
|||
|
||||
[JsonProperty("message", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string Message { get; set; }
|
||||
|
||||
[JsonProperty("error", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public MetricContentErrorModel Error { get; set; }
|
||||
}
|
||||
|
||||
public class MetricContentErrorModel
|
||||
{
|
||||
[JsonProperty("code")]
|
||||
public string Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string Message { get; set; }
|
||||
}
|
||||
|
||||
public class MetricValueModel
|
||||
|
|
|
@ -157,9 +157,9 @@ namespace Microsoft.Azure.IoTSolutions.DeviceSimulation.WebService.v1.Models.Sim
|
|||
Running = value.ShouldBeRunning,
|
||||
ActiveNow = value.IsActiveNow,
|
||||
DeleteDevicesWhenSimulationEnds = value.DeleteDevicesWhenSimulationEnds,
|
||||
StartTime = value.StartTime.ToString(),
|
||||
EndTime = value.EndTime.ToString(),
|
||||
StoppedTime = value.StoppedTime.ToString(),
|
||||
StartTime = value.StartTime?.ToString(DATE_FORMAT),
|
||||
EndTime = value.EndTime?.ToString(DATE_FORMAT),
|
||||
StoppedTime = value.StoppedTime?.ToString(DATE_FORMAT),
|
||||
IotHubs = new List<SimulationIotHub>()
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче