示例#1
0
        public async void SetAlertThreshold()
        {
            var deviceGroup = await PortalClient
                              .GetDeviceGroupByFullPathAsync(DeviceGroupFullPath)
                              .ConfigureAwait(false);

            var dataSource = await PortalClient
                             .GetByNameAsync <DataSource>("Ping")
                             .ConfigureAwait(false);

            var datapoints = (await PortalClient
                              .GetDataSourceDataPointsPageAsync(dataSource.Id, new Filters.Filter <DataSourceDataPoint> {
                Skip = 0, Take = 10
            })
                              .ConfigureAwait(false)).Items;
            var datapoint = datapoints.Single(dp => dp.Name == "average");
            await PortalClient
            .SetDeviceGroupDataSourceDataPointThresholds(
                deviceGroup.Id,
                dataSource.Id,
                datapoint.Id,
                "> 191 timezone=Europe/London",
                $"Set by LogicMonitor.Api Unit Test at {DateTimeOffset.UtcNow}",
                true
                )
            .ConfigureAwait(false);

            Assert.NotEqual(AlertStatus.Unknown, deviceGroup.AlertStatus);
        }