Exemple #1
0
        public SloTarget(Dictionary <object, object> target)
        {
            if (target.ContainsKey("target-percentile"))
            {
                TargetPercentile = SloValidator.GetString(this.GetType().Name, target, "target-percentile");
            }

            TargetValue = SloValidator.GetString(this.GetType().Name, target, "target-value");
            Comparator  = SloValidator.GetString(this.GetType().Name, target, "comparator");
        }
Exemple #2
0
 public Slo(Dictionary <object, object> slo)
 {
     Name        = SloValidator.GetString(this.GetType().Name, slo, "name");
     SourceId    = SloValidator.GetString(this.GetType().Name, slo, "source-id");
     Description = SloValidator.GetString(this.GetType().Name, slo, "description");
     Namespace   = SloValidator.GetString(this.GetType().Name, slo, "namespace", false);
     Signal      = SloValidator.GetString(this.GetType().Name, slo, "signal");
     Window      = SloValidator.GetString(this.GetType().Name, slo, "window");
     Category    = SloValidator.GetString(this.GetType().Name, slo, "category", false);
     Targets     = SloTarget.ParseList(SloValidator.GetList(this.GetType().Name, slo, "targets"));
 }
Exemple #3
0
        public SloDataSource(Dictionary <object, object> dataSource)
        {
            Id   = SloValidator.GetString(this.GetType().Name, dataSource, "id");
            Type = SloValidator.GetString(this.GetType().Name, dataSource, "type");
            //AccountIds = SloDataSourceAccountId.ParseList(SloValidator.GetList(this.GetType().Name, dataSource, "accountids"));

            try
            {
                AccountIds = SloDataSourceAccountId.ParseList(SloValidator.GetList(this.GetType().Name, dataSource, "accountids"));
            }
            catch (Exception)
            {
                AccountIds = new List <SloDataSourceAccountId>();
            }
        }
Exemple #4
0
 public SloDataSource(Dictionary <object, object> dataSource)
 {
     Id         = SloValidator.GetString(this.GetType().Name, dataSource, "id");
     Type       = SloValidator.GetString(this.GetType().Name, dataSource, "type");
     AccountIds = SloDataSourceAccountId.ParseList(SloValidator.GetList(this.GetType().Name, dataSource, "accountids"));
 }
Exemple #5
0
 public SloGroup(Dictionary <object, object> sloGroup)
 {
     Name  = SloValidator.GetString(this.GetType().Name, sloGroup, "name");
     State = SloValidator.GetString(this.GetType().Name, sloGroup, "state");
     Slos  = Slo.ParseList(SloValidator.GetList(this.GetType().Name, sloGroup, "slos"));
 }