private static JToken GetOneAlert(ISwisClient swisClient) { const string query = @"SELECT TOP 1 AlertDefID, ActiveObject, ObjectType FROM Orion.AlertStatus WHERE Acknowledged=0 ORDER BY TriggerTimeStamp DESC"; JToken queryResult = swisClient.QueryAsync(query).Result; Console.WriteLine(queryResult); var alert = queryResult["results"][0]; return(alert); }
private static int GetOneAlert(ISwisClient swisClient) { const string query = @"SELECT TOP 1 AlertObjectID FROM Orion.AlertActive WHERE ISNULL(Acknowledged,0)!=1 ORDER BY TriggeredDateTime DESC"; JToken queryResult = swisClient.QueryAsync(query).Result; Console.WriteLine(queryResult); var alertObjectId = (int)queryResult["results"][0]["AlertObjectID"]; return(alertObjectId); }