add responseTimesAverage
This commit is contained in:
@@ -16,8 +16,9 @@ namespace UptimeSharp
|
|||||||
/// Retrieves specified monitors from UptimeRobot
|
/// Retrieves specified monitors from UptimeRobot
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="monitorIDs">The monitor IDs.</param>
|
/// <param name="monitorIDs">The monitor IDs.</param>
|
||||||
/// <param name="customUptimeRatio">The custom uptime ratio.</param>
|
|
||||||
/// <param name="includeDetails">if set to <c>true</c> [include details (log, alerts and response times)].</param>
|
/// <param name="includeDetails">if set to <c>true</c> [include details (log, alerts and response times)].</param>
|
||||||
|
/// <param name="customUptimeRatio">The custom uptime ratio.</param>
|
||||||
|
/// <param name="responseTimesAverage">The response times average in minutes, which is used as the calculation base for the response times.</param>
|
||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// Monitor List
|
/// Monitor List
|
||||||
@@ -25,8 +26,9 @@ namespace UptimeSharp
|
|||||||
/// <exception cref="UptimeSharpException"></exception>
|
/// <exception cref="UptimeSharpException"></exception>
|
||||||
public async Task<List<Models.Monitor>> GetMonitors(
|
public async Task<List<Models.Monitor>> GetMonitors(
|
||||||
string[] monitorIDs = null,
|
string[] monitorIDs = null,
|
||||||
float[] customUptimeRatio = null,
|
|
||||||
bool includeDetails = true,
|
bool includeDetails = true,
|
||||||
|
float[] customUptimeRatio = null,
|
||||||
|
int responseTimesAverage = 0,
|
||||||
CancellationToken cancellationToken = default(CancellationToken))
|
CancellationToken cancellationToken = default(CancellationToken))
|
||||||
{
|
{
|
||||||
RetrieveParameters parameters = new RetrieveParameters()
|
RetrieveParameters parameters = new RetrieveParameters()
|
||||||
@@ -35,7 +37,8 @@ namespace UptimeSharp
|
|||||||
CustomUptimeRatio = customUptimeRatio,
|
CustomUptimeRatio = customUptimeRatio,
|
||||||
ShowAlerts = includeDetails,
|
ShowAlerts = includeDetails,
|
||||||
ShowLog = includeDetails,
|
ShowLog = includeDetails,
|
||||||
ShowResponseTimes = includeDetails
|
ShowResponseTimes = includeDetails,
|
||||||
|
ResponseTimeAverage = responseTimesAverage
|
||||||
};
|
};
|
||||||
|
|
||||||
RetrieveResponse response = await Request<RetrieveResponse>("getMonitors", cancellationToken, parameters.Convert());
|
RetrieveResponse response = await Request<RetrieveResponse>("getMonitors", cancellationToken, parameters.Convert());
|
||||||
@@ -48,8 +51,9 @@ namespace UptimeSharp
|
|||||||
/// Retrieves a monitor from UptimeRobot
|
/// Retrieves a monitor from UptimeRobot
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="monitorId">a specific monitor ID</param>
|
/// <param name="monitorId">a specific monitor ID</param>
|
||||||
/// <param name="customUptimeRatio">The custom uptime ratio.</param>
|
|
||||||
/// <param name="includeDetails">if set to <c>true</c> [include details (log, alerts and response times)].</param>
|
/// <param name="includeDetails">if set to <c>true</c> [include details (log, alerts and response times)].</param>
|
||||||
|
/// <param name="customUptimeRatio">The custom uptime ratio.</param>
|
||||||
|
/// <param name="responseTimesAverage">The response times average in minutes, which is used as the calculation base for the response times.</param>
|
||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// The Monitor
|
/// The Monitor
|
||||||
@@ -57,11 +61,12 @@ namespace UptimeSharp
|
|||||||
/// <exception cref="UptimeSharpException"></exception>
|
/// <exception cref="UptimeSharpException"></exception>
|
||||||
public async Task<Models.Monitor> GetMonitor(
|
public async Task<Models.Monitor> GetMonitor(
|
||||||
string monitorId,
|
string monitorId,
|
||||||
float[] customUptimeRatio = null,
|
|
||||||
bool includeDetails = true,
|
bool includeDetails = true,
|
||||||
|
float[] customUptimeRatio = null,
|
||||||
|
int responseTimesAverage = 0,
|
||||||
CancellationToken cancellationToken = default(CancellationToken))
|
CancellationToken cancellationToken = default(CancellationToken))
|
||||||
{
|
{
|
||||||
List<Models.Monitor> monitors = await GetMonitors(new string[] { monitorId }, customUptimeRatio, includeDetails, cancellationToken);
|
List<Models.Monitor> monitors = await GetMonitors(new string[] { monitorId }, includeDetails, customUptimeRatio, responseTimesAverage, cancellationToken);
|
||||||
|
|
||||||
return monitors != null && monitors.Count > 0 ? monitors[0] : null;
|
return monitors != null && monitors.Count > 0 ? monitors[0] : null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,8 +31,9 @@ namespace UptimeSharp
|
|||||||
/// Retrieves specified monitors from UptimeRobot
|
/// Retrieves specified monitors from UptimeRobot
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="monitorIDs">The monitor IDs.</param>
|
/// <param name="monitorIDs">The monitor IDs.</param>
|
||||||
/// <param name="customUptimeRatio">The custom uptime ratio.</param>
|
|
||||||
/// <param name="includeDetails">if set to <c>true</c> [include details (log, alerts and response times)].</param>
|
/// <param name="includeDetails">if set to <c>true</c> [include details (log, alerts and response times)].</param>
|
||||||
|
/// <param name="customUptimeRatio">The custom uptime ratio.</param>
|
||||||
|
/// <param name="responseTimesAverage">The response times average in minutes, which is used as the calculation base for the response times.</param>
|
||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// Monitor List
|
/// Monitor List
|
||||||
@@ -40,16 +41,18 @@ namespace UptimeSharp
|
|||||||
/// <exception cref="UptimeSharpException"></exception>
|
/// <exception cref="UptimeSharpException"></exception>
|
||||||
Task<List<Models.Monitor>> GetMonitors(
|
Task<List<Models.Monitor>> GetMonitors(
|
||||||
string[] monitorIDs = null,
|
string[] monitorIDs = null,
|
||||||
float[] customUptimeRatio = null,
|
|
||||||
bool includeDetails = true,
|
bool includeDetails = true,
|
||||||
|
float[] customUptimeRatio = null,
|
||||||
|
int responseTimesAverage = 0,
|
||||||
CancellationToken cancellationToken = default(CancellationToken));
|
CancellationToken cancellationToken = default(CancellationToken));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Retrieves a monitor from UptimeRobot
|
/// Retrieves a monitor from UptimeRobot
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="monitorId">a specific monitor ID</param>
|
/// <param name="monitorId">a specific monitor ID</param>
|
||||||
/// <param name="customUptimeRatio">The custom uptime ratio.</param>
|
|
||||||
/// <param name="includeDetails">if set to <c>true</c> [include details (log, alerts and response times)].</param>
|
/// <param name="includeDetails">if set to <c>true</c> [include details (log, alerts and response times)].</param>
|
||||||
|
/// <param name="customUptimeRatio">The custom uptime ratio.</param>
|
||||||
|
/// <param name="responseTimesAverage">The response times average in minutes, which is used as the calculation base for the response times.</param>
|
||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// The Monitor
|
/// The Monitor
|
||||||
@@ -57,8 +60,9 @@ namespace UptimeSharp
|
|||||||
/// <exception cref="UptimeSharpException"></exception>
|
/// <exception cref="UptimeSharpException"></exception>
|
||||||
Task<Models.Monitor> GetMonitor(
|
Task<Models.Monitor> GetMonitor(
|
||||||
string monitorId,
|
string monitorId,
|
||||||
float[] customUptimeRatio = null,
|
|
||||||
bool includeDetails = true,
|
bool includeDetails = true,
|
||||||
|
float[] customUptimeRatio = null,
|
||||||
|
int responseTimesAverage = 0,
|
||||||
CancellationToken cancellationToken = default(CancellationToken));
|
CancellationToken cancellationToken = default(CancellationToken));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ namespace UptimeSharp.Models
|
|||||||
/// The response time interval.
|
/// The response time interval.
|
||||||
/// </value>
|
/// </value>
|
||||||
[DataMember(Name = "responseTimesAverage")]
|
[DataMember(Name = "responseTimesAverage")]
|
||||||
public int? ResponseTimeInterval { get; set; }
|
public int? ResponseTimeAverage { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Converts an object to a list of HTTP Get parameters.
|
/// Converts an object to a list of HTTP Get parameters.
|
||||||
|
|||||||
Reference in New Issue
Block a user