public Trigger GetTrigger() { var trigger = new MetricRule(); if (!string.IsNullOrEmpty(id)) { trigger.Id = id; } trigger["name"] = this.RuleName; trigger["expression"] = SystemManager.CreateExpression(this.Interval, "s"); trigger["metric"] = this.KPI; trigger["parent_type"] = this.Model.GetClassName(); trigger["parent_id"] = this.Model.Id; return(trigger); }