Class: TencentCloud::Monitor::V20180724::CreateAlertRuleRequest

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

Overview

CreateAlertRule请求参数结构体

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(instanceid = nil, rulename = nil, expr = nil, receivers = nil, rulestate = nil, duration = nil, labels = nil, annotations = nil, type = nil) ⇒ CreateAlertRuleRequest

Returns a new instance of CreateAlertRuleRequest.



1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
# File 'lib/v20180724/models.rb', line 1936

def initialize(instanceid=nil, rulename=nil, expr=nil, receivers=nil, rulestate=nil, duration=nil, labels=nil, annotations=nil, type=nil)
  @InstanceId = instanceid
  @RuleName = rulename
  @Expr = expr
  @Receivers = receivers
  @RuleState = rulestate
  @Duration = duration
  @Labels = labels
  @Annotations = annotations
  @Type = type
end

Instance Attribute Details

#AnnotationsObject

告警对象和告警消息是 Prometheus Rule Annotations 的特殊字段,需要通过 annotations 来传递,对应的 Key 分别为summary/description。

Parameters:

  • Type:

    报警策略模板分类



1934
1935
1936
# File 'lib/v20180724/models.rb', line 1934

def Annotations
  @Annotations
end

#DurationObject

告警对象和告警消息是 Prometheus Rule Annotations 的特殊字段,需要通过 annotations 来传递,对应的 Key 分别为summary/description。

Parameters:

  • Type:

    报警策略模板分类



1934
1935
1936
# File 'lib/v20180724/models.rb', line 1934

def Duration
  @Duration
end

#ExprObject

告警对象和告警消息是 Prometheus Rule Annotations 的特殊字段,需要通过 annotations 来传递,对应的 Key 分别为summary/description。

Parameters:

  • Type:

    报警策略模板分类



1934
1935
1936
# File 'lib/v20180724/models.rb', line 1934

def Expr
  @Expr
end

#InstanceIdObject

告警对象和告警消息是 Prometheus Rule Annotations 的特殊字段,需要通过 annotations 来传递,对应的 Key 分别为summary/description。

Parameters:

  • Type:

    报警策略模板分类



1934
1935
1936
# File 'lib/v20180724/models.rb', line 1934

def InstanceId
  @InstanceId
end

#LabelsObject

告警对象和告警消息是 Prometheus Rule Annotations 的特殊字段,需要通过 annotations 来传递,对应的 Key 分别为summary/description。

Parameters:

  • Type:

    报警策略模板分类



1934
1935
1936
# File 'lib/v20180724/models.rb', line 1934

def Labels
  @Labels
end

#ReceiversObject

告警对象和告警消息是 Prometheus Rule Annotations 的特殊字段,需要通过 annotations 来传递,对应的 Key 分别为summary/description。

Parameters:

  • Type:

    报警策略模板分类



1934
1935
1936
# File 'lib/v20180724/models.rb', line 1934

def Receivers
  @Receivers
end

#RuleNameObject

告警对象和告警消息是 Prometheus Rule Annotations 的特殊字段,需要通过 annotations 来传递,对应的 Key 分别为summary/description。

Parameters:

  • Type:

    报警策略模板分类



1934
1935
1936
# File 'lib/v20180724/models.rb', line 1934

def RuleName
  @RuleName
end

#RuleStateObject

告警对象和告警消息是 Prometheus Rule Annotations 的特殊字段,需要通过 annotations 来传递,对应的 Key 分别为summary/description。

Parameters:

  • Type:

    报警策略模板分类



1934
1935
1936
# File 'lib/v20180724/models.rb', line 1934

def RuleState
  @RuleState
end

#TypeObject

告警对象和告警消息是 Prometheus Rule Annotations 的特殊字段,需要通过 annotations 来传递,对应的 Key 分别为summary/description。

Parameters:

  • Type:

    报警策略模板分类



1934
1935
1936
# File 'lib/v20180724/models.rb', line 1934

def Type
  @Type
end

Instance Method Details

#deserialize(params) ⇒ Object



1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
# File 'lib/v20180724/models.rb', line 1948

def deserialize(params)
  @InstanceId = params['InstanceId']
  @RuleName = params['RuleName']
  @Expr = params['Expr']
  @Receivers = params['Receivers']
  @RuleState = params['RuleState']
  @Duration = params['Duration']
  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
  @Type = params['Type']
end