internal ThresholdRuleCondition(string odataType, RuleDataSource dataSource, ConditionOperator @operator, double threshold, TimeSpan?windowSize, TimeAggregationOperator?timeAggregation) : base(odataType, dataSource)
 {
     Operator        = @operator;
     Threshold       = threshold;
     WindowSize      = windowSize;
     TimeAggregation = timeAggregation;
     OdataType       = odataType ?? "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition";
 }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the ThresholdRuleCondition class.
 /// </summary>
 /// <param name="operatorProperty">the operator used to compare the
 /// data and the threshold. Possible values include: 'GreaterThan',
 /// 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual'</param>
 /// <param name="threshold">the threshold value that activates the
 /// alert.</param>
 /// <param name="dataSource">the resource from which the rule collects
 /// its data. For this type dataSource will always be of type
 /// RuleMetricDataSource.</param>
 /// <param name="windowSize">the period of time (in ISO 8601 duration
 /// format) that is used to monitor alert activity based on the
 /// threshold. If specified then it must be between 5 minutes and 1
 /// day.</param>
 /// <param name="timeAggregation">the time aggregation operator. How
 /// the data that are collected should be combined over time. The
 /// default value is the PrimaryAggregationType of the Metric. Possible
 /// values include: 'Average', 'Minimum', 'Maximum', 'Total',
 /// 'Last'</param>
 public ThresholdRuleCondition(ConditionOperator operatorProperty, double threshold, RuleDataSource dataSource = default(RuleDataSource), System.TimeSpan? windowSize = default(System.TimeSpan?), TimeAggregationOperator? timeAggregation = default(TimeAggregationOperator?))
 {
     DataSource = dataSource;
     OperatorProperty = operatorProperty;
     Threshold = threshold;
     WindowSize = windowSize;
     TimeAggregation = timeAggregation;
 }
 /// <summary>
 /// Initializes a new instance of the RuleCondition class.
 /// </summary>
 /// <param name="ruleCondition">The RuleCondition object</param>
 public ThresholdRuleCondition(Monitor.Models.ThresholdRuleCondition ruleCondition)
     : base()
 {
     if (ruleCondition != null)
     {
         this.DataSource       = ruleCondition.DataSource != null ? new RuleDataSource(ruleCondition.DataSource) : null;
         this.OperatorProperty = TransitionHelpers.ConvertNamespace(ruleCondition.OperatorProperty);
         this.Threshold        = ruleCondition.Threshold;
         this.WindowSize       = ruleCondition.WindowSize;
         this.TimeAggregation  = TransitionHelpers.ConvertNamespace(ruleCondition.TimeAggregation);
     }
 }
 internal static string ToSerializedValue(this TimeAggregationOperator?value) =>
 value == null ? null : ((TimeAggregationOperator)value).ToSerializedValue();
Beispiel #5
0
        static public Management.Monitor.Management.Models.TimeAggregationOperator?ConvertNamespace(TimeAggregationOperator? operatorType)
        {
            if (operatorType.HasValue)
            {
                int value = (int)operatorType;
                return((Management.Monitor.Management.Models.TimeAggregationOperator)value);
            }

            return(null);
        }