Skip to content

Commit e74e84b

Browse files
author
mwatson
committed
Support enabling/disabling server level alerts
1 parent 3656c9a commit e74e84b

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

Dlls/StackifyLib/StackifyLib.dll

10 KB
Binary file not shown.

Src/StackifyLib/Models/MonitorModels.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public class Device
1414
public int? EnvId { get; set; }
1515
public string Loc { get; set; }
1616
public int? LocId { get; set; }
17+
public string Alerts { get; set; }
1718
}
1819

1920
public class Monitor

Src/StackifyLib/Monitors.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,23 @@ public Models.Device[] GetDeviceList()
3030
}
3131
}
3232

33+
public bool? ConfigureAlerts(Dictionary<int, string> devices)
34+
{
35+
Utils.HttpClient client = new HttpClient(null, null);
36+
var response = client.SendAndGetResponse(System.Web.VirtualPathUtility.AppendTrailingSlash(client.BaseAPIUrl) +
37+
"API/Device/ConfigureAlerts",
38+
JsonConvert.SerializeObject(devices));
39+
40+
if (response.StatusCode == HttpStatusCode.OK)
41+
{
42+
return JsonConvert.DeserializeObject<bool>(response.ResponseText);
43+
}
44+
else
45+
{
46+
return null;
47+
}
48+
}
49+
3350
public Models.Monitor[] GetDeviceMonitors(int clientDeviceId)
3451
{
3552
Utils.HttpClient client = new HttpClient(null, null);

0 commit comments

Comments
 (0)