Skip to content

Commit

Permalink
feat(alert-sdk) : AlarmRuleService Add GetAsync (#509)
Browse files Browse the repository at this point in the history
* feat : add alert sdk

* style :  global using

* reactor : Process pr

* feat(alert-sdk) : AlarmRuleService Add GetAsync
  • Loading branch information
wzh425 authored Mar 20, 2023
1 parent e2ae2c9 commit 82f6253
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Copyright (c) MASA Stack All rights reserved.
// Licensed under the MIT License. See LICENSE.txt in the project root for license information.

namespace Masa.BuildingBlocks.StackSdks.Alert.Model;

public class AlarmRuleModel
{
public Guid Id { get; set; }

public AlarmRuleType Type { get; set; }

public string DisplayName { get; set; } = string.Empty;

public string ProjectIdentity { get; set; } = string.Empty;

public string AppIdentity { get; set; } = string.Empty;

public string ChartYAxisUnit { get; set; } = string.Empty;

public CheckFrequencyModel CheckFrequency { get; set; } = new();

public string WhereExpression { get; set; } = string.Empty;

public string QueryStr { get; set; } = string.Empty;

public int ContinuousTriggerThreshold { get; set; }

public SilenceCycleModel SilenceCycle { get; set; } = new();

public bool IsEnabled { get; set; }

public List<LogMonitorItemModel> LogMonitorItems { get; set; } = new();

public List<MetricMonitorItemModel> MetricMonitorItems { get; set; } = new();

public List<AlarmRuleItemModel> Items { get; set; } = new();

public string ModifierName { get; set; } = string.Empty;
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ public interface IAlarmRuleService
Task UpdateAsync(Guid id, AlarmRuleUpsertModel options);

Task DeleteAsync(Guid id);

Task<AlarmRuleModel?> GetAsync(Guid id);
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,10 @@ public async Task DeleteAsync(Guid id)
var requestUri = $"{_party}/{id}";
await _caller.DeleteAsync(requestUri, null);
}

public async Task<AlarmRuleModel?> GetAsync(Guid id)
{
var requestUri = $"{_party}/{id}";
return await _caller.GetAsync<AlarmRuleModel>(requestUri);
}
}

0 comments on commit 82f6253

Please sign in to comment.