diff --git a/data/conf/cgrates/cgrates.json b/data/conf/cgrates/cgrates.json index 6c0b0cfdd..49cec6ff2 100755 --- a/data/conf/cgrates/cgrates.json +++ b/data/conf/cgrates/cgrates.json @@ -188,6 +188,7 @@ // "http": { // HTTP server configuration // "json_rpc_url": "/jsonrpc", // JSON RPC relative URL ("" to disable) // "registrars_url": "/registrar", // registrar service relative URL +// "prometheus_url": "/prometheus", // "ws_url": "/ws", // WebSockets relative URL ("" to disable) // "freeswitch_cdrs_url": "/freeswitch_json", // Freeswitch CDRS relative URL ("" to disable) // "http_cdrs": "/cdr_http", // CDRS relative URL ("" to disable) @@ -1046,7 +1047,14 @@ // // "FilterIDs": [], // // "Value": 5, // // }, -// ], +// ], +// "*prometheusStatIDs": [ +// // { +// // "Tenant": "*any", +// // "FilterIDs": [], +// // "Value": [], +// // }, +// ], // }, // }, @@ -1189,7 +1197,7 @@ // "fields": [ // {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, // {"tag": "ID", "path": "ID", "type": "*variable", "value": "~*req.1", "mandatory": true}, -// {"tag": "Type", "path": "Rules.Type", "type": "*variable", "value": "~*req.2"}, +// {"tag": "Type", "path": "Rules.Type", "type": "*variable", "value": "~*req.2", "new_branch":true}, // {"tag": "Element", "path": "Rules.Element", "type": "*variable", "value": "~*req.3"}, // {"tag": "Values", "path": "Rules.Values", "type": "*variable", "value": "~*req.4"}, // ], @@ -1202,7 +1210,7 @@ // {"tag": "ProfileID", "path": "ID", "type": "*variable", "value": "~*req.1", "mandatory": true}, // {"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~*req.2"}, // {"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~*req.3"}, -// {"tag": "AttributeFilterIDs", "path": "Attributes.FilterIDs", "type": "*variable", "value": "~*req.4"}, +// {"tag": "AttributeFilterIDs", "path": "Attributes.FilterIDs", "type": "*variable", "value": "~*req.4","new_branch":true}, // {"tag": "Path", "path": "Attributes.Path", "type": "*variable", "value": "~*req.5"}, // {"tag": "Type", "path": "Attributes.Type", "type": "*variable", "value": "~*req.6"}, // {"tag": "Value", "path": "Attributes.Value", "type": "*variable", "value": "~*req.7"}, @@ -1236,7 +1244,7 @@ // {"tag": "QueueLength", "path": "QueueLength", "type": "*variable", "value": "~*req.4"}, // {"tag": "TTL", "path": "TTL", "type": "*variable", "value": "~*req.5"}, // {"tag": "MinItems", "path": "MinItems", "type": "*variable", "value": "~*req.6"}, -// {"tag": "MetricIDs", "path": "Metrics.MetricID", "type": "*variable", "value": "~*req.7"}, +// {"tag": "MetricIDs", "path": "Metrics.MetricID", "type": "*variable", "value": "~*req.7","new_branch":true}, // {"tag": "MetricFilterIDs", "path": "Metrics.FilterIDs", "type": "*variable", "value": "~*req.8"}, // {"tag": "Blocker", "path": "Blocker", "type": "*variable", "value": "~*req.9"}, // {"tag": "Stored", "path": "Stored", "type": "*variable", "value": "~*req.10"}, @@ -1269,7 +1277,7 @@ // {"tag": "Weights", "path": "Weights", "type": "*variable", "value": "~*req.3"}, // {"tag": "Sorting", "path": "Sorting", "type": "*variable", "value": "~*req.4"}, // {"tag": "SortingParameters", "path": "SortingParameters", "type": "*variable", "value": "~*req.5"}, -// {"tag": "RouteID", "path": "Routes.ID", "type": "*variable", "value": "~*req.6"}, +// {"tag": "RouteID", "path": "Routes.ID", "type": "*variable", "value": "~*req.6","new_branch":true}, // {"tag": "RouteFilterIDs", "path": "Routes.FilterIDs", "type": "*variable", "value": "~*req.7"}, // {"tag": "RouteAccountIDs", "path": "Routes.AccountIDs", "type": "*variable", "value": "~*req.8"}, // {"tag": "RouteRateProfileIDs", "path": "Routes.RateProfileIDs", "type": "*variable", "value": "~*req.9"}, @@ -1277,7 +1285,7 @@ // {"tag": "RouteStatIDs", "path": "Routes.StatIDs", "type": "*variable", "value": "~*req.11"}, // {"tag": "RouteWeights", "path": "Routes.Weights", "type": "*variable", "value": "~*req.12"}, // {"tag": "RouteBlocker", "path": "Routes.Blocker", "type": "*variable", "value": "~*req.13"}, -// {"tag": "RouteParameters", "path": "Routes.Parameters", "type": "*variable", "value": "~*req.14"}, +// {"tag": "RouteParameters", "path": "Routes.RouteParameters", "type": "*variable", "value": "~*req.14"}, // ], // }, // { @@ -1301,8 +1309,8 @@ // {"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~*req.2"}, // {"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~*req.3"}, // {"tag": "Strategy", "path": "Strategy", "type": "*variable", "value": "~*req.4"}, -// {"tag": "StrategyParameters", "path": "StrategyParameters", "type": "*variable", "value": "~*req.5"}, -// {"tag": "ConnID", "path": "Hosts.ID", "type": "*variable", "value": "~*req.6"}, +// {"tag": "StrategyParameters", "path": "StrategyParams", "type": "*variable", "value": "~*req.5"}, +// {"tag": "ConnID", "path": "Hosts.ID", "type": "*variable", "value": "~*req.6","new_branch":true}, // {"tag": "ConnFilterIDs", "path": "Hosts.FilterIDs", "type": "*variable", "value": "~*req.7"}, // {"tag": "ConnWeight", "path": "Hosts.Weight", "type": "*variable", "value": "~*req.8"}, // {"tag": "ConnBlocker", "path": "Hosts.Blocker", "type": "*variable", "value": "~*req.9"}, @@ -1339,15 +1347,15 @@ // {"tag": "MaxCost", "path": "MaxCost", "type": "*variable", "value": "~*req.5"}, // {"tag": "MaxCostStrategy", "path": "MaxCostStrategy", "type": "*variable", "value": "~*req.6"}, // // {"tag": "RateID", "path": "RateID", "type": "*variable", "value": "~*req.7"}, -// {"tag": "RateFilterIDs", "path": "Rates[<~*req.7>].FilterIDs", "type": "*variable", "value": "~*req.8"}, -// {"tag": "RateActivationTimes", "path": "Rates[<~*req.7>].ActivationTimes", "type": "*variable", "value": "~*req.9"}, -// {"tag": "RateWeights", "path": "Rates[<~*req.7>].Weights", "type": "*variable", "value": "~*req.10"}, -// {"tag": "RateBlocker", "path": "Rates[<~*req.7>].Blocker", "type": "*variable", "value": "~*req.11"}, -// {"tag": "RateIntervalStart", "path": "Rates[<~*req.7>].IntervalRates.IntervalStart", "type": "*variable", "value": "~*req.12"}, -// {"tag": "RateFixedFee", "path": "Rates[<~*req.7>].IntervalRates.FixedFee", "type": "*variable", "value": "~*req.13"}, -// {"tag": "RateRecurrentFee", "path": "Rates[<~*req.7>].IntervalRates.RecurrentFee", "type": "*variable", "value": "~*req.14"}, -// {"tag": "RateUnit", "path": "Rates[<~*req.7>].IntervalRates.Unit", "type": "*variable", "value": "~*req.15"}, -// {"tag": "RateIncrement", "path": "Rates[<~*req.7>].IntervalRates.Increment", "type": "*variable", "value": "~*req.16"}, +// {"tag": "RateFilterIDs", "path": "Rates[<~*req.7>].FilterIDs", "type": "*variable", "value": "~*req.8", "filters": ["*notempty:~*req.7:"]}, +// {"tag": "RateActivationTimes", "path": "Rates[<~*req.7>].ActivationTimes", "type": "*variable", "value": "~*req.9", "filters": ["*notempty:~*req.7:"]}, +// {"tag": "RateWeights", "path": "Rates[<~*req.7>].Weights", "type": "*variable", "value": "~*req.10", "filters": ["*notempty:~*req.7:"]}, +// {"tag": "RateBlocker", "path": "Rates[<~*req.7>].Blocker", "type": "*variable", "value": "~*req.11", "filters": ["*notempty:~*req.7:"]}, +// {"tag": "RateIntervalStart", "path": "Rates[<~*req.7>].IntervalRates.IntervalStart", "type": "*variable", "value": "~*req.12","new_branch":true, "filters": ["*notempty:~*req.7:"]}, +// {"tag": "RateFixedFee", "path": "Rates[<~*req.7>].IntervalRates.FixedFee", "type": "*variable", "value": "~*req.13", "filters": ["*notempty:~*req.7:"]}, +// {"tag": "RateRecurrentFee", "path": "Rates[<~*req.7>].IntervalRates.RecurrentFee", "type": "*variable", "value": "~*req.14", "filters": ["*notempty:~*req.7:"]}, +// {"tag": "RateUnit", "path": "Rates[<~*req.7>].IntervalRates.Unit", "type": "*variable", "value": "~*req.15", "filters": ["*notempty:~*req.7:"]}, +// {"tag": "RateIncrement", "path": "Rates[<~*req.7>].IntervalRates.Increment", "type": "*variable", "value": "~*req.16", "filters": ["*notempty:~*req.7:"]}, // ], // }, // { @@ -1361,14 +1369,14 @@ // {"tag": "Schedule", "path": "Schedule", "type": "*variable", "value": "~*req.4"}, // // {"tag": "TargetType", "path": "TargetType", "type": "*variable", "value": "~*req.5"}, // {"tag": "TargetIDs", "path": "Targets[<~*req.5>]", "type": "*variable", "value": "~*req.6"}, -// {"tag": "ActionID", "path": "Actions.ID", "type": "*variable", "value": "~*req.7"}, -// {"tag": "ActionFilterIDs", "path": "Actions.FilterIDs", "type": "*variable", "value": "~*req.8"}, -// {"tag": "ActionBlocker", "path": "Actions.Blocker", "type": "*variable", "value": "~*req.9"}, -// {"tag": "ActionTTL", "path": "Actions.TTL", "type": "*variable", "value": "~*req.10"}, -// {"tag": "ActionType", "path": "Actions.Type", "type": "*variable", "value": "~*req.11"}, -// {"tag": "ActionOpts", "path": "Actions.Opts", "type": "*variable", "value": "~*req.12"}, -// {"tag": "ActionPath", "path": "Actions.Path", "type": "*variable", "value": "~*req.13"}, -// {"tag": "ActionValue", "path": "Actions.Value", "type": "*variable", "value": "~*req.14"}, +// // {"tag": "ActionID", "path": "Actions.ID", "type": "*variable", "value": "~*req.7","new_branch":true}, +// {"tag": "ActionFilterIDs", "path": "Actions[<~*req.7>].FilterIDs", "type": "*variable", "value": "~*req.8", "filters": ["*notempty:~*req.7:"]}, +// {"tag": "ActionBlocker", "path": "Actions[<~*req.7>].Blocker", "type": "*variable", "value": "~*req.9", "filters": ["*notempty:~*req.7:"]}, +// {"tag": "ActionTTL", "path": "Actions[<~*req.7>].TTL", "type": "*variable", "value": "~*req.10", "filters": ["*notempty:~*req.7:"]}, +// {"tag": "ActionType", "path": "Actions[<~*req.7>].Type", "type": "*variable", "value": "~*req.11", "filters": ["*notempty:~*req.7:"]}, +// {"tag": "ActionOpts", "path": "Actions[<~*req.7>].Opts", "type": "*variable", "value": "~*req.12", "filters": ["*notempty:~*req.7:"]}, +// {"tag": "ActionPath", "path": "Actions[<~*req.7>].Diktats.Path", "type": "*variable", "value": "~*req.13","new_branch":true, "filters": ["*notempty:~*req.7:"]}, +// {"tag": "ActionValue", "path": "Actions[<~*req.7>].Diktats.Value", "type": "*variable", "value": "~*req.14", "filters": ["*notempty:~*req.7:"]}, // ], // }, // { @@ -1381,15 +1389,15 @@ // {"tag": "Weights", "path": "Weights", "type": "*variable", "value": "~*req.3"}, // {"tag": "Opts", "path": "Opts", "type": "*variable", "value": "~*req.4"}, // // {"tag": "BalanceID", "path": "Balances.ID", "type": "*variable", "value": "~*req.5"}, -// {"tag": "BalanceFilterIDs", "path": "Balances[<~*req.5>].FilterIDs", "type": "*variable", "value": "~*req.6"}, -// {"tag": "BalanceWeights", "path": "Balances[<~*req.5>].Weights", "type": "*variable", "value": "~*req.7"}, -// {"tag": "BalanceType", "path": "Balances[<~*req.5>].Type", "type": "*variable", "value": "~*req.8"}, -// {"tag": "BalanceUnits", "path": "Balances[<~*req.5>].Units", "type": "*variable", "value": "~*req.9"}, -// {"tag": "BalanceUnitFactors", "path": "Balances[<~*req.5>].UnitFactors", "type": "*variable", "value": "~*req.10"}, -// {"tag": "BalanceOpts", "path": "Balances[<~*req.5>].Opts", "type": "*variable", "value": "~*req.11"}, -// {"tag": "BalanceCostIncrements", "path": "Balances[<~*req.5>].CostIncrements", "type": "*variable", "value": "~*req.12"}, -// {"tag": "BalanceAttributeIDs", "path": "Balances[<~*req.5>].AttributeIDs", "type": "*variable", "value": "~*req.13"}, -// {"tag": "BalanceRateProfileIDs", "path": "Balances[<~*req.5>].RateProfileIDs", "type": "*variable", "value": "~*req.14"}, +// {"tag": "BalanceFilterIDs", "path": "Balances[<~*req.5>].FilterIDs", "type": "*variable", "value": "~*req.6","filters": ["*notempty:~*req.5:"]}, +// {"tag": "BalanceWeights", "path": "Balances[<~*req.5>].Weights", "type": "*variable", "value": "~*req.7","filters": ["*notempty:~*req.5:"]}, +// {"tag": "BalanceType", "path": "Balances[<~*req.5>].Type", "type": "*variable", "value": "~*req.8","filters": ["*notempty:~*req.5:"]}, +// {"tag": "BalanceUnits", "path": "Balances[<~*req.5>].Units", "type": "*variable", "value": "~*req.9","filters": ["*notempty:~*req.5:"]}, +// {"tag": "BalanceUnitFactors", "path": "Balances[<~*req.5>].UnitFactors", "type": "*variable", "value": "~*req.10","filters": ["*notempty:~*req.5:"]}, +// {"tag": "BalanceOpts", "path": "Balances[<~*req.5>].Opts", "type": "*variable", "value": "~*req.11","filters": ["*notempty:~*req.5:"]}, +// {"tag": "BalanceCostIncrements", "path": "Balances[<~*req.5>].CostIncrements", "type": "*variable", "value": "~*req.12","filters": ["*notempty:~*req.5:"]}, +// {"tag": "BalanceAttributeIDs", "path": "Balances[<~*req.5>].AttributeIDs", "type": "*variable", "value": "~*req.13","filters": ["*notempty:~*req.5:"]}, +// {"tag": "BalanceRateProfileIDs", "path": "Balances[<~*req.5>].RateProfileIDs", "type": "*variable", "value": "~*req.14","filters": ["*notempty:~*req.5:"]}, // {"tag": "ThresholdIDs", "path": "ThresholdIDs", "type": "*variable", "value": "~*req.15"}, // ], // }, diff --git a/data/scripts/generate_config/generate.go b/data/scripts/generate_config/generate.go index 84a27269e..40f3271c0 100644 --- a/data/scripts/generate_config/generate.go +++ b/data/scripts/generate_config/generate.go @@ -28,7 +28,7 @@ import ( "github.com/cgrates/cgrates/config" ) -func writeDefaultCofig(fileName string) error { +func writeDefaultConfig(fileName string) error { f, err := os.OpenFile(fileName, os.O_WRONLY|os.O_CREATE, 0755) if err != nil { return err @@ -61,7 +61,7 @@ func main() { if err := os.Remove(*cfgPath); err != nil && !os.IsNotExist(err) { log.Fatal(err) } - if err := writeDefaultCofig(*cfgPath); err != nil { + if err := writeDefaultConfig(*cfgPath); err != nil { log.Fatal(err) } fmt.Printf("Done writing file at path: %s\n", *cfgPath)