Class: TencentCloud::Monitor::V20180724::PrometheusAlertGroupRuleSet

Inherits:
Common::AbstractModel
  • Object
show all
Defined in:
lib/v20180724/models.rb

Overview

告警分组内告警规则信息

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rulename = nil, labels = nil, annotations = nil, duration = nil, expr = nil, state = nil) ⇒ PrometheusAlertGroupRuleSet

Returns a new instance of PrometheusAlertGroupRuleSet.



12959
12960
12961
12962
12963
12964
12965
12966
# File 'lib/v20180724/models.rb', line 12959

def initialize(rulename=nil, labels=nil, annotations=nil, duration=nil, expr=nil, state=nil)
  @RuleName = rulename
  @Labels = labels
  @Annotations = annotations
  @Duration = duration
  @Expr = expr
  @State = state
end

Instance Attribute Details

#AnnotationsObject

告警对象和告警消息是 Prometheus Rule Annotations 的特殊字段,需要通过 annotations 来传递,对应的 Key 分别为summary/description。 注意:此字段可能返回 null,表示取不到有效值。 注意:此字段可能返回 null,表示取不到有效值。 注意:此字段可能返回 null,表示取不到有效值。 2-启用 3-禁用 为空默认启用 注意:此字段可能返回 null,表示取不到有效值。

Parameters:

  • Duration:

    规则报警持续时间

  • Expr:

    规则表达式,可参考告警规则说明

  • State:

    告警规则状态:



12957
12958
12959
# File 'lib/v20180724/models.rb', line 12957

def Annotations
  @Annotations
end

#DurationObject

告警对象和告警消息是 Prometheus Rule Annotations 的特殊字段,需要通过 annotations 来传递,对应的 Key 分别为summary/description。 注意:此字段可能返回 null,表示取不到有效值。 注意:此字段可能返回 null,表示取不到有效值。 注意:此字段可能返回 null,表示取不到有效值。 2-启用 3-禁用 为空默认启用 注意:此字段可能返回 null,表示取不到有效值。

Parameters:

  • Duration:

    规则报警持续时间

  • Expr:

    规则表达式,可参考告警规则说明

  • State:

    告警规则状态:



12957
12958
12959
# File 'lib/v20180724/models.rb', line 12957

def Duration
  @Duration
end

#ExprObject

告警对象和告警消息是 Prometheus Rule Annotations 的特殊字段,需要通过 annotations 来传递,对应的 Key 分别为summary/description。 注意:此字段可能返回 null,表示取不到有效值。 注意:此字段可能返回 null,表示取不到有效值。 注意:此字段可能返回 null,表示取不到有效值。 2-启用 3-禁用 为空默认启用 注意:此字段可能返回 null,表示取不到有效值。

Parameters:

  • Duration:

    规则报警持续时间

  • Expr:

    规则表达式,可参考告警规则说明

  • State:

    告警规则状态:



12957
12958
12959
# File 'lib/v20180724/models.rb', line 12957

def Expr
  @Expr
end

#LabelsObject

告警对象和告警消息是 Prometheus Rule Annotations 的特殊字段,需要通过 annotations 来传递,对应的 Key 分别为summary/description。 注意:此字段可能返回 null,表示取不到有效值。 注意:此字段可能返回 null,表示取不到有效值。 注意:此字段可能返回 null,表示取不到有效值。 2-启用 3-禁用 为空默认启用 注意:此字段可能返回 null,表示取不到有效值。

Parameters:

  • Duration:

    规则报警持续时间

  • Expr:

    规则表达式,可参考告警规则说明

  • State:

    告警规则状态:



12957
12958
12959
# File 'lib/v20180724/models.rb', line 12957

def Labels
  @Labels
end

#RuleNameObject

告警对象和告警消息是 Prometheus Rule Annotations 的特殊字段,需要通过 annotations 来传递,对应的 Key 分别为summary/description。 注意:此字段可能返回 null,表示取不到有效值。 注意:此字段可能返回 null,表示取不到有效值。 注意:此字段可能返回 null,表示取不到有效值。 2-启用 3-禁用 为空默认启用 注意:此字段可能返回 null,表示取不到有效值。

Parameters:

  • Duration:

    规则报警持续时间

  • Expr:

    规则表达式,可参考告警规则说明

  • State:

    告警规则状态:



12957
12958
12959
# File 'lib/v20180724/models.rb', line 12957

def RuleName
  @RuleName
end

#StateObject

告警对象和告警消息是 Prometheus Rule Annotations 的特殊字段,需要通过 annotations 来传递,对应的 Key 分别为summary/description。 注意:此字段可能返回 null,表示取不到有效值。 注意:此字段可能返回 null,表示取不到有效值。 注意:此字段可能返回 null,表示取不到有效值。 2-启用 3-禁用 为空默认启用 注意:此字段可能返回 null,表示取不到有效值。

Parameters:

  • Duration:

    规则报警持续时间

  • Expr:

    规则表达式,可参考告警规则说明

  • State:

    告警规则状态:



12957
12958
12959
# File 'lib/v20180724/models.rb', line 12957

def State
  @State
end

Instance Method Details

#deserialize(params) ⇒ Object



12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
# File 'lib/v20180724/models.rb', line 12968

def deserialize(params)
  @RuleName = params['RuleName']
  unless params['Labels'].nil?
    @Labels = []
    params['Labels'].each do |i|
      prometheusrulekv_tmp = PrometheusRuleKV.new
      prometheusrulekv_tmp.deserialize(i)
      @Labels << prometheusrulekv_tmp
    end
  end
  unless params['Annotations'].nil?
    @Annotations = []
    params['Annotations'].each do |i|
      prometheusrulekv_tmp = PrometheusRuleKV.new
      prometheusrulekv_tmp.deserialize(i)
      @Annotations << prometheusrulekv_tmp
    end
  end
  @Duration = params['Duration']
  @Expr = params['Expr']
  @State = params['State']
end