mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-19 22:28:45 +05:00
Merge pull request #2244 from TeoV/master
[LoaderS] Add *req as mandatory prefix
This commit is contained in:
@@ -320,7 +320,7 @@ var possibleReaderTypes = utils.NewStringSet([]string{utils.MetaFileCSV,
|
||||
|
||||
var possibleExporterTypes = utils.NewStringSet([]string{utils.MetaFileCSV, utils.META_NONE, utils.MetaFileFWV,
|
||||
utils.MetaHTTPPost, utils.MetaHTTPjsonMap, utils.MetaAMQPjsonMap, utils.MetaAMQPV1jsonMap, utils.MetaSQSjsonMap,
|
||||
utils.MetaKafkajsonMap, utils.MetaS3jsonMap})
|
||||
utils.MetaKafkajsonMap, utils.MetaS3jsonMap, utils.MetaVirt})
|
||||
|
||||
func (cfg *CGRConfig) LazySanityCheck() {
|
||||
for _, cdrePrfl := range cfg.cdrsCfg.OnlineCDRExports {
|
||||
|
||||
@@ -660,171 +660,171 @@ const CGRATES_CFG_JSON = `
|
||||
"type": "*attributes", // data source type
|
||||
"file_name": "Attributes.csv", // file name in the tp_in_dir
|
||||
"fields": [
|
||||
{"tag": "TenantID", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true},
|
||||
{"tag": "ProfileID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true},
|
||||
{"tag": "Contexts", "path": "Contexts", "type": "*variable", "value": "~2"},
|
||||
{"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~3"},
|
||||
{"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~4"},
|
||||
{"tag": "AttributeFilterIDs", "path": "AttributeFilterIDs", "type": "*variable", "value": "~5"},
|
||||
{"tag": "Path", "path": "Path", "type": "*variable", "value": "~6"},
|
||||
{"tag": "Type", "path": "Type", "type": "*variable", "value": "~7"},
|
||||
{"tag": "Value", "path": "Value", "type": "*variable", "value": "~8"},
|
||||
{"tag": "Blocker", "path": "Blocker", "type": "*variable", "value": "~9"},
|
||||
{"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~10"},
|
||||
{"tag": "TenantID", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true},
|
||||
{"tag": "ProfileID", "path": "ID", "type": "*variable", "value": "~*req.1", "mandatory": true},
|
||||
{"tag": "Contexts", "path": "Contexts", "type": "*variable", "value": "~*req.2"},
|
||||
{"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~*req.3"},
|
||||
{"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~*req.4"},
|
||||
{"tag": "AttributeFilterIDs", "path": "AttributeFilterIDs", "type": "*variable", "value": "~*req.5"},
|
||||
{"tag": "Path", "path": "Path", "type": "*variable", "value": "~*req.6"},
|
||||
{"tag": "Type", "path": "Type", "type": "*variable", "value": "~*req.7"},
|
||||
{"tag": "Value", "path": "Value", "type": "*variable", "value": "~*req.8"},
|
||||
{"tag": "Blocker", "path": "Blocker", "type": "*variable", "value": "~*req.9"},
|
||||
{"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~*req.10"},
|
||||
],
|
||||
},
|
||||
{
|
||||
"type": "*filters", // data source type
|
||||
"file_name": "Filters.csv", // file name in the tp_in_dir
|
||||
"fields": [
|
||||
{"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true},
|
||||
{"tag": "ID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true},
|
||||
{"tag": "Type", "path": "Type", "type": "*variable", "value": "~2"},
|
||||
{"tag": "Element", "path": "Element", "type": "*variable", "value": "~3"},
|
||||
{"tag": "Values", "path": "Values", "type": "*variable", "value": "~4"},
|
||||
{"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~5"},
|
||||
{"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": "Type", "type": "*variable", "value": "~*req.2"},
|
||||
{"tag": "Element", "path": "Element", "type": "*variable", "value": "~*req.3"},
|
||||
{"tag": "Values", "path": "Values", "type": "*variable", "value": "~*req.4"},
|
||||
{"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~*req.5"},
|
||||
],
|
||||
},
|
||||
{
|
||||
"type": "*resources", // data source type
|
||||
"file_name": "Resources.csv", // file name in the tp_in_dir
|
||||
"fields": [
|
||||
{"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true},
|
||||
{"tag": "ID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true},
|
||||
{"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~2"},
|
||||
{"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~3"},
|
||||
{"tag": "TTL", "path": "UsageTTL", "type": "*variable", "value": "~4"},
|
||||
{"tag": "Limit", "path": "Limit", "type": "*variable", "value": "~5"},
|
||||
{"tag": "AllocationMessage", "path": "AllocationMessage", "type": "*variable", "value": "~6"},
|
||||
{"tag": "Blocker", "path": "Blocker", "type": "*variable", "value": "~7"},
|
||||
{"tag": "Stored", "path": "Stored", "type": "*variable", "value": "~8"},
|
||||
{"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~9"},
|
||||
{"tag": "ThresholdIDs", "path": "ThresholdIDs", "type": "*variable", "value": "~10"},
|
||||
{"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true},
|
||||
{"tag": "ID", "path": "ID", "type": "*variable", "value": "~*req.1", "mandatory": true},
|
||||
{"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~*req.2"},
|
||||
{"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~*req.3"},
|
||||
{"tag": "TTL", "path": "UsageTTL", "type": "*variable", "value": "~*req.4"},
|
||||
{"tag": "Limit", "path": "Limit", "type": "*variable", "value": "~*req.5"},
|
||||
{"tag": "AllocationMessage", "path": "AllocationMessage", "type": "*variable", "value": "~*req.6"},
|
||||
{"tag": "Blocker", "path": "Blocker", "type": "*variable", "value": "~*req.7"},
|
||||
{"tag": "Stored", "path": "Stored", "type": "*variable", "value": "~*req.8"},
|
||||
{"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~*req.9"},
|
||||
{"tag": "ThresholdIDs", "path": "ThresholdIDs", "type": "*variable", "value": "~*req.10"},
|
||||
],
|
||||
},
|
||||
{
|
||||
"type": "*stats", // data source type
|
||||
"file_name": "Stats.csv", // file name in the tp_in_dir
|
||||
"fields": [
|
||||
{"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true},
|
||||
{"tag": "ID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true},
|
||||
{"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~2"},
|
||||
{"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~3"},
|
||||
{"tag": "QueueLength", "path": "QueueLength", "type": "*variable", "value": "~4"},
|
||||
{"tag": "TTL", "path": "TTL", "type": "*variable", "value": "~5"},
|
||||
{"tag": "MinItems", "path": "MinItems", "type": "*variable", "value": "~6"},
|
||||
{"tag": "MetricIDs", "path": "MetricIDs", "type": "*variable", "value": "~7"},
|
||||
{"tag": "MetricFilterIDs", "path": "MetricFilterIDs", "type": "*variable", "value": "~8"},
|
||||
{"tag": "Blocker", "path": "Blocker", "type": "*variable", "value": "~9"},
|
||||
{"tag": "Stored", "path": "Stored", "type": "*variable", "value": "~10"},
|
||||
{"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~11"},
|
||||
{"tag": "ThresholdIDs", "path": "ThresholdIDs", "type": "*variable", "value": "~12"},
|
||||
{"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true},
|
||||
{"tag": "ID", "path": "ID", "type": "*variable", "value": "~*req.1", "mandatory": true},
|
||||
{"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~*req.2"},
|
||||
{"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~*req.3"},
|
||||
{"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": "MetricIDs", "type": "*variable", "value": "~*req.7"},
|
||||
{"tag": "MetricFilterIDs", "path": "MetricFilterIDs", "type": "*variable", "value": "~*req.8"},
|
||||
{"tag": "Blocker", "path": "Blocker", "type": "*variable", "value": "~*req.9"},
|
||||
{"tag": "Stored", "path": "Stored", "type": "*variable", "value": "~*req.10"},
|
||||
{"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~*req.11"},
|
||||
{"tag": "ThresholdIDs", "path": "ThresholdIDs", "type": "*variable", "value": "~*req.12"},
|
||||
],
|
||||
},
|
||||
{
|
||||
"type": "*thresholds", // data source type
|
||||
"file_name": "Thresholds.csv", // file name in the tp_in_dir
|
||||
"fields": [
|
||||
{"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true},
|
||||
{"tag": "ID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true},
|
||||
{"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~2"},
|
||||
{"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~3"},
|
||||
{"tag": "MaxHits", "path": "MaxHits", "type": "*variable", "value": "~4"},
|
||||
{"tag": "MinHits", "path": "MinHits", "type": "*variable", "value": "~5"},
|
||||
{"tag": "MinSleep", "path": "MinSleep", "type": "*variable", "value": "~6"},
|
||||
{"tag": "Blocker", "path": "Blocker", "type": "*variable", "value": "~7"},
|
||||
{"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~8"},
|
||||
{"tag": "ActionIDs", "path": "ActionIDs", "type": "*variable", "value": "~9"},
|
||||
{"tag": "Async", "path": "Async", "type": "*variable", "value": "~10"},
|
||||
{"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true},
|
||||
{"tag": "ID", "path": "ID", "type": "*variable", "value": "~*req.1", "mandatory": true},
|
||||
{"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~*req.2"},
|
||||
{"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~*req.3"},
|
||||
{"tag": "MaxHits", "path": "MaxHits", "type": "*variable", "value": "~*req.4"},
|
||||
{"tag": "MinHits", "path": "MinHits", "type": "*variable", "value": "~*req.5"},
|
||||
{"tag": "MinSleep", "path": "MinSleep", "type": "*variable", "value": "~*req.6"},
|
||||
{"tag": "Blocker", "path": "Blocker", "type": "*variable", "value": "~*req.7"},
|
||||
{"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~*req.8"},
|
||||
{"tag": "ActionIDs", "path": "ActionIDs", "type": "*variable", "value": "~*req.9"},
|
||||
{"tag": "Async", "path": "Async", "type": "*variable", "value": "~*req.10"},
|
||||
],
|
||||
},
|
||||
{
|
||||
"type": "*routes", // data source type
|
||||
"file_name": "Routes.csv", // file name in the tp_in_dir
|
||||
"fields": [
|
||||
{"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true},
|
||||
{"tag": "ID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true},
|
||||
{"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~2"},
|
||||
{"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~3"},
|
||||
{"tag": "Sorting", "path": "Sorting", "type": "*variable", "value": "~4"},
|
||||
{"tag": "SortingParameters", "path": "SortingParameters", "type": "*variable", "value": "~5"},
|
||||
{"tag": "RouteID", "path": "RouteID", "type": "*variable", "value": "~6"},
|
||||
{"tag": "RouteFilterIDs", "path": "RouteFilterIDs", "type": "*variable", "value": "~7"},
|
||||
{"tag": "RouteAccountIDs", "path": "RouteAccountIDs", "type": "*variable", "value": "~8"},
|
||||
{"tag": "RouteRatingPlanIDs", "path": "RouteRatingPlanIDs", "type": "*variable", "value": "~9"},
|
||||
{"tag": "RouteResourceIDs", "path": "RouteResourceIDs", "type": "*variable", "value": "~10"},
|
||||
{"tag": "RouteStatIDs", "path": "RouteStatIDs", "type": "*variable", "value": "~11"},
|
||||
{"tag": "RouteWeight", "path": "RouteWeight", "type": "*variable", "value": "~12"},
|
||||
{"tag": "RouteBlocker", "path": "RouteBlocker", "type": "*variable", "value": "~13"},
|
||||
{"tag": "RouteParameters", "path": "RouteParameters", "type": "*variable", "value": "~14"},
|
||||
{"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~15"},
|
||||
{"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true},
|
||||
{"tag": "ID", "path": "ID", "type": "*variable", "value": "~*req.1", "mandatory": true},
|
||||
{"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~*req.2"},
|
||||
{"tag": "ActivationInterval", "path": "ActivationInterval", "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": "RouteID", "type": "*variable", "value": "~*req.6"},
|
||||
{"tag": "RouteFilterIDs", "path": "RouteFilterIDs", "type": "*variable", "value": "~*req.7"},
|
||||
{"tag": "RouteAccountIDs", "path": "RouteAccountIDs", "type": "*variable", "value": "~*req.8"},
|
||||
{"tag": "RouteRatingPlanIDs", "path": "RouteRatingPlanIDs", "type": "*variable", "value": "~*req.9"},
|
||||
{"tag": "RouteResourceIDs", "path": "RouteResourceIDs", "type": "*variable", "value": "~*req.10"},
|
||||
{"tag": "RouteStatIDs", "path": "RouteStatIDs", "type": "*variable", "value": "~*req.11"},
|
||||
{"tag": "RouteWeight", "path": "RouteWeight", "type": "*variable", "value": "~*req.12"},
|
||||
{"tag": "RouteBlocker", "path": "RouteBlocker", "type": "*variable", "value": "~*req.13"},
|
||||
{"tag": "RouteParameters", "path": "RouteParameters", "type": "*variable", "value": "~*req.14"},
|
||||
{"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~*req.15"},
|
||||
],
|
||||
},
|
||||
{
|
||||
"type": "*chargers", // data source type
|
||||
"file_name": "Chargers.csv", // file name in the tp_in_dir
|
||||
"fields": [
|
||||
{"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true},
|
||||
{"tag": "ID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true},
|
||||
{"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~2"},
|
||||
{"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~3"},
|
||||
{"tag": "RunID", "path": "RunID", "type": "*variable", "value": "~4"},
|
||||
{"tag": "AttributeIDs", "path": "AttributeIDs", "type": "*variable", "value": "~5"},
|
||||
{"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~6"},
|
||||
{"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true},
|
||||
{"tag": "ID", "path": "ID", "type": "*variable", "value": "~*req.1", "mandatory": true},
|
||||
{"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~*req.2"},
|
||||
{"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~*req.3"},
|
||||
{"tag": "RunID", "path": "RunID", "type": "*variable", "value": "~*req.4"},
|
||||
{"tag": "AttributeIDs", "path": "AttributeIDs", "type": "*variable", "value": "~*req.5"},
|
||||
{"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~*req.6"},
|
||||
],
|
||||
},
|
||||
{
|
||||
"type": "*dispatchers", // data source type
|
||||
"file_name": "DispatcherProfiles.csv", // file name in the tp_in_dir
|
||||
"fields": [
|
||||
{"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true},
|
||||
{"tag": "ID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true},
|
||||
{"tag": "Contexts", "path": "Contexts", "type": "*variable", "value": "~2"},
|
||||
{"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~3"},
|
||||
{"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~4"},
|
||||
{"tag": "Strategy", "path": "Strategy", "type": "*variable", "value": "~5"},
|
||||
{"tag": "StrategyParameters", "path": "StrategyParameters", "type": "*variable", "value": "~6"},
|
||||
{"tag": "ConnID", "path": "ConnID", "type": "*variable", "value": "~7"},
|
||||
{"tag": "ConnFilterIDs", "path": "ConnFilterIDs", "type": "*variable", "value": "~8"},
|
||||
{"tag": "ConnWeight", "path": "ConnWeight", "type": "*variable", "value": "~9"},
|
||||
{"tag": "ConnBlocker", "path": "ConnBlocker", "type": "*variable", "value": "~10"},
|
||||
{"tag": "ConnParameters", "path": "ConnParameters", "type": "*variable", "value": "~11"},
|
||||
{"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~12"},
|
||||
{"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true},
|
||||
{"tag": "ID", "path": "ID", "type": "*variable", "value": "~*req.1", "mandatory": true},
|
||||
{"tag": "Contexts", "path": "Contexts", "type": "*variable", "value": "~*req.2"},
|
||||
{"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~*req.3"},
|
||||
{"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~*req.4"},
|
||||
{"tag": "Strategy", "path": "Strategy", "type": "*variable", "value": "~*req.5"},
|
||||
{"tag": "StrategyParameters", "path": "StrategyParameters", "type": "*variable", "value": "~*req.6"},
|
||||
{"tag": "ConnID", "path": "ConnID", "type": "*variable", "value": "~*req.7"},
|
||||
{"tag": "ConnFilterIDs", "path": "ConnFilterIDs", "type": "*variable", "value": "~*req.8"},
|
||||
{"tag": "ConnWeight", "path": "ConnWeight", "type": "*variable", "value": "~*req.9"},
|
||||
{"tag": "ConnBlocker", "path": "ConnBlocker", "type": "*variable", "value": "~*req.10"},
|
||||
{"tag": "ConnParameters", "path": "ConnParameters", "type": "*variable", "value": "~*req.11"},
|
||||
{"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~*req.12"},
|
||||
],
|
||||
},
|
||||
{
|
||||
"type": "*dispatcher_hosts", // data source type
|
||||
"file_name": "DispatcherHosts.csv", // file name in the tp_in_dir
|
||||
"fields": [
|
||||
{"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true},
|
||||
{"tag": "ID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true},
|
||||
{"tag": "Address", "path": "Address", "type": "*variable", "value": "~2"},
|
||||
{"tag": "Transport", "path": "Transport", "type": "*variable", "value": "~3"},
|
||||
{"tag": "TLS", "path": "TLS", "type": "*variable", "value": "~4"},
|
||||
{"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true},
|
||||
{"tag": "ID", "path": "ID", "type": "*variable", "value": "~*req.1", "mandatory": true},
|
||||
{"tag": "Address", "path": "Address", "type": "*variable", "value": "~*req.2"},
|
||||
{"tag": "Transport", "path": "Transport", "type": "*variable", "value": "~*req.3"},
|
||||
{"tag": "TLS", "path": "TLS", "type": "*variable", "value": "~*req.4"},
|
||||
],
|
||||
},
|
||||
{
|
||||
"type": "*rate_profiles", // data source type
|
||||
"file_name": "RateProfiles.csv", // file name in the tp_in_dir
|
||||
"fields": [
|
||||
{"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true},
|
||||
{"tag": "ID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true},
|
||||
{"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~2"},
|
||||
{"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~3"},
|
||||
{"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~4"},
|
||||
{"tag": "ConnectFee", "path": "ConnectFee", "type": "*variable", "value": "~5"},
|
||||
{"tag": "RoundingMethod", "path": "RoundingMethod", "type": "*variable", "value": "~6"},
|
||||
{"tag": "RoundingDecimals", "path": "RoundingDecimals", "type": "*variable", "value": "~7"},
|
||||
{"tag": "MinCost", "path": "MinCost", "type": "*variable", "value": "~8"},
|
||||
{"tag": "MaxCost", "path": "MaxCost", "type": "*variable", "value": "~9"},
|
||||
{"tag": "MaxCostStrategy", "path": "MaxCostStrategy", "type": "*variable", "value": "~10"},
|
||||
{"tag": "RateID", "path": "RateID", "type": "*variable", "value": "~11"},
|
||||
{"tag": "RateFilterIDs", "path": "RateFilterIDs", "type": "*variable", "value": "~12"},
|
||||
{"tag": "RateWeight", "path": "RateWeight", "type": "*variable", "value": "~13"},
|
||||
{"tag": "RateValue", "path": "RateValue", "type": "*variable", "value": "~14"},
|
||||
{"tag": "RateUnit", "path": "RateUnit", "type": "*variable", "value": "~15"},
|
||||
{"tag": "RateIncrement", "path": "RateIncrement", "type": "*variable", "value": "~16"},
|
||||
{"tag": "RateBlocker", "path": "RateBlocker", "type": "*variable", "value": "~17"},
|
||||
{"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true},
|
||||
{"tag": "ID", "path": "ID", "type": "*variable", "value": "~*req.1", "mandatory": true},
|
||||
{"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~*req.2"},
|
||||
{"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~*req.3"},
|
||||
{"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~*req.4"},
|
||||
{"tag": "ConnectFee", "path": "ConnectFee", "type": "*variable", "value": "~*req.5"},
|
||||
{"tag": "RoundingMethod", "path": "RoundingMethod", "type": "*variable", "value": "~*req.6"},
|
||||
{"tag": "RoundingDecimals", "path": "RoundingDecimals", "type": "*variable", "value": "~*req.7"},
|
||||
{"tag": "MinCost", "path": "MinCost", "type": "*variable", "value": "~*req.8"},
|
||||
{"tag": "MaxCost", "path": "MaxCost", "type": "*variable", "value": "~*req.9"},
|
||||
{"tag": "MaxCostStrategy", "path": "MaxCostStrategy", "type": "*variable", "value": "~*req.10"},
|
||||
{"tag": "RateID", "path": "RateID", "type": "*variable", "value": "~*req.11"},
|
||||
{"tag": "RateFilterIDs", "path": "RateFilterIDs", "type": "*variable", "value": "~*req.12"},
|
||||
{"tag": "RateWeight", "path": "RateWeight", "type": "*variable", "value": "~*req.13"},
|
||||
{"tag": "RateValue", "path": "RateValue", "type": "*variable", "value": "~*req.14"},
|
||||
{"tag": "RateUnit", "path": "RateUnit", "type": "*variable", "value": "~*req.15"},
|
||||
{"tag": "RateIncrement", "path": "RateIncrement", "type": "*variable", "value": "~*req.16"},
|
||||
{"tag": "RateBlocker", "path": "RateBlocker", "type": "*variable", "value": "~*req.17"},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -1162,49 +1162,49 @@ func TestDfLoaderJsonCfg(t *testing.T) {
|
||||
{Tag: utils.StringPointer("TenantID"),
|
||||
Path: utils.StringPointer(utils.Tenant),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~0"),
|
||||
Value: utils.StringPointer("~*req.0"),
|
||||
Mandatory: utils.BoolPointer(true)},
|
||||
{Tag: utils.StringPointer("ProfileID"),
|
||||
Path: utils.StringPointer(utils.ID),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~1"),
|
||||
Value: utils.StringPointer("~*req.1"),
|
||||
Mandatory: utils.BoolPointer(true)},
|
||||
{Tag: utils.StringPointer("Contexts"),
|
||||
Path: utils.StringPointer(utils.Contexts),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~2")},
|
||||
Value: utils.StringPointer("~*req.2")},
|
||||
{Tag: utils.StringPointer("FilterIDs"),
|
||||
Path: utils.StringPointer(utils.FilterIDs),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~3")},
|
||||
Value: utils.StringPointer("~*req.3")},
|
||||
{Tag: utils.StringPointer("ActivationInterval"),
|
||||
Path: utils.StringPointer("ActivationInterval"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~4")},
|
||||
Value: utils.StringPointer("~*req.4")},
|
||||
{Tag: utils.StringPointer("AttributeFilterIDs"),
|
||||
Path: utils.StringPointer("AttributeFilterIDs"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~5")},
|
||||
Value: utils.StringPointer("~*req.5")},
|
||||
{Tag: utils.StringPointer("Path"),
|
||||
Path: utils.StringPointer(utils.Path),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~6")},
|
||||
Value: utils.StringPointer("~*req.6")},
|
||||
{Tag: utils.StringPointer("Type"),
|
||||
Path: utils.StringPointer("Type"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~7")},
|
||||
Value: utils.StringPointer("~*req.7")},
|
||||
{Tag: utils.StringPointer("Value"),
|
||||
Path: utils.StringPointer("Value"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~8")},
|
||||
Value: utils.StringPointer("~*req.8")},
|
||||
{Tag: utils.StringPointer("Blocker"),
|
||||
Path: utils.StringPointer("Blocker"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~9")},
|
||||
Value: utils.StringPointer("~*req.9")},
|
||||
{Tag: utils.StringPointer("Weight"),
|
||||
Path: utils.StringPointer(utils.Weight),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~10")},
|
||||
Value: utils.StringPointer("~*req.10")},
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -1214,29 +1214,29 @@ func TestDfLoaderJsonCfg(t *testing.T) {
|
||||
{Tag: utils.StringPointer(utils.Tenant),
|
||||
Path: utils.StringPointer(utils.Tenant),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~0"),
|
||||
Value: utils.StringPointer("~*req.0"),
|
||||
Mandatory: utils.BoolPointer(true)},
|
||||
{Tag: utils.StringPointer(utils.ID),
|
||||
Path: utils.StringPointer(utils.ID),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~1"),
|
||||
Value: utils.StringPointer("~*req.1"),
|
||||
Mandatory: utils.BoolPointer(true)},
|
||||
{Tag: utils.StringPointer("Type"),
|
||||
Path: utils.StringPointer("Type"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~2")},
|
||||
Value: utils.StringPointer("~*req.2")},
|
||||
{Tag: utils.StringPointer("Element"),
|
||||
Path: utils.StringPointer("Element"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~3")},
|
||||
Value: utils.StringPointer("~*req.3")},
|
||||
{Tag: utils.StringPointer("Values"),
|
||||
Path: utils.StringPointer("Values"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~4")},
|
||||
Value: utils.StringPointer("~*req.4")},
|
||||
{Tag: utils.StringPointer("ActivationInterval"),
|
||||
Path: utils.StringPointer("ActivationInterval"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~5")},
|
||||
Value: utils.StringPointer("~*req.5")},
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -1246,49 +1246,49 @@ func TestDfLoaderJsonCfg(t *testing.T) {
|
||||
{Tag: utils.StringPointer(utils.Tenant),
|
||||
Path: utils.StringPointer(utils.Tenant),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~0"),
|
||||
Value: utils.StringPointer("~*req.0"),
|
||||
Mandatory: utils.BoolPointer(true)},
|
||||
{Tag: utils.StringPointer(utils.ID),
|
||||
Path: utils.StringPointer(utils.ID),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~1"),
|
||||
Value: utils.StringPointer("~*req.1"),
|
||||
Mandatory: utils.BoolPointer(true)},
|
||||
{Tag: utils.StringPointer("FilterIDs"),
|
||||
Path: utils.StringPointer("FilterIDs"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~2")},
|
||||
Value: utils.StringPointer("~*req.2")},
|
||||
{Tag: utils.StringPointer("ActivationInterval"),
|
||||
Path: utils.StringPointer("ActivationInterval"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~3")},
|
||||
Value: utils.StringPointer("~*req.3")},
|
||||
{Tag: utils.StringPointer("TTL"),
|
||||
Path: utils.StringPointer("UsageTTL"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~4")},
|
||||
Value: utils.StringPointer("~*req.4")},
|
||||
{Tag: utils.StringPointer("Limit"),
|
||||
Path: utils.StringPointer("Limit"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~5")},
|
||||
Value: utils.StringPointer("~*req.5")},
|
||||
{Tag: utils.StringPointer("AllocationMessage"),
|
||||
Path: utils.StringPointer("AllocationMessage"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~6")},
|
||||
Value: utils.StringPointer("~*req.6")},
|
||||
{Tag: utils.StringPointer("Blocker"),
|
||||
Path: utils.StringPointer("Blocker"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~7")},
|
||||
Value: utils.StringPointer("~*req.7")},
|
||||
{Tag: utils.StringPointer("Stored"),
|
||||
Path: utils.StringPointer("Stored"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~8")},
|
||||
Value: utils.StringPointer("~*req.8")},
|
||||
{Tag: utils.StringPointer("Weight"),
|
||||
Path: utils.StringPointer("Weight"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~9")},
|
||||
Value: utils.StringPointer("~*req.9")},
|
||||
{Tag: utils.StringPointer("ThresholdIDs"),
|
||||
Path: utils.StringPointer("ThresholdIDs"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~10")},
|
||||
Value: utils.StringPointer("~*req.10")},
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -1298,58 +1298,58 @@ func TestDfLoaderJsonCfg(t *testing.T) {
|
||||
{Tag: utils.StringPointer(utils.Tenant),
|
||||
Path: utils.StringPointer(utils.Tenant),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~0"),
|
||||
Value: utils.StringPointer("~*req.0"),
|
||||
Mandatory: utils.BoolPointer(true)},
|
||||
{Tag: utils.StringPointer(utils.ID),
|
||||
Path: utils.StringPointer(utils.ID),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~1"),
|
||||
Value: utils.StringPointer("~*req.1"),
|
||||
Mandatory: utils.BoolPointer(true)},
|
||||
{Tag: utils.StringPointer("FilterIDs"),
|
||||
Path: utils.StringPointer("FilterIDs"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~2")},
|
||||
Value: utils.StringPointer("~*req.2")},
|
||||
{Tag: utils.StringPointer("ActivationInterval"),
|
||||
Path: utils.StringPointer("ActivationInterval"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~3")},
|
||||
Value: utils.StringPointer("~*req.3")},
|
||||
{Tag: utils.StringPointer("QueueLength"),
|
||||
Path: utils.StringPointer("QueueLength"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~4")},
|
||||
Value: utils.StringPointer("~*req.4")},
|
||||
{Tag: utils.StringPointer("TTL"),
|
||||
Path: utils.StringPointer("TTL"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~5")},
|
||||
Value: utils.StringPointer("~*req.5")},
|
||||
{Tag: utils.StringPointer("MinItems"),
|
||||
Path: utils.StringPointer("MinItems"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~6")},
|
||||
Value: utils.StringPointer("~*req.6")},
|
||||
{Tag: utils.StringPointer("MetricIDs"),
|
||||
Path: utils.StringPointer("MetricIDs"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~7")},
|
||||
Value: utils.StringPointer("~*req.7")},
|
||||
{Tag: utils.StringPointer("MetricFilterIDs"),
|
||||
Path: utils.StringPointer("MetricFilterIDs"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~8")},
|
||||
Value: utils.StringPointer("~*req.8")},
|
||||
{Tag: utils.StringPointer("Blocker"),
|
||||
Path: utils.StringPointer("Blocker"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~9")},
|
||||
Value: utils.StringPointer("~*req.9")},
|
||||
{Tag: utils.StringPointer("Stored"),
|
||||
Path: utils.StringPointer("Stored"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~10")},
|
||||
Value: utils.StringPointer("~*req.10")},
|
||||
{Tag: utils.StringPointer("Weight"),
|
||||
Path: utils.StringPointer("Weight"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~11")},
|
||||
Value: utils.StringPointer("~*req.11")},
|
||||
|
||||
{Tag: utils.StringPointer("ThresholdIDs"),
|
||||
Path: utils.StringPointer("ThresholdIDs"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~12")},
|
||||
Value: utils.StringPointer("~*req.12")},
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -1359,49 +1359,49 @@ func TestDfLoaderJsonCfg(t *testing.T) {
|
||||
{Tag: utils.StringPointer(utils.Tenant),
|
||||
Path: utils.StringPointer(utils.Tenant),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~0"),
|
||||
Value: utils.StringPointer("~*req.0"),
|
||||
Mandatory: utils.BoolPointer(true)},
|
||||
{Tag: utils.StringPointer(utils.ID),
|
||||
Path: utils.StringPointer(utils.ID),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~1"),
|
||||
Value: utils.StringPointer("~*req.1"),
|
||||
Mandatory: utils.BoolPointer(true)},
|
||||
{Tag: utils.StringPointer("FilterIDs"),
|
||||
Path: utils.StringPointer("FilterIDs"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~2")},
|
||||
Value: utils.StringPointer("~*req.2")},
|
||||
{Tag: utils.StringPointer("ActivationInterval"),
|
||||
Path: utils.StringPointer("ActivationInterval"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~3")},
|
||||
Value: utils.StringPointer("~*req.3")},
|
||||
{Tag: utils.StringPointer("MaxHits"),
|
||||
Path: utils.StringPointer("MaxHits"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~4")},
|
||||
Value: utils.StringPointer("~*req.4")},
|
||||
{Tag: utils.StringPointer("MinHits"),
|
||||
Path: utils.StringPointer("MinHits"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~5")},
|
||||
Value: utils.StringPointer("~*req.5")},
|
||||
{Tag: utils.StringPointer("MinSleep"),
|
||||
Path: utils.StringPointer("MinSleep"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~6")},
|
||||
Value: utils.StringPointer("~*req.6")},
|
||||
{Tag: utils.StringPointer("Blocker"),
|
||||
Path: utils.StringPointer("Blocker"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~7")},
|
||||
Value: utils.StringPointer("~*req.7")},
|
||||
{Tag: utils.StringPointer("Weight"),
|
||||
Path: utils.StringPointer("Weight"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~8")},
|
||||
Value: utils.StringPointer("~*req.8")},
|
||||
{Tag: utils.StringPointer("ActionIDs"),
|
||||
Path: utils.StringPointer("ActionIDs"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~9")},
|
||||
Value: utils.StringPointer("~*req.9")},
|
||||
{Tag: utils.StringPointer("Async"),
|
||||
Path: utils.StringPointer("Async"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~10")},
|
||||
Value: utils.StringPointer("~*req.10")},
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -1411,69 +1411,69 @@ func TestDfLoaderJsonCfg(t *testing.T) {
|
||||
{Tag: utils.StringPointer(utils.Tenant),
|
||||
Path: utils.StringPointer(utils.Tenant),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~0"),
|
||||
Value: utils.StringPointer("~*req.0"),
|
||||
Mandatory: utils.BoolPointer(true)},
|
||||
{Tag: utils.StringPointer(utils.ID),
|
||||
Path: utils.StringPointer(utils.ID),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~1"),
|
||||
Value: utils.StringPointer("~*req.1"),
|
||||
Mandatory: utils.BoolPointer(true)},
|
||||
{Tag: utils.StringPointer("FilterIDs"),
|
||||
Path: utils.StringPointer("FilterIDs"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~2")},
|
||||
Value: utils.StringPointer("~*req.2")},
|
||||
{Tag: utils.StringPointer("ActivationInterval"),
|
||||
Path: utils.StringPointer("ActivationInterval"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~3")},
|
||||
Value: utils.StringPointer("~*req.3")},
|
||||
{Tag: utils.StringPointer("Sorting"),
|
||||
Path: utils.StringPointer("Sorting"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~4")},
|
||||
Value: utils.StringPointer("~*req.4")},
|
||||
{Tag: utils.StringPointer("SortingParameters"),
|
||||
Path: utils.StringPointer("SortingParameters"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~5")},
|
||||
Value: utils.StringPointer("~*req.5")},
|
||||
{Tag: utils.StringPointer("RouteID"),
|
||||
Path: utils.StringPointer("RouteID"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~6")},
|
||||
Value: utils.StringPointer("~*req.6")},
|
||||
{Tag: utils.StringPointer("RouteFilterIDs"),
|
||||
Path: utils.StringPointer("RouteFilterIDs"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~7")},
|
||||
Value: utils.StringPointer("~*req.7")},
|
||||
{Tag: utils.StringPointer("RouteAccountIDs"),
|
||||
Path: utils.StringPointer("RouteAccountIDs"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~8")},
|
||||
Value: utils.StringPointer("~*req.8")},
|
||||
{Tag: utils.StringPointer("RouteRatingPlanIDs"),
|
||||
Path: utils.StringPointer("RouteRatingPlanIDs"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~9")},
|
||||
Value: utils.StringPointer("~*req.9")},
|
||||
{Tag: utils.StringPointer("RouteResourceIDs"),
|
||||
Path: utils.StringPointer("RouteResourceIDs"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~10")},
|
||||
Value: utils.StringPointer("~*req.10")},
|
||||
{Tag: utils.StringPointer("RouteStatIDs"),
|
||||
Path: utils.StringPointer("RouteStatIDs"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~11")},
|
||||
Value: utils.StringPointer("~*req.11")},
|
||||
{Tag: utils.StringPointer("RouteWeight"),
|
||||
Path: utils.StringPointer("RouteWeight"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~12")},
|
||||
Value: utils.StringPointer("~*req.12")},
|
||||
{Tag: utils.StringPointer("RouteBlocker"),
|
||||
Path: utils.StringPointer("RouteBlocker"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~13")},
|
||||
Value: utils.StringPointer("~*req.13")},
|
||||
{Tag: utils.StringPointer("RouteParameters"),
|
||||
Path: utils.StringPointer("RouteParameters"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~14")},
|
||||
Value: utils.StringPointer("~*req.14")},
|
||||
{Tag: utils.StringPointer("Weight"),
|
||||
Path: utils.StringPointer("Weight"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~15")},
|
||||
Value: utils.StringPointer("~*req.15")},
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -1483,33 +1483,33 @@ func TestDfLoaderJsonCfg(t *testing.T) {
|
||||
{Tag: utils.StringPointer(utils.Tenant),
|
||||
Path: utils.StringPointer(utils.Tenant),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~0"),
|
||||
Value: utils.StringPointer("~*req.0"),
|
||||
Mandatory: utils.BoolPointer(true)},
|
||||
{Tag: utils.StringPointer(utils.ID),
|
||||
Path: utils.StringPointer(utils.ID),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~1"),
|
||||
Value: utils.StringPointer("~*req.1"),
|
||||
Mandatory: utils.BoolPointer(true)},
|
||||
{Tag: utils.StringPointer("FilterIDs"),
|
||||
Path: utils.StringPointer("FilterIDs"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~2")},
|
||||
Value: utils.StringPointer("~*req.2")},
|
||||
{Tag: utils.StringPointer("ActivationInterval"),
|
||||
Path: utils.StringPointer("ActivationInterval"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~3")},
|
||||
Value: utils.StringPointer("~*req.3")},
|
||||
{Tag: utils.StringPointer("RunID"),
|
||||
Path: utils.StringPointer("RunID"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~4")},
|
||||
Value: utils.StringPointer("~*req.4")},
|
||||
{Tag: utils.StringPointer("AttributeIDs"),
|
||||
Path: utils.StringPointer("AttributeIDs"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~5")},
|
||||
Value: utils.StringPointer("~*req.5")},
|
||||
{Tag: utils.StringPointer("Weight"),
|
||||
Path: utils.StringPointer("Weight"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~6")},
|
||||
Value: utils.StringPointer("~*req.6")},
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -1519,57 +1519,57 @@ func TestDfLoaderJsonCfg(t *testing.T) {
|
||||
{Tag: utils.StringPointer(utils.Tenant),
|
||||
Path: utils.StringPointer(utils.Tenant),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~0"),
|
||||
Value: utils.StringPointer("~*req.0"),
|
||||
Mandatory: utils.BoolPointer(true)},
|
||||
{Tag: utils.StringPointer(utils.ID),
|
||||
Path: utils.StringPointer(utils.ID),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~1"),
|
||||
Value: utils.StringPointer("~*req.1"),
|
||||
Mandatory: utils.BoolPointer(true)},
|
||||
{Tag: utils.StringPointer("Contexts"),
|
||||
Path: utils.StringPointer("Contexts"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~2")},
|
||||
Value: utils.StringPointer("~*req.2")},
|
||||
{Tag: utils.StringPointer("FilterIDs"),
|
||||
Path: utils.StringPointer("FilterIDs"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~3")},
|
||||
Value: utils.StringPointer("~*req.3")},
|
||||
{Tag: utils.StringPointer("ActivationInterval"),
|
||||
Path: utils.StringPointer("ActivationInterval"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~4")},
|
||||
Value: utils.StringPointer("~*req.4")},
|
||||
{Tag: utils.StringPointer("Strategy"),
|
||||
Path: utils.StringPointer("Strategy"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~5")},
|
||||
Value: utils.StringPointer("~*req.5")},
|
||||
{Tag: utils.StringPointer("StrategyParameters"),
|
||||
Path: utils.StringPointer("StrategyParameters"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~6")},
|
||||
Value: utils.StringPointer("~*req.6")},
|
||||
{Tag: utils.StringPointer("ConnID"),
|
||||
Path: utils.StringPointer("ConnID"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~7")},
|
||||
Value: utils.StringPointer("~*req.7")},
|
||||
{Tag: utils.StringPointer("ConnFilterIDs"),
|
||||
Path: utils.StringPointer("ConnFilterIDs"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~8")},
|
||||
Value: utils.StringPointer("~*req.8")},
|
||||
{Tag: utils.StringPointer("ConnWeight"),
|
||||
Path: utils.StringPointer("ConnWeight"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~9")},
|
||||
Value: utils.StringPointer("~*req.9")},
|
||||
{Tag: utils.StringPointer("ConnBlocker"),
|
||||
Path: utils.StringPointer("ConnBlocker"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~10")},
|
||||
Value: utils.StringPointer("~*req.10")},
|
||||
{Tag: utils.StringPointer("ConnParameters"),
|
||||
Path: utils.StringPointer("ConnParameters"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~11")},
|
||||
Value: utils.StringPointer("~*req.11")},
|
||||
{Tag: utils.StringPointer("Weight"),
|
||||
Path: utils.StringPointer("Weight"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~12")},
|
||||
Value: utils.StringPointer("~*req.12")},
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -1579,25 +1579,25 @@ func TestDfLoaderJsonCfg(t *testing.T) {
|
||||
{Tag: utils.StringPointer(utils.Tenant),
|
||||
Path: utils.StringPointer(utils.Tenant),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~0"),
|
||||
Value: utils.StringPointer("~*req.0"),
|
||||
Mandatory: utils.BoolPointer(true)},
|
||||
{Tag: utils.StringPointer(utils.ID),
|
||||
Path: utils.StringPointer(utils.ID),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~1"),
|
||||
Value: utils.StringPointer("~*req.1"),
|
||||
Mandatory: utils.BoolPointer(true)},
|
||||
{Tag: utils.StringPointer("Address"),
|
||||
Path: utils.StringPointer("Address"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~2")},
|
||||
Value: utils.StringPointer("~*req.2")},
|
||||
{Tag: utils.StringPointer("Transport"),
|
||||
Path: utils.StringPointer("Transport"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~3")},
|
||||
Value: utils.StringPointer("~*req.3")},
|
||||
{Tag: utils.StringPointer("TLS"),
|
||||
Path: utils.StringPointer("TLS"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~4")},
|
||||
Value: utils.StringPointer("~*req.4")},
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -1607,77 +1607,77 @@ func TestDfLoaderJsonCfg(t *testing.T) {
|
||||
{Tag: utils.StringPointer(utils.Tenant),
|
||||
Path: utils.StringPointer(utils.Tenant),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~0"),
|
||||
Value: utils.StringPointer("~*req.0"),
|
||||
Mandatory: utils.BoolPointer(true)},
|
||||
{Tag: utils.StringPointer(utils.ID),
|
||||
Path: utils.StringPointer(utils.ID),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~1"),
|
||||
Value: utils.StringPointer("~*req.1"),
|
||||
Mandatory: utils.BoolPointer(true)},
|
||||
{Tag: utils.StringPointer("FilterIDs"),
|
||||
Path: utils.StringPointer("FilterIDs"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~2")},
|
||||
Value: utils.StringPointer("~*req.2")},
|
||||
{Tag: utils.StringPointer("ActivationInterval"),
|
||||
Path: utils.StringPointer("ActivationInterval"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~3")},
|
||||
Value: utils.StringPointer("~*req.3")},
|
||||
{Tag: utils.StringPointer("Weight"),
|
||||
Path: utils.StringPointer("Weight"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~4")},
|
||||
Value: utils.StringPointer("~*req.4")},
|
||||
{Tag: utils.StringPointer("ConnectFee"),
|
||||
Path: utils.StringPointer("ConnectFee"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~5")},
|
||||
Value: utils.StringPointer("~*req.5")},
|
||||
{Tag: utils.StringPointer("RoundingMethod"),
|
||||
Path: utils.StringPointer("RoundingMethod"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~6")},
|
||||
Value: utils.StringPointer("~*req.6")},
|
||||
{Tag: utils.StringPointer("RoundingDecimals"),
|
||||
Path: utils.StringPointer("RoundingDecimals"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~7")},
|
||||
Value: utils.StringPointer("~*req.7")},
|
||||
{Tag: utils.StringPointer("MinCost"),
|
||||
Path: utils.StringPointer("MinCost"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~8")},
|
||||
Value: utils.StringPointer("~*req.8")},
|
||||
{Tag: utils.StringPointer("MaxCost"),
|
||||
Path: utils.StringPointer("MaxCost"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~9")},
|
||||
Value: utils.StringPointer("~*req.9")},
|
||||
{Tag: utils.StringPointer("MaxCostStrategy"),
|
||||
Path: utils.StringPointer("MaxCostStrategy"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~10")},
|
||||
Value: utils.StringPointer("~*req.10")},
|
||||
{Tag: utils.StringPointer("RateID"),
|
||||
Path: utils.StringPointer("RateID"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~11")},
|
||||
Value: utils.StringPointer("~*req.11")},
|
||||
{Tag: utils.StringPointer("RateFilterIDs"),
|
||||
Path: utils.StringPointer("RateFilterIDs"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~12")},
|
||||
Value: utils.StringPointer("~*req.12")},
|
||||
{Tag: utils.StringPointer("RateWeight"),
|
||||
Path: utils.StringPointer("RateWeight"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~13")},
|
||||
Value: utils.StringPointer("~*req.13")},
|
||||
{Tag: utils.StringPointer("RateValue"),
|
||||
Path: utils.StringPointer("RateValue"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~14")},
|
||||
Value: utils.StringPointer("~*req.14")},
|
||||
{Tag: utils.StringPointer("RateUnit"),
|
||||
Path: utils.StringPointer("RateUnit"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~15")},
|
||||
Value: utils.StringPointer("~*req.15")},
|
||||
{Tag: utils.StringPointer("RateIncrement"),
|
||||
Path: utils.StringPointer("RateIncrement"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~16")},
|
||||
Value: utils.StringPointer("~*req.16")},
|
||||
{Tag: utils.StringPointer("RateBlocker"),
|
||||
Path: utils.StringPointer("RateBlocker"),
|
||||
Type: utils.StringPointer(utils.MetaVariable),
|
||||
Value: utils.StringPointer("~17")},
|
||||
Value: utils.StringPointer("~*req.17")},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1048,7 +1048,7 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) {
|
||||
{Tag: "TenantID",
|
||||
Path: "Tenant",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.0", true, utils.INFIELD_SEP),
|
||||
Mandatory: true,
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
@@ -1056,7 +1056,7 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) {
|
||||
Tag: "ProfileID",
|
||||
Path: "ID",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.1", true, utils.INFIELD_SEP),
|
||||
Mandatory: true,
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
@@ -1064,57 +1064,57 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) {
|
||||
Tag: "Contexts",
|
||||
Path: "Contexts",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.2", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{
|
||||
Tag: "FilterIDs",
|
||||
Path: "FilterIDs",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.3", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{
|
||||
Tag: "ActivationInterval",
|
||||
Path: "ActivationInterval",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.4", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{
|
||||
Tag: "AttributeFilterIDs",
|
||||
Path: "AttributeFilterIDs",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.5", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{
|
||||
Tag: "Path",
|
||||
Path: "Path",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.6", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "Type",
|
||||
Path: "Type",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.7", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "Value",
|
||||
Path: "Value",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.8", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "Blocker",
|
||||
Path: "Blocker",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.9", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "Weight",
|
||||
Path: "Weight",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.10", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
},
|
||||
@@ -1126,34 +1126,34 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) {
|
||||
{Tag: "Tenant",
|
||||
Path: "Tenant",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.0", true, utils.INFIELD_SEP),
|
||||
Mandatory: true,
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "ID",
|
||||
Path: "ID",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.1", true, utils.INFIELD_SEP),
|
||||
Mandatory: true,
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "Type",
|
||||
Path: "Type",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.2", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "Element",
|
||||
Path: "Element",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.3", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "Values",
|
||||
Path: "Values",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.4", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "ActivationInterval",
|
||||
Path: "ActivationInterval",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.5", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
},
|
||||
},
|
||||
@@ -1164,59 +1164,59 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) {
|
||||
{Tag: "Tenant",
|
||||
Path: "Tenant",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.0", true, utils.INFIELD_SEP),
|
||||
Mandatory: true,
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "ID",
|
||||
Path: "ID",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.1", true, utils.INFIELD_SEP),
|
||||
Mandatory: true,
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "FilterIDs",
|
||||
Path: "FilterIDs",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.2", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "ActivationInterval",
|
||||
Path: "ActivationInterval",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.3", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "TTL",
|
||||
Path: "UsageTTL",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.4", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "Limit",
|
||||
Path: "Limit",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.5", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "AllocationMessage",
|
||||
Path: "AllocationMessage",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.6", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "Blocker",
|
||||
Path: "Blocker",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.7", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "Stored",
|
||||
Path: "Stored",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.8", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "Weight",
|
||||
Path: "Weight",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.9", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "ThresholdIDs",
|
||||
Path: "ThresholdIDs",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.10", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
},
|
||||
},
|
||||
@@ -1227,70 +1227,70 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) {
|
||||
{Tag: "Tenant",
|
||||
Path: "Tenant",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.0", true, utils.INFIELD_SEP),
|
||||
Mandatory: true,
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "ID",
|
||||
Path: "ID",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.1", true, utils.INFIELD_SEP),
|
||||
Mandatory: true,
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "FilterIDs",
|
||||
Path: "FilterIDs",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.2", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "ActivationInterval",
|
||||
Path: "ActivationInterval",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.3", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "QueueLength",
|
||||
Path: "QueueLength",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.4", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "TTL",
|
||||
Path: "TTL",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.5", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "MinItems",
|
||||
Path: "MinItems",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.6", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "MetricIDs",
|
||||
Path: "MetricIDs",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.7", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "MetricFilterIDs",
|
||||
Path: "MetricFilterIDs",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.8", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "Blocker",
|
||||
Path: "Blocker",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.9", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "Stored",
|
||||
Path: "Stored",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.10", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "Weight",
|
||||
Path: "Weight",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~11", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.11", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
|
||||
{Tag: "ThresholdIDs",
|
||||
Path: "ThresholdIDs",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~12", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.12", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
},
|
||||
},
|
||||
@@ -1301,59 +1301,59 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) {
|
||||
{Tag: "Tenant",
|
||||
Path: "Tenant",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.0", true, utils.INFIELD_SEP),
|
||||
Mandatory: true,
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "ID",
|
||||
Path: "ID",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.1", true, utils.INFIELD_SEP),
|
||||
Mandatory: true,
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "FilterIDs",
|
||||
Path: "FilterIDs",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.2", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "ActivationInterval",
|
||||
Path: "ActivationInterval",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.3", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "MaxHits",
|
||||
Path: "MaxHits",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.4", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "MinHits",
|
||||
Path: "MinHits",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.5", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "MinSleep",
|
||||
Path: "MinSleep",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.6", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "Blocker",
|
||||
Path: "Blocker",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.7", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "Weight",
|
||||
Path: "Weight",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.8", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "ActionIDs",
|
||||
Path: "ActionIDs",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.9", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "Async",
|
||||
Path: "Async",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.10", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
},
|
||||
},
|
||||
@@ -1364,84 +1364,84 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) {
|
||||
{Tag: "Tenant",
|
||||
Path: "Tenant",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.0", true, utils.INFIELD_SEP),
|
||||
Mandatory: true,
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "ID",
|
||||
Path: "ID",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.1", true, utils.INFIELD_SEP),
|
||||
Mandatory: true,
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "FilterIDs",
|
||||
Path: "FilterIDs",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.2", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "ActivationInterval",
|
||||
Path: "ActivationInterval",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.3", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "Sorting",
|
||||
Path: "Sorting",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.4", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "SortingParameters",
|
||||
Path: "SortingParameters",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.5", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "RouteID",
|
||||
Path: "RouteID",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.6", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "RouteFilterIDs",
|
||||
Path: "RouteFilterIDs",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.7", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "RouteAccountIDs",
|
||||
Path: "RouteAccountIDs",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.8", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "RouteRatingPlanIDs",
|
||||
Path: "RouteRatingPlanIDs",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.9", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "RouteResourceIDs",
|
||||
Path: "RouteResourceIDs",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.10", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "RouteStatIDs",
|
||||
Path: "RouteStatIDs",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~11", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.11", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "RouteWeight",
|
||||
Path: "RouteWeight",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~12", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.12", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "RouteBlocker",
|
||||
Path: "RouteBlocker",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~13", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.13", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "RouteParameters",
|
||||
Path: "RouteParameters",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~14", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.14", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "Weight",
|
||||
Path: "Weight",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~15", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.15", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
},
|
||||
},
|
||||
@@ -1452,39 +1452,39 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) {
|
||||
{Tag: "Tenant",
|
||||
Path: "Tenant",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.0", true, utils.INFIELD_SEP),
|
||||
Mandatory: true,
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "ID",
|
||||
Path: "ID",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.1", true, utils.INFIELD_SEP),
|
||||
Mandatory: true,
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "FilterIDs",
|
||||
Path: "FilterIDs",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.2", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "ActivationInterval",
|
||||
Path: "ActivationInterval",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.3", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "RunID",
|
||||
Path: "RunID",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.4", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "AttributeIDs",
|
||||
Path: "AttributeIDs",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.5", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "Weight",
|
||||
Path: "Weight",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.6", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339},
|
||||
},
|
||||
},
|
||||
@@ -1495,79 +1495,79 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) {
|
||||
{Tag: "Tenant",
|
||||
Path: "Tenant",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.0", true, utils.INFIELD_SEP),
|
||||
Mandatory: true,
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "ID",
|
||||
Path: "ID",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.1", true, utils.INFIELD_SEP),
|
||||
Mandatory: true,
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "Contexts",
|
||||
Path: "Contexts",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.2", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "FilterIDs",
|
||||
Path: "FilterIDs",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.3", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "ActivationInterval",
|
||||
Path: "ActivationInterval",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.4", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "Strategy",
|
||||
Path: "Strategy",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.5", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "StrategyParameters",
|
||||
Path: "StrategyParameters",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.6", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "ConnID",
|
||||
Path: "ConnID",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.7", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "ConnFilterIDs",
|
||||
Path: "ConnFilterIDs",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.8", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "ConnWeight",
|
||||
Path: "ConnWeight",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.9", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "ConnBlocker",
|
||||
Path: "ConnBlocker",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.10", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "ConnParameters",
|
||||
Path: "ConnParameters",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~11", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.11", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "Weight",
|
||||
Path: "Weight",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~12", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.12", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
},
|
||||
@@ -1579,31 +1579,31 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) {
|
||||
{Tag: "Tenant",
|
||||
Path: "Tenant",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.0", true, utils.INFIELD_SEP),
|
||||
Mandatory: true,
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "ID",
|
||||
Path: "ID",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.1", true, utils.INFIELD_SEP),
|
||||
Mandatory: true,
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "Address",
|
||||
Path: "Address",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.2", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "Transport",
|
||||
Path: "Transport",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.3", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "TLS",
|
||||
Path: "TLS",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.4", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
},
|
||||
@@ -1615,109 +1615,109 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) {
|
||||
{Tag: "Tenant",
|
||||
Path: "Tenant",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.0", true, utils.INFIELD_SEP),
|
||||
Mandatory: true,
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "ID",
|
||||
Path: "ID",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.1", true, utils.INFIELD_SEP),
|
||||
Mandatory: true,
|
||||
Layout: time.RFC3339},
|
||||
{Tag: "FilterIDs",
|
||||
Path: "FilterIDs",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.2", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "ActivationInterval",
|
||||
Path: "ActivationInterval",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.3", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "Weight",
|
||||
Path: "Weight",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.4", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "ConnectFee",
|
||||
Path: "ConnectFee",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.5", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "RoundingMethod",
|
||||
Path: "RoundingMethod",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.6", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "RoundingDecimals",
|
||||
Path: "RoundingDecimals",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.7", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "MinCost",
|
||||
Path: "MinCost",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.8", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "MaxCost",
|
||||
Path: "MaxCost",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.9", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "MaxCostStrategy",
|
||||
Path: "MaxCostStrategy",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.10", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "RateID",
|
||||
Path: "RateID",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~11", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.11", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "RateFilterIDs",
|
||||
Path: "RateFilterIDs",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~12", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.12", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "RateWeight",
|
||||
Path: "RateWeight",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~13", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.13", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "RateValue",
|
||||
Path: "RateValue",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~14", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.14", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "RateUnit",
|
||||
Path: "RateUnit",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~15", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.15", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "RateIncrement",
|
||||
Path: "RateIncrement",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~16", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.16", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
{Tag: "RateBlocker",
|
||||
Path: "RateBlocker",
|
||||
Type: utils.MetaVariable,
|
||||
Value: NewRSRParsersMustCompile("~17", true, utils.INFIELD_SEP),
|
||||
Value: NewRSRParsersMustCompile("~*req.17", true, utils.INFIELD_SEP),
|
||||
Layout: time.RFC3339,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -205,6 +205,9 @@ func (eeC *EventExporterCfg) loadFromJsonCfg(jsnEec *EventExporterJsonCfg, separ
|
||||
case utils.MetaTrl:
|
||||
eeC.trailerFields = append(eeC.trailerFields, field)
|
||||
}
|
||||
if strings.HasPrefix(field.GetPathSlice()[0], utils.MetaCache) { // special cache when loading fields that contains *cache in path
|
||||
eeC.contentFields = append(eeC.contentFields, field)
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
|
||||
@@ -49,7 +49,7 @@ type GeneralCfg struct {
|
||||
LockingTimeout time.Duration // locking mechanism timeout to avoid deadlocks
|
||||
DigestSeparator string //
|
||||
DigestEqual string //
|
||||
RSRSep string // separator used to split RSRParser (by degault is used ";")
|
||||
RSRSep string // separator used to split RSRParser (by default is used ";")
|
||||
MaxParralelConns int // the maximum number of connection used by the *parallel strategy
|
||||
}
|
||||
|
||||
|
||||
@@ -269,6 +269,74 @@
|
||||
{"tag": "Usage", "path": "*exp.Usage", "type": "*variable", "value": "~*req.Usage"},
|
||||
{"tag": "Cost", "path": "*exp.Cost", "type": "*variable", "value": "~*req.Cost{*round:4}"},
|
||||
],
|
||||
},
|
||||
{
|
||||
"id": "CSVMaskedDestination",
|
||||
"type": "*file_csv",
|
||||
"export_path": "/tmp/testCSVMasked",
|
||||
"tenant": "cgrates.org",
|
||||
"flags": ["*attributes"],
|
||||
"attribute_context": "customContext",
|
||||
"attempts": 1,
|
||||
"field_separator": ",",
|
||||
"filters": ["*string:~*req.ExporterUsed:CSVMaskedDestination"],
|
||||
"fields":[
|
||||
{"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
|
||||
{"tag": "RunID", "path": "*exp.RunID", "type": "*variable", "value": "~*req.RunID"},
|
||||
{"tag": "ToR", "path": "*exp.ToR", "type": "*variable", "value": "~*req.ToR"},
|
||||
{"tag": "OriginID", "path": "*exp.OriginID", "type": "*variable", "value": "~*req.OriginID"},
|
||||
{"tag": "RequestType", "path": "*exp.RequestType", "type": "*variable", "value": "~*req.RequestType"},
|
||||
{"tag": "Tenant", "path": "*exp.Tenant", "type": "*variable", "value": "~*req.Tenant"},
|
||||
{"tag": "Category", "path": "*exp.Category", "type": "*variable", "value": "~*req.Category"},
|
||||
{"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"},
|
||||
{"tag": "Subject", "path": "*exp.Subject", "type": "*variable", "value": "~*req.Subject"},
|
||||
{"tag": "Destination", "path": "*exp.Destination", "type": "*masked_destination",
|
||||
"value": "~*req.Destination", "mask_destinationd_id": "MASKED_DESTINATIONS", "mask_length": 3},
|
||||
{"tag": "SetupTime", "path": "*exp.SetupTime", "type": "*variable", "value": "~*req.SetupTime", "layout": "2006-01-02T15:04:05Z07:00"},
|
||||
{"tag": "AnswerTime", "path": "*exp.AnswerTime", "type": "*variable", "value": "~*req.AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"},
|
||||
{"tag": "Usage", "path": "*exp.Usage", "type": "*variable", "value": "~*req.Usage"},
|
||||
{"tag": "Cost", "path": "*exp.Cost", "type": "*variable", "value": "~*req.Cost{*round:4}"},
|
||||
],
|
||||
},
|
||||
{
|
||||
"id": "RouteExporter", // this exporter will set the Cost Account and RunID in cache so we can use it in other exports
|
||||
"type": "*virt",
|
||||
"tenant": "cgrates.org",
|
||||
"attempts": 1,
|
||||
"filters": ["*string:~*req.ExporterUsed:RouteExporter"],
|
||||
"fields":[
|
||||
{"tag": "Cost", "path": "*cache[~*req.CGRID|~*req.RunID|-Cost]", "type": "*variable",
|
||||
"value": "~*req.Cost", "rounding_decimals": 4},
|
||||
{"tag": "Account", "path": "*cache[~*req.CGRID|~*req.RunID|-Account]", "type": "*variable", "value": "~*req.Account"},
|
||||
{"tag": "RunID", "path": "*cache[~*req.CGRID|~*req.RunID|-RunID]", "type": "*variable", "value": "~*req.RunID"},
|
||||
{"tag": "CustomVariable", "path": "*cache[~*req.CGRID|~*req.RunID|-CustomVariable]",
|
||||
"type": "*variable", "value": "CustomValue"}
|
||||
],
|
||||
},
|
||||
{
|
||||
"id": "CSVExporterFromVirt",
|
||||
"type": "*file_csv",
|
||||
"export_path": "/tmp/testCSVfromVirt",
|
||||
"tenant": "cgrates.org",
|
||||
"flags": ["*attributes"],
|
||||
"attribute_context": "customContext",
|
||||
"attempts": 1,
|
||||
"field_separator": ",",
|
||||
"filters": ["*string:~*req.ExporterUsed:CSVExporterFromVirt"],
|
||||
"fields":[
|
||||
{"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
|
||||
{"tag": "RunID", "path": "*exp.RunID", "type": "*variable", "value": "~*req.RunID"},
|
||||
{"tag": "OriginID", "path": "*exp.OriginID", "type": "*variable", "value": "~*req.OriginID"},
|
||||
{"tag": "Tenant", "path": "*exp.Tenant", "type": "*variable", "value": "~*req.Tenant"},
|
||||
{"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"},
|
||||
{"tag": "Cost", "path": "*exp.Cost", "type": "*variable", "value": "~*req.Cost", "rounding_decimals": 4},
|
||||
{"tag": "SupplierCustomVariable","filters": ["*exists:*cache[~*req.CGRID|~*req.RunID|-CustomVariable]:"],
|
||||
"path": "*exp.SupplierCustomVariable", "type": "*variable", "value": "~*cache[~*req.CGRID|~*req.RunID|-CustomVariable]"},
|
||||
{"tag": "SupplierCost","filters": ["*exists:*cache[~*req.CGRID|~*req.RunID|-Cost]:"],
|
||||
"path": "*exp.SupplierCost", "type": "*variable", "value": "~*cache[~*req.CGRID|~*req.RunID|-Cost]"},
|
||||
{"tag": "SupplierRun","filters": ["*exists:*cache[~*req.CGRID|~*req.RunID|-RunID]:"],
|
||||
"path": "*exp.SupplierRun", "type": "*variable", "value": "~*cache[~*req.CGRID|~*req.RunID|-RunID]"},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -120,17 +120,17 @@
|
||||
"type": "*attributes", // data source type
|
||||
"file_name": "Attributes.csv", // file name in the tp_in_dir
|
||||
"fields": [
|
||||
{"tag": "TenantID", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true},
|
||||
{"tag": "ProfileID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true},
|
||||
{"tag": "Contexts", "path": "Contexts", "type": "*variable", "value": "~2"},
|
||||
{"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~3"},
|
||||
{"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~4"},
|
||||
{"tag": "AttributeFilterIDs", "path": "AttributeFilterIDs", "type": "*variable", "value": "~5"},
|
||||
{"tag": "Path", "path": "Path", "type": "*variable", "value": "~6"},
|
||||
{"tag": "Type", "path": "Type", "type": "*variable", "value": "~7"},
|
||||
{"tag": "Value", "path": "Value", "type": "*variable", "value": "~8"},
|
||||
{"tag": "Blocker", "path": "Blocker", "type": "*variable", "value": "~9"},
|
||||
{"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~10"},
|
||||
{"tag": "TenantID", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true},
|
||||
{"tag": "ProfileID", "path": "ID", "type": "*variable", "value": "~*req.1", "mandatory": true},
|
||||
{"tag": "Contexts", "path": "Contexts", "type": "*variable", "value": "~*req.2"},
|
||||
{"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~*req.3"},
|
||||
{"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~*req.4"},
|
||||
{"tag": "AttributeFilterIDs", "path": "AttributeFilterIDs", "type": "*variable", "value": "~*req.5"},
|
||||
{"tag": "Path", "path": "Path", "type": "*variable", "value": "~*req.6"},
|
||||
{"tag": "Type", "path": "Type", "type": "*variable", "value": "~*req.7"},
|
||||
{"tag": "Value", "path": "Value", "type": "*variable", "value": "~*req.8"},
|
||||
{"tag": "Blocker", "path": "Blocker", "type": "*variable", "value": "~*req.9"},
|
||||
{"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~*req.10"},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -80,17 +80,17 @@
|
||||
"type": "*attributes", // data source type
|
||||
"file_name": "Attributes.csv", // file name in the tp_in_dir
|
||||
"fields": [
|
||||
{"tag": "TenantID", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true},
|
||||
{"tag": "ProfileID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true},
|
||||
{"tag": "Contexts", "path": "Contexts", "type": "*variable", "value": "~2"},
|
||||
{"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~3"},
|
||||
{"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~4"},
|
||||
{"tag": "AttributeFilterIDs", "path": "AttributeFilterIDs", "type": "*variable", "value": "~5"},
|
||||
{"tag": "Path", "path": "Path", "type": "*variable", "value": "~6"},
|
||||
{"tag": "Type", "path": "Type", "type": "*variable", "value": "~7"},
|
||||
{"tag": "Value", "path": "Value", "type": "*variable", "value": "~8"},
|
||||
{"tag": "Blocker", "path": "Blocker", "type": "*variable", "value": "~9"},
|
||||
{"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~10"},
|
||||
{"tag": "TenantID", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true},
|
||||
{"tag": "ProfileID", "path": "ID", "type": "*variable", "value": "~*req.1", "mandatory": true},
|
||||
{"tag": "Contexts", "path": "Contexts", "type": "*variable", "value": "~*req.2"},
|
||||
{"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~*req.3"},
|
||||
{"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~*req.4"},
|
||||
{"tag": "AttributeFilterIDs", "path": "AttributeFilterIDs", "type": "*variable", "value": "~*req.5"},
|
||||
{"tag": "Path", "path": "Path", "type": "*variable", "value": "~*req.6"},
|
||||
{"tag": "Type", "path": "Type", "type": "*variable", "value": "~*req.7"},
|
||||
{"tag": "Value", "path": "Value", "type": "*variable", "value": "~*req.8"},
|
||||
{"tag": "Blocker", "path": "Blocker", "type": "*variable", "value": "~*req.9"},
|
||||
{"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~*req.10"},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -43,6 +43,8 @@ func NewEventExporter(cgrCfg *config.CGRConfig, cfgIdx int, filterS *engine.Filt
|
||||
return NewHTTPPostEe(cgrCfg, cfgIdx, filterS, dc)
|
||||
case utils.MetaHTTPjsonMap, utils.MetaAMQPjsonMap, utils.MetaAMQPV1jsonMap, utils.MetaSQSjsonMap, utils.MetaKafkajsonMap, utils.MetaS3jsonMap:
|
||||
return NewHTTPJsonMapEe(cgrCfg, cfgIdx, filterS, dc)
|
||||
case utils.MetaVirt:
|
||||
return NewVirtualExporter(cgrCfg, cfgIdx, filterS, dc)
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported exporter type: <%s>", cgrCfg.EEsCfg().Exporters[cfgIdx].Type)
|
||||
}
|
||||
|
||||
11
ees/eereq.go
11
ees/eereq.go
@@ -127,11 +127,12 @@ func (eeR *EventExporterRequest) FieldAsString(fldPath []string) (val string, er
|
||||
func (eeR *EventExporterRequest) SetFields(tplFlds []*config.FCTemplate) (err error) {
|
||||
for _, tplFld := range tplFlds {
|
||||
if pass, err := eeR.filterS.Pass(eeR.tnt,
|
||||
tplFld.Filters, eeR); err != nil {
|
||||
tplFld.Filters, eeR.dynamicProvider); err != nil {
|
||||
return err
|
||||
} else if !pass {
|
||||
continue
|
||||
}
|
||||
|
||||
var out interface{}
|
||||
out, err = eeR.ParseField(tplFld)
|
||||
if err != nil {
|
||||
@@ -157,7 +158,6 @@ func (eeR *EventExporterRequest) SetFields(tplFlds []*config.FCTemplate) (err er
|
||||
} else {
|
||||
itmPath = fullPath.PathItems.Slice()[1:]
|
||||
}
|
||||
|
||||
nMItm := &config.NMItem{Data: out, Path: itmPath, Config: tplFld}
|
||||
switch tplFld.Type {
|
||||
case utils.META_COMPOSED:
|
||||
@@ -363,10 +363,9 @@ func (eeR *EventExporterRequest) ParseField(
|
||||
if dst, err := eeR.req.FieldAsString([]string{utils.Destination}); err != nil {
|
||||
return nil, fmt.Errorf("error <%s> getting destination for %s",
|
||||
err, utils.ToJSON(cfgFld))
|
||||
} else if len(cfgFld.MaskDestID) != 0 && engine.CachedDestHasPrefix(cfgFld.MaskDestID, dst) {
|
||||
out = "1"
|
||||
} else {
|
||||
out = "0"
|
||||
} else if cfgFld.MaskLen != -1 && len(cfgFld.MaskDestID) != 0 &&
|
||||
engine.CachedDestHasPrefix(cfgFld.MaskDestID, dst) {
|
||||
out = utils.MaskSuffix(dst, cfgFld.MaskLen)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -54,6 +54,8 @@ var (
|
||||
testCsvVerifyExports,
|
||||
testCsvExportComposedEvent,
|
||||
testCsvVerifyComposedExports,
|
||||
testCsvExportMaskedDestination,
|
||||
testCsvVerifyMaskedDestination,
|
||||
testStopCgrEngine,
|
||||
testCleanDirectory,
|
||||
}
|
||||
@@ -326,3 +328,68 @@ func testCsvVerifyComposedExports(t *testing.T) {
|
||||
t.Errorf("Expecting: \n<%q>, \nreceived: \n<%q>", eCnt, string(outContent1))
|
||||
}
|
||||
}
|
||||
|
||||
func testCsvExportMaskedDestination(t *testing.T) {
|
||||
|
||||
attrs := utils.AttrSetDestination{Id: "MASKED_DESTINATIONS", Prefixes: []string{"+4986517174963"}}
|
||||
var reply string
|
||||
if err := csvRpc.Call(utils.APIerSv1SetDestination, &attrs, &reply); err != nil {
|
||||
t.Error("Unexpected error", err.Error())
|
||||
} else if reply != utils.OK {
|
||||
t.Error("Unexpected reply returned", reply)
|
||||
}
|
||||
|
||||
eventVoice := &utils.CGREventWithOpts{
|
||||
CGREvent: &utils.CGREvent{
|
||||
Tenant: "cgrates.org",
|
||||
ID: "voiceEvent",
|
||||
Time: utils.TimePointer(time.Now()),
|
||||
Event: map[string]interface{}{
|
||||
utils.CGRID: utils.Sha1("dsafdsaf", time.Unix(1383813745, 0).UTC().String()),
|
||||
utils.ToR: utils.VOICE,
|
||||
utils.OriginID: "dsafdsaf",
|
||||
utils.OriginHost: "192.168.1.1",
|
||||
utils.RequestType: utils.META_RATED,
|
||||
utils.Tenant: "cgrates.org",
|
||||
utils.Category: "call",
|
||||
utils.Account: "1001",
|
||||
utils.Subject: "1001",
|
||||
utils.Destination: "+4986517174963",
|
||||
utils.SetupTime: time.Unix(1383813745, 0).UTC(),
|
||||
utils.AnswerTime: time.Unix(1383813746, 0).UTC(),
|
||||
utils.Usage: time.Duration(10) * time.Second,
|
||||
utils.RunID: utils.MetaDefault,
|
||||
utils.Cost: 1.01,
|
||||
"ExporterUsed": "CSVMaskedDestination",
|
||||
},
|
||||
},
|
||||
}
|
||||
if err := csvRpc.Call(utils.EventExporterSv1ProcessEvent, eventVoice, &reply); err != nil {
|
||||
t.Error(err)
|
||||
} else if reply != utils.OK {
|
||||
t.Errorf("Expected %+v, received: %+v", utils.OK, reply)
|
||||
}
|
||||
time.Sleep(1 * time.Second)
|
||||
}
|
||||
|
||||
func testCsvVerifyMaskedDestination(t *testing.T) {
|
||||
var files []string
|
||||
err := filepath.Walk("/tmp/testCSVMasked/", func(path string, info os.FileInfo, err error) error {
|
||||
if strings.HasSuffix(path, utils.CSVSuffix) {
|
||||
files = append(files, path)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
if len(files) != 1 {
|
||||
t.Errorf("Expected %+v, received: %+v", 1, len(files))
|
||||
}
|
||||
eCnt := "dbafe9c8614c785a65aabd116dd3959c3c56f7f6,*default,*voice,dsafdsaf,*rated,cgrates.org,call,1001,1001,+4986517174***,2013-11-07T08:42:25Z,2013-11-07T08:42:26Z,10000000000,1.01\n"
|
||||
if outContent1, err := ioutil.ReadFile(files[0]); err != nil {
|
||||
t.Error(err)
|
||||
} else if eCnt != string(outContent1) {
|
||||
t.Errorf("Expecting: \n<%q>, \nreceived: \n<%q>", eCnt, string(outContent1))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ func newRPCClient(cfg *config.ListenCfg) (c *rpc.Client, err error) {
|
||||
}
|
||||
}
|
||||
|
||||
var exportPath = []string{"/tmp/testCSV", "/tmp/testComposedCSV", "/tmp/testFWV"}
|
||||
var exportPath = []string{"/tmp/testCSV", "/tmp/testComposedCSV", "/tmp/testFWV", "/tmp/testCSVMasked", "/tmp/testCSVfromVirt"}
|
||||
|
||||
func testCreateDirectory(t *testing.T) {
|
||||
for _, dir := range exportPath {
|
||||
|
||||
118
ees/virtualEe.go
Normal file
118
ees/virtualEe.go
Normal file
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
Real-time Online/Offline Charging System (OerS) for Telecom & ISP environments
|
||||
Copyright (C) ITsysCOM GmbH
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package ees
|
||||
|
||||
import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/cgrates/cgrates/config"
|
||||
"github.com/cgrates/cgrates/engine"
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
)
|
||||
|
||||
func NewVirtualExporter(cgrCfg *config.CGRConfig, cfgIdx int, filterS *engine.FilterS,
|
||||
dc utils.MapStorage) (vEe *VirtualEe, err error) {
|
||||
dc[utils.ExportID] = cgrCfg.EEsCfg().Exporters[cfgIdx].ID
|
||||
vEe = &VirtualEe{id: cgrCfg.EEsCfg().Exporters[cfgIdx].ID,
|
||||
cgrCfg: cgrCfg, cfgIdx: cfgIdx, filterS: filterS, dc: dc}
|
||||
err = vEe.init()
|
||||
return
|
||||
}
|
||||
|
||||
// VirtualEe implements EventExporter interface for .csv files
|
||||
type VirtualEe struct {
|
||||
id string
|
||||
cgrCfg *config.CGRConfig
|
||||
cfgIdx int // index of config instance within ERsCfg.Readers
|
||||
filterS *engine.FilterS
|
||||
sync.RWMutex
|
||||
dc utils.MapStorage
|
||||
}
|
||||
|
||||
// init will create all the necessary dependencies, including opening the file
|
||||
func (vEe *VirtualEe) init() (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// ID returns the identificator of this exporter
|
||||
func (vEe *VirtualEe) ID() string {
|
||||
return vEe.id
|
||||
}
|
||||
|
||||
// OnEvicted implements EventExporter, doing the cleanup before exit
|
||||
func (vEe *VirtualEe) OnEvicted(_ string, _ interface{}) {
|
||||
return
|
||||
}
|
||||
|
||||
// ExportEvent implements EventExporter
|
||||
func (vEe *VirtualEe) ExportEvent(cgrEv *utils.CGREvent) (err error) {
|
||||
vEe.Lock()
|
||||
defer vEe.Unlock()
|
||||
|
||||
vEe.dc[utils.NumberOfEvents] = vEe.dc[utils.NumberOfEvents].(int) + 1
|
||||
|
||||
req := utils.MapStorage{}
|
||||
for k, v := range cgrEv.Event {
|
||||
req[k] = v
|
||||
}
|
||||
eeReq := NewEventExporterRequest(req, vEe.dc, cgrEv.Tenant, vEe.cgrCfg.GeneralCfg().DefaultTimezone,
|
||||
vEe.filterS)
|
||||
if err = eeReq.SetFields(vEe.cgrCfg.EEsCfg().Exporters[vEe.cfgIdx].ContentFields()); err != nil {
|
||||
vEe.dc[utils.NegativeExports].(utils.StringSet).Add(cgrEv.ID)
|
||||
return
|
||||
}
|
||||
if aTime, err := cgrEv.FieldAsTime(utils.AnswerTime, vEe.cgrCfg.GeneralCfg().DefaultTimezone); err == nil {
|
||||
if vEe.dc[utils.FirstEventATime].(time.Time).IsZero() || vEe.dc[utils.FirstEventATime].(time.Time).Before(aTime) {
|
||||
vEe.dc[utils.FirstEventATime] = aTime
|
||||
}
|
||||
if aTime.After(vEe.dc[utils.LastEventATime].(time.Time)) {
|
||||
vEe.dc[utils.LastEventATime] = aTime
|
||||
}
|
||||
}
|
||||
if oID, err := cgrEv.FieldAsInt64(utils.OrderID); err == nil {
|
||||
if vEe.dc[utils.FirstExpOrderID].(int64) > oID || vEe.dc[utils.FirstExpOrderID].(int64) == 0 {
|
||||
vEe.dc[utils.FirstExpOrderID] = oID
|
||||
}
|
||||
if vEe.dc[utils.LastExpOrderID].(int64) < oID {
|
||||
vEe.dc[utils.LastExpOrderID] = oID
|
||||
}
|
||||
}
|
||||
if cost, err := cgrEv.FieldAsFloat64(utils.Cost); err == nil {
|
||||
vEe.dc[utils.TotalCost] = vEe.dc[utils.TotalCost].(float64) + cost
|
||||
}
|
||||
if tor, err := cgrEv.FieldAsString(utils.ToR); err == nil {
|
||||
if usage, err := cgrEv.FieldAsDuration(utils.Usage); err == nil {
|
||||
switch tor {
|
||||
case utils.VOICE:
|
||||
vEe.dc[utils.TotalDuration] = vEe.dc[utils.TotalDuration].(time.Duration) + usage
|
||||
case utils.SMS:
|
||||
vEe.dc[utils.TotalSMSUsage] = vEe.dc[utils.TotalSMSUsage].(time.Duration) + usage
|
||||
case utils.MMS:
|
||||
vEe.dc[utils.TotalMMSUsage] = vEe.dc[utils.TotalMMSUsage].(time.Duration) + usage
|
||||
case utils.GENERIC:
|
||||
vEe.dc[utils.TotalGenericUsage] = vEe.dc[utils.TotalGenericUsage].(time.Duration) + usage
|
||||
case utils.DATA:
|
||||
vEe.dc[utils.TotalDataUsage] = vEe.dc[utils.TotalDataUsage].(time.Duration) + usage
|
||||
}
|
||||
}
|
||||
}
|
||||
vEe.dc[utils.PositiveExports].(utils.StringSet).Add(cgrEv.ID)
|
||||
return
|
||||
}
|
||||
192
ees/virtual_ee_it_test.go
Normal file
192
ees/virtual_ee_it_test.go
Normal file
@@ -0,0 +1,192 @@
|
||||
// +build integration
|
||||
|
||||
/*
|
||||
Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments
|
||||
Copyright (C) ITsysCOM GmbH
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package ees
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"net/rpc"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
|
||||
"github.com/cgrates/cgrates/config"
|
||||
"github.com/cgrates/cgrates/engine"
|
||||
)
|
||||
|
||||
var (
|
||||
virtConfigDir string
|
||||
virtCfgPath string
|
||||
virtCfg *config.CGRConfig
|
||||
virtRpc *rpc.Client
|
||||
|
||||
sTestsVirt = []func(t *testing.T){
|
||||
testCreateDirectory,
|
||||
testVirtLoadConfig,
|
||||
testVirtResetDataDB,
|
||||
testVirtResetStorDb,
|
||||
testVirtStartEngine,
|
||||
testVirtRPCConn,
|
||||
testVirtExportSupplierEvent,
|
||||
testVirtExportEvents,
|
||||
testVirtVerifyExports,
|
||||
testStopCgrEngine,
|
||||
testCleanDirectory,
|
||||
}
|
||||
)
|
||||
|
||||
func TestVirtualExport(t *testing.T) {
|
||||
virtConfigDir = "ees"
|
||||
for _, stest := range sTestsVirt {
|
||||
t.Run(virtConfigDir, stest)
|
||||
}
|
||||
}
|
||||
|
||||
func testVirtLoadConfig(t *testing.T) {
|
||||
var err error
|
||||
virtCfgPath = path.Join(*dataDir, "conf", "samples", virtConfigDir)
|
||||
if virtCfg, err = config.NewCGRConfigFromPath(virtCfgPath); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func testVirtResetDataDB(t *testing.T) {
|
||||
if err := engine.InitDataDb(virtCfg); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func testVirtResetStorDb(t *testing.T) {
|
||||
if err := engine.InitStorDb(virtCfg); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func testVirtStartEngine(t *testing.T) {
|
||||
if _, err := engine.StopStartEngine(virtCfgPath, *waitRater); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func testVirtRPCConn(t *testing.T) {
|
||||
var err error
|
||||
virtRpc, err = newRPCClient(virtCfg.ListenCfg())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func testVirtExportSupplierEvent(t *testing.T) {
|
||||
supplierEvent := &utils.CGREventWithOpts{
|
||||
CGREvent: &utils.CGREvent{
|
||||
Tenant: "cgrates.org",
|
||||
ID: "supplierEvent",
|
||||
Time: utils.TimePointer(time.Now()),
|
||||
Event: map[string]interface{}{
|
||||
utils.CGRID: utils.Sha1("dsafdsaf", time.Unix(1383813745, 0).UTC().String()),
|
||||
utils.ToR: utils.VOICE,
|
||||
utils.OriginID: "dsafdsaf",
|
||||
utils.OriginHost: "192.168.1.1",
|
||||
utils.RequestType: utils.META_RATED,
|
||||
utils.Tenant: "cgrates.org",
|
||||
utils.Category: "call",
|
||||
utils.Account: "1001",
|
||||
utils.Subject: "1001",
|
||||
utils.Destination: "1002",
|
||||
utils.SetupTime: time.Unix(1383813745, 0).UTC(),
|
||||
utils.AnswerTime: time.Unix(1383813746, 0).UTC(),
|
||||
utils.Usage: time.Duration(10) * time.Second,
|
||||
utils.RunID: "SupplierRun",
|
||||
utils.Cost: 1.23,
|
||||
"ExporterUsed": "RouteExporter",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
var reply string
|
||||
if err := virtRpc.Call(utils.EventExporterSv1ProcessEvent, supplierEvent, &reply); err != nil {
|
||||
t.Error(err)
|
||||
} else if reply != utils.OK {
|
||||
t.Errorf("Expected %+v, received: %+v", utils.OK, reply)
|
||||
}
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
}
|
||||
|
||||
func testVirtExportEvents(t *testing.T) {
|
||||
eventVoice := &utils.CGREventWithOpts{
|
||||
CGREvent: &utils.CGREvent{
|
||||
Tenant: "cgrates.org",
|
||||
ID: "voiceEvent",
|
||||
Time: utils.TimePointer(time.Now()),
|
||||
Event: map[string]interface{}{
|
||||
utils.CGRID: utils.Sha1("dsafdsaf", time.Unix(1383813745, 0).UTC().String()),
|
||||
utils.ToR: utils.VOICE,
|
||||
utils.OriginID: "dsafdsaf",
|
||||
utils.OriginHost: "192.168.1.1",
|
||||
utils.RequestType: utils.META_RATED,
|
||||
utils.Tenant: "cgrates.org",
|
||||
utils.Category: "call",
|
||||
utils.Account: "1001",
|
||||
utils.Subject: "1001",
|
||||
utils.Destination: "1002",
|
||||
utils.SetupTime: time.Unix(1383813745, 0).UTC(),
|
||||
utils.AnswerTime: time.Unix(1383813746, 0).UTC(),
|
||||
utils.Usage: time.Duration(10) * time.Second,
|
||||
utils.RunID: "SupplierRun",
|
||||
utils.Cost: 1.01,
|
||||
"ExporterUsed": "CSVExporterFromVirt",
|
||||
},
|
||||
},
|
||||
}
|
||||
var reply string
|
||||
if err := virtRpc.Call(utils.EventExporterSv1ProcessEvent, eventVoice, &reply); err != nil {
|
||||
t.Error(err)
|
||||
} else if reply != utils.OK {
|
||||
t.Errorf("Expected %+v, received: %+v", utils.OK, reply)
|
||||
}
|
||||
time.Sleep(1 * time.Second)
|
||||
}
|
||||
|
||||
func testVirtVerifyExports(t *testing.T) {
|
||||
var files []string
|
||||
err := filepath.Walk("/tmp/testCSVfromVirt/", func(path string, info os.FileInfo, err error) error {
|
||||
if strings.HasSuffix(path, utils.CSVSuffix) {
|
||||
files = append(files, path)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
if len(files) != 1 {
|
||||
t.Errorf("Expected %+v, received: %+v", 1, len(files))
|
||||
}
|
||||
eCnt := "dbafe9c8614c785a65aabd116dd3959c3c56f7f6,SupplierRun,dsafdsaf,cgrates.org,1001,1.01,CustomValue,1.23,SupplierRun\n"
|
||||
if outContent1, err := ioutil.ReadFile(files[0]); err != nil {
|
||||
t.Error(err)
|
||||
} else if eCnt != string(outContent1) {
|
||||
t.Errorf("Expecting: \n<%q>, \nreceived: \n<%q>", eCnt, string(outContent1))
|
||||
}
|
||||
}
|
||||
@@ -549,7 +549,7 @@ func (dDP *dynamicDP) RemoteHost() net.Addr {
|
||||
|
||||
var initialDPPrefixes = utils.NewStringSet([]string{utils.MetaReq, utils.MetaVars,
|
||||
utils.MetaCgreq, utils.MetaCgrep, utils.MetaRep, utils.MetaCGRAReq,
|
||||
utils.MetaAct, utils.MetaEC})
|
||||
utils.MetaAct, utils.MetaEC, utils.MetaCache})
|
||||
|
||||
func (dDP *dynamicDP) FieldAsInterface(fldPath []string) (val interface{}, err error) {
|
||||
if len(fldPath) == 0 {
|
||||
|
||||
@@ -22,6 +22,7 @@ import (
|
||||
"fmt"
|
||||
"net"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/cgrates/cgrates/config"
|
||||
"github.com/cgrates/cgrates/engine"
|
||||
@@ -48,13 +49,13 @@ func (ld LoaderData) TenantIDStruct() utils.TenantID {
|
||||
func (ld LoaderData) UpdateFromCSV(fileName string, record []string,
|
||||
cfgTpl []*config.FCTemplate, tnt config.RSRParsers, filterS *engine.FilterS) (err error) {
|
||||
csvProvider := newCsvProvider(record, fileName)
|
||||
tenant, err := tnt.ParseValue("")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, cfgFld := range cfgTpl {
|
||||
// Make sure filters are matching
|
||||
if len(cfgFld.Filters) != 0 {
|
||||
tenant, err := tnt.ParseValue("")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if pass, err := filterS.Pass(tenant,
|
||||
cfgFld.Filters, csvProvider); err != nil {
|
||||
return err
|
||||
@@ -62,7 +63,7 @@ func (ld LoaderData) UpdateFromCSV(fileName string, record []string,
|
||||
continue // Not passes filters, ignore this CDR
|
||||
}
|
||||
}
|
||||
out, err := cfgFld.Value.ParseDataProvider(csvProvider, utils.InInFieldSep)
|
||||
out, err := cfgFld.Value.ParseDataProvider(csvProvider, utils.NestingSep)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -111,17 +112,36 @@ func (cP *csvProvider) FieldAsInterface(fldPath []string) (data interface{}, err
|
||||
return
|
||||
}
|
||||
err = nil // cancel previous err
|
||||
idx := fldPath[0]
|
||||
var fileName string
|
||||
if len(fldPath) == 2 {
|
||||
fileName = fldPath[0]
|
||||
idx = fldPath[1]
|
||||
|
||||
if splt := strings.Split(fldPath[0], utils.MatchLessThan); len(splt) != 1 {
|
||||
var fileName string
|
||||
// check for *req prefix
|
||||
if splt[0] != utils.MetaReq {
|
||||
return nil, fmt.Errorf("invalid prefix for : %s", fldPath)
|
||||
}
|
||||
fileName = splt[1]
|
||||
// find the last > and compute the name of the file
|
||||
hasGrThan := false
|
||||
for _, val := range fldPath[1:] {
|
||||
if grSplt := strings.Split(val, utils.MatchGreaterThan); len(grSplt) == 1 {
|
||||
fileName = fileName + utils.NestingSep + val
|
||||
} else {
|
||||
fileName = fileName + utils.NestingSep + grSplt[0]
|
||||
hasGrThan = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !hasGrThan {
|
||||
return nil, fmt.Errorf("filter rule <%s> needs to end in >", fldPath)
|
||||
}
|
||||
if cP.fileName != fileName {
|
||||
cP.cache.Set(fldPath, nil)
|
||||
return
|
||||
}
|
||||
} else if fldPath[0] != utils.MetaReq {
|
||||
return nil, fmt.Errorf("invalid prefix for : %s", fldPath)
|
||||
}
|
||||
if fileName != "" && cP.fileName != fileName {
|
||||
cP.cache.Set(fldPath, nil)
|
||||
return
|
||||
}
|
||||
if cfgFieldIdx, err := strconv.Atoi(idx); err != nil || len(cP.req) <= cfgFieldIdx {
|
||||
if cfgFieldIdx, err := strconv.Atoi(fldPath[len(fldPath)-1]); err != nil || len(cP.req) <= cfgFieldIdx {
|
||||
return nil, fmt.Errorf("Ignoring record: %v with error : %+v", cP.req, err)
|
||||
} else {
|
||||
data = cP.req[cfgFieldIdx]
|
||||
|
||||
@@ -31,45 +31,45 @@ func TestDataUpdateFromCSVOneFile(t *testing.T) {
|
||||
&config.FCTemplate{Tag: "TenantID",
|
||||
Path: "Tenant",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.0", true, utils.INFIELD_SEP),
|
||||
Mandatory: true},
|
||||
&config.FCTemplate{Tag: "ProfileID",
|
||||
Path: "ID",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.1", true, utils.INFIELD_SEP),
|
||||
Mandatory: true},
|
||||
&config.FCTemplate{Tag: "Contexts",
|
||||
Path: "Contexts",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.2", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "FilterIDs",
|
||||
Path: "FilterIDs",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.3", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "ActivationInterval",
|
||||
Path: "ActivationInterval",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.4", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Path",
|
||||
Path: "Path",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.5", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Initial",
|
||||
Path: "Initial",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.6", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Substitute",
|
||||
Path: "Substitute",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.7", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Append",
|
||||
Path: "Append",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.8", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Weight",
|
||||
Path: "Weight",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.9", true, utils.INFIELD_SEP)},
|
||||
}
|
||||
|
||||
rows := [][]string{
|
||||
@@ -121,45 +121,45 @@ func TestDataUpdateFromCSVOneFile2(t *testing.T) {
|
||||
&config.FCTemplate{Tag: "TenantID",
|
||||
Path: "Tenant",
|
||||
Type: utils.MetaVariable,
|
||||
Value: config.NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.0", true, utils.INFIELD_SEP),
|
||||
Mandatory: true},
|
||||
&config.FCTemplate{Tag: "ProfileID",
|
||||
Path: "ID",
|
||||
Type: utils.MetaVariable,
|
||||
Value: config.NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.1", true, utils.INFIELD_SEP),
|
||||
Mandatory: true},
|
||||
&config.FCTemplate{Tag: "Contexts",
|
||||
Path: "Contexts",
|
||||
Type: utils.MetaVariable,
|
||||
Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.2", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "FilterIDs",
|
||||
Path: "FilterIDs",
|
||||
Type: utils.MetaVariable,
|
||||
Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.3", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "ActivationInterval",
|
||||
Path: "ActivationInterval",
|
||||
Type: utils.MetaVariable,
|
||||
Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.4", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Path",
|
||||
Path: "Path",
|
||||
Type: utils.MetaVariable,
|
||||
Value: config.NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.5", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Initial",
|
||||
Path: "Initial",
|
||||
Type: utils.MetaVariable,
|
||||
Value: config.NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.6", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Substitute",
|
||||
Path: "Substitute",
|
||||
Type: utils.MetaVariable,
|
||||
Value: config.NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.7", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Append",
|
||||
Path: "Append",
|
||||
Type: utils.MetaVariable,
|
||||
Value: config.NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.8", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Weight",
|
||||
Path: "Weight",
|
||||
Type: utils.MetaVariable,
|
||||
Value: config.NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.9", true, utils.INFIELD_SEP)},
|
||||
}
|
||||
|
||||
rows := [][]string{
|
||||
@@ -216,7 +216,7 @@ func TestDataUpdateFromCSVMultiFiles(t *testing.T) {
|
||||
&config.FCTemplate{Tag: "ProfileID",
|
||||
Path: "ID",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~File2.csv:1", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req<File2.csv>.1", true, utils.INFIELD_SEP),
|
||||
Mandatory: true},
|
||||
&config.FCTemplate{Tag: "Contexts",
|
||||
Path: "Contexts",
|
||||
@@ -225,15 +225,15 @@ func TestDataUpdateFromCSVMultiFiles(t *testing.T) {
|
||||
&config.FCTemplate{Tag: "Path",
|
||||
Path: "Path",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~File1.csv:5", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req<File1.csv>.5", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Initial",
|
||||
Path: "Initial",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~File1.csv:6", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req<File1.csv>.6", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Substitute",
|
||||
Path: "Substitute",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~File1.csv:7", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req<File1.csv>.7", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Append",
|
||||
Path: "Append",
|
||||
Type: utils.MetaString,
|
||||
|
||||
@@ -45,49 +45,49 @@ func TestLoaderProcessContentSingleFile(t *testing.T) {
|
||||
&config.FCTemplate{Tag: "TenantID",
|
||||
Path: "Tenant",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.0", true, utils.INFIELD_SEP),
|
||||
Mandatory: true},
|
||||
&config.FCTemplate{Tag: "ProfileID",
|
||||
Path: "ID",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.1", true, utils.INFIELD_SEP),
|
||||
Mandatory: true},
|
||||
&config.FCTemplate{Tag: "Contexts",
|
||||
Path: "Contexts",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.2", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "FilterIDs",
|
||||
Path: "FilterIDs",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.3", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "ActivationInterval",
|
||||
Path: "ActivationInterval",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.4", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "AttributeFilterIDs",
|
||||
Path: "AttributeFilterIDs",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.5", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Path",
|
||||
Path: "Path",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.6", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Type",
|
||||
Path: "Type",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.7", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Value",
|
||||
Path: "Value",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.8", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Blocker",
|
||||
Path: "Blocker",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.9", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Weight",
|
||||
Path: "Weight",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.10", true, utils.INFIELD_SEP)},
|
||||
},
|
||||
}
|
||||
rdr := ioutil.NopCloser(strings.NewReader(engine.AttributesCSVContent))
|
||||
@@ -156,7 +156,7 @@ func TestLoaderProcessContentMultiFiles(t *testing.T) {
|
||||
&config.FCTemplate{Tag: "ProfileID",
|
||||
Path: "ID",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~File2.csv:1", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req<File2.csv>.1", true, utils.INFIELD_SEP),
|
||||
Mandatory: true},
|
||||
&config.FCTemplate{Tag: "Contexts",
|
||||
Path: "Contexts",
|
||||
@@ -165,11 +165,11 @@ func TestLoaderProcessContentMultiFiles(t *testing.T) {
|
||||
&config.FCTemplate{Tag: "Path",
|
||||
Path: "Path",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~File1.csv:6", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req<File1.csv>.6", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Value",
|
||||
Path: "Value",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~File1.csv:7", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req<File1.csv>.7", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Weight",
|
||||
Path: "Weight",
|
||||
Type: utils.MetaString,
|
||||
@@ -229,49 +229,49 @@ func TestLoaderProcessResource(t *testing.T) {
|
||||
&config.FCTemplate{Tag: "Tenant",
|
||||
Path: "Tenant",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.0", true, utils.INFIELD_SEP),
|
||||
Mandatory: true},
|
||||
&config.FCTemplate{Tag: "ID",
|
||||
Path: "ID",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.1", true, utils.INFIELD_SEP),
|
||||
Mandatory: true},
|
||||
&config.FCTemplate{Tag: "FilterIDs",
|
||||
Path: "FilterIDs",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.2", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "ActivationInterval",
|
||||
Path: "ActivationInterval",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.3", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "TTL",
|
||||
Path: "UsageTTL",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.4", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Limit",
|
||||
Path: "Limit",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.5", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "AllocationMessage",
|
||||
Path: "AllocationMessage",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.6", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Blocker",
|
||||
Path: "Blocker",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.7", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Stored",
|
||||
Path: "Stored",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.8", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Weight",
|
||||
Path: "Weight",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.9", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Thresholds",
|
||||
Path: "Thresholds",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.10", true, utils.INFIELD_SEP)},
|
||||
},
|
||||
}
|
||||
rdr := ioutil.NopCloser(strings.NewReader(engine.ResourcesCSVContent))
|
||||
@@ -347,29 +347,29 @@ func TestLoaderProcessFilters(t *testing.T) {
|
||||
&config.FCTemplate{Tag: "Tenant",
|
||||
Path: "Tenant",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.0", true, utils.INFIELD_SEP),
|
||||
Mandatory: true},
|
||||
&config.FCTemplate{Tag: "ID",
|
||||
Path: "ID",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.1", true, utils.INFIELD_SEP),
|
||||
Mandatory: true},
|
||||
&config.FCTemplate{Tag: "Type",
|
||||
Path: "Type",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.2", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Element",
|
||||
Path: "Element",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.3", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Values",
|
||||
Path: "Values",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.4", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "ActivationInterval",
|
||||
Path: "ActivationInterval",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.5", true, utils.INFIELD_SEP)},
|
||||
},
|
||||
}
|
||||
rdr := ioutil.NopCloser(strings.NewReader(engine.FiltersCSVContent))
|
||||
@@ -458,49 +458,49 @@ func TestLoaderProcessThresholds(t *testing.T) {
|
||||
&config.FCTemplate{Tag: "TenantID",
|
||||
Path: "Tenant",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.0", true, utils.INFIELD_SEP),
|
||||
Mandatory: true},
|
||||
&config.FCTemplate{Tag: "ProfileID",
|
||||
Path: "ID",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.1", true, utils.INFIELD_SEP),
|
||||
Mandatory: true},
|
||||
&config.FCTemplate{Tag: "FilterIDs",
|
||||
Path: "FilterIDs",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.2", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "ActivationInterval",
|
||||
Path: "ActivationInterval",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.3", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "MaxHits",
|
||||
Path: "MaxHits",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.4", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "MinHits",
|
||||
Path: "MinHits",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.5", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "MinSleep",
|
||||
Path: "MinSleep",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.6", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Blocker",
|
||||
Path: "Blocker",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.7", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Weight",
|
||||
Path: "Weight",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.8", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "ActionIDs",
|
||||
Path: "ActionIDs",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.9", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Async",
|
||||
Path: "Async",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.10", true, utils.INFIELD_SEP)},
|
||||
},
|
||||
}
|
||||
rdr := ioutil.NopCloser(strings.NewReader(engine.ThresholdsCSVContent))
|
||||
@@ -556,58 +556,58 @@ func TestLoaderProcessStats(t *testing.T) {
|
||||
&config.FCTemplate{Tag: "TenantID",
|
||||
Path: "Tenant",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.0", true, utils.INFIELD_SEP),
|
||||
Mandatory: true},
|
||||
&config.FCTemplate{Tag: "ProfileID",
|
||||
Path: "ID",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.1", true, utils.INFIELD_SEP),
|
||||
Mandatory: true},
|
||||
&config.FCTemplate{Tag: "FilterIDs",
|
||||
Path: "FilterIDs",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.2", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "ActivationInterval",
|
||||
Path: "ActivationInterval",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.3", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "QueueLength",
|
||||
Path: "QueueLength",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.4", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "TTL",
|
||||
Path: "TTL",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.5", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "MinItems",
|
||||
Path: "MinItems",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.6", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "MetricIDs",
|
||||
Path: "MetricIDs",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.7", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "MetricFilterIDs",
|
||||
Path: "MetricFilterIDs",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.8", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Blocker",
|
||||
Path: "Blocker",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.9", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Stored",
|
||||
Path: "Stored",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.10", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Weight",
|
||||
Path: "Weight",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~11", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.11", true, utils.INFIELD_SEP)},
|
||||
|
||||
&config.FCTemplate{Tag: "ThresholdIDs",
|
||||
Path: "ThresholdIDs",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~12", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.12", true, utils.INFIELD_SEP)},
|
||||
},
|
||||
}
|
||||
rdr := ioutil.NopCloser(strings.NewReader(engine.StatsCSVContent))
|
||||
@@ -678,69 +678,69 @@ func TestLoaderProcessRoutes(t *testing.T) {
|
||||
&config.FCTemplate{Tag: "TenantID",
|
||||
Path: "Tenant",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.0", true, utils.INFIELD_SEP),
|
||||
Mandatory: true},
|
||||
&config.FCTemplate{Tag: "ProfileID",
|
||||
Path: "ID",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.1", true, utils.INFIELD_SEP),
|
||||
Mandatory: true},
|
||||
&config.FCTemplate{Tag: "FilterIDs",
|
||||
Path: "FilterIDs",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.2", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "ActivationInterval",
|
||||
Path: "ActivationInterval",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.3", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Sorting",
|
||||
Path: "Sorting",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.4", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "SortingParameters",
|
||||
Path: "SortingParameters",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.5", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "RouteID",
|
||||
Path: "RouteID",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.6", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "RouteFilterIDs",
|
||||
Path: "RouteFilterIDs",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.7", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "RouteAccountIDs",
|
||||
Path: "RouteAccountIDs",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.8", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "RouteRatingPlanIDs",
|
||||
Path: "RouteRatingplanIDs",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.9", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "RouteResourceIDs",
|
||||
Path: "RouteResourceIDs",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.10", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "RouteStatIDs",
|
||||
Path: "RouteStatIDs",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~11", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.11", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "RouteWeight",
|
||||
Path: "RouteWeight",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~12", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.12", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "RouteBlocker",
|
||||
Path: "RouteBlocker",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~13", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.13", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "RouteParameters",
|
||||
Path: "RouteParameters",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~14", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.14", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Weight",
|
||||
Path: "Weight",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~15", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.15", true, utils.INFIELD_SEP)},
|
||||
},
|
||||
}
|
||||
rdr := ioutil.NopCloser(strings.NewReader(engine.RoutesCSVContent))
|
||||
@@ -835,33 +835,33 @@ func TestLoaderProcessChargers(t *testing.T) {
|
||||
&config.FCTemplate{Tag: "TenantID",
|
||||
Path: "Tenant",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.0", true, utils.INFIELD_SEP),
|
||||
Mandatory: true},
|
||||
&config.FCTemplate{Tag: "ProfileID",
|
||||
Path: "ID",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.1", true, utils.INFIELD_SEP),
|
||||
Mandatory: true},
|
||||
&config.FCTemplate{Tag: "FilterIDs",
|
||||
Path: "FilterIDs",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.2", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "ActivationInterval",
|
||||
Path: "ActivationInterval",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.3", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "RunID",
|
||||
Path: "RunID",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.4", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "AttributeIDs",
|
||||
Path: "AttributeIDs",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.5", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Weight",
|
||||
Path: "Weight",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP)},
|
||||
Value: config.NewRSRParsersMustCompile("~*req.6", true, utils.INFIELD_SEP)},
|
||||
},
|
||||
}
|
||||
rdr := ioutil.NopCloser(strings.NewReader(engine.ChargersCSVContent))
|
||||
@@ -914,81 +914,81 @@ func TestLoaderProcessDispatches(t *testing.T) {
|
||||
Tag: "TenantID",
|
||||
Path: "Tenant",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.0", true, utils.INFIELD_SEP),
|
||||
Mandatory: true,
|
||||
},
|
||||
&config.FCTemplate{
|
||||
Tag: "ProfileID",
|
||||
Path: "ID",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.1", true, utils.INFIELD_SEP),
|
||||
Mandatory: true,
|
||||
},
|
||||
&config.FCTemplate{
|
||||
Tag: "Subsystems",
|
||||
Path: "Subsystems",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.2", true, utils.INFIELD_SEP),
|
||||
},
|
||||
&config.FCTemplate{
|
||||
Tag: "FilterIDs",
|
||||
Path: "FilterIDs",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.3", true, utils.INFIELD_SEP),
|
||||
},
|
||||
&config.FCTemplate{
|
||||
Tag: "ActivationInterval",
|
||||
Path: "ActivationInterval",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.4", true, utils.INFIELD_SEP),
|
||||
},
|
||||
&config.FCTemplate{
|
||||
Tag: "Strategy",
|
||||
Path: "Strategy",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~5", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.5", true, utils.INFIELD_SEP),
|
||||
},
|
||||
&config.FCTemplate{
|
||||
Tag: "StrategyParameters",
|
||||
Path: "StrategyParameters",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.6", true, utils.INFIELD_SEP),
|
||||
},
|
||||
&config.FCTemplate{
|
||||
Tag: "ConnID",
|
||||
Path: "ConnID",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.7", true, utils.INFIELD_SEP),
|
||||
},
|
||||
&config.FCTemplate{
|
||||
Tag: "ConnFilterIDs",
|
||||
Path: "ConnFilterIDs",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.8", true, utils.INFIELD_SEP),
|
||||
},
|
||||
&config.FCTemplate{
|
||||
Tag: "ConnWeight",
|
||||
Path: "ConnWeight",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.9", true, utils.INFIELD_SEP),
|
||||
},
|
||||
&config.FCTemplate{
|
||||
Tag: "ConnBlocker",
|
||||
Path: "ConnBlocker",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.10", true, utils.INFIELD_SEP),
|
||||
},
|
||||
&config.FCTemplate{
|
||||
Tag: "ConnParameters",
|
||||
Path: "ConnParameters",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~11", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.11", true, utils.INFIELD_SEP),
|
||||
},
|
||||
&config.FCTemplate{
|
||||
Tag: "Weight",
|
||||
Path: "Weight",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~12", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.12", true, utils.INFIELD_SEP),
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1066,33 +1066,33 @@ func TestLoaderProcessDispatcheHosts(t *testing.T) {
|
||||
Tag: "Tenant",
|
||||
Path: "Tenant",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.0", true, utils.INFIELD_SEP),
|
||||
Mandatory: true,
|
||||
},
|
||||
&config.FCTemplate{
|
||||
Tag: "ID",
|
||||
Path: "ID",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.1", true, utils.INFIELD_SEP),
|
||||
Mandatory: true,
|
||||
},
|
||||
&config.FCTemplate{
|
||||
Tag: "Address",
|
||||
Path: "Address",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.2", true, utils.INFIELD_SEP),
|
||||
},
|
||||
&config.FCTemplate{
|
||||
Tag: "Transport",
|
||||
Path: "Transport",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.3", true, utils.INFIELD_SEP),
|
||||
},
|
||||
&config.FCTemplate{
|
||||
Tag: "TLS",
|
||||
Path: "TLS",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.4", true, utils.INFIELD_SEP),
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1153,12 +1153,12 @@ func TestLoaderRemoveContentSingleFile(t *testing.T) {
|
||||
&config.FCTemplate{Tag: "TenantID",
|
||||
Path: "Tenant",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~0", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.0", true, utils.INFIELD_SEP),
|
||||
Mandatory: true},
|
||||
&config.FCTemplate{Tag: "ProfileID",
|
||||
Path: "ID",
|
||||
Type: utils.META_COMPOSED,
|
||||
Value: config.NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP),
|
||||
Value: config.NewRSRParsersMustCompile("~*req.1", true, utils.INFIELD_SEP),
|
||||
Mandatory: true},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -70,6 +70,7 @@ cgrates (0.11.0~dev) UNRELEASED; urgency=medium
|
||||
* [General] Added *mo+extraDuration time support (e.g. *mo+1h will be time.Now() + 1 month + 1 hour)
|
||||
* [SessionS] Use correctly SessionTTLUsage when calculate end usage in case of terminate session from ttl mechanism
|
||||
* [SessionS] Add SessionTLLLastUsage as option for an extra debit in case of ttl mechanism
|
||||
* [LoaderS] Add *req as mandatory prefix
|
||||
|
||||
-- DanB <danb@cgrates.org> Wed, 19 Feb 2020 13:25:52 +0200
|
||||
|
||||
|
||||
@@ -396,6 +396,7 @@ const (
|
||||
ActionsPoster = "act"
|
||||
CDRPoster = "cdr"
|
||||
MetaFileCSV = "*file_csv"
|
||||
MetaVirt = "*virt"
|
||||
MetaFileFWV = "*file_fwv"
|
||||
MetaFScsv = "*freeswitch_csv"
|
||||
Accounts = "Accounts"
|
||||
|
||||
@@ -43,7 +43,7 @@ func (ddp *DynamicDataProvider) FieldAsInterface(fldPath []string) (out interfac
|
||||
return val, nil
|
||||
}
|
||||
var newPath string
|
||||
if newPath, err = ddp.proccesFieldPath(path); err != nil { // proccess the path
|
||||
if newPath, err = ddp.processFieldPathForSet(path); err != nil { // proccess the path
|
||||
return
|
||||
}
|
||||
if newPath == EmptyString { // no new path means no dynamic path so just take the value from the data provider
|
||||
@@ -58,64 +58,10 @@ func (ddp *DynamicDataProvider) FieldAsInterface(fldPath []string) (out interfac
|
||||
return
|
||||
}
|
||||
|
||||
func (ddp *DynamicDataProvider) proccesFieldPath(fldPath string) (newPath string, err error) {
|
||||
idx := strings.Index(fldPath, IdxStart)
|
||||
if idx == -1 {
|
||||
return // no proccessing requred
|
||||
}
|
||||
newPath = fldPath[:idx+1] // add the first path of the path with the "[" included
|
||||
for idx != -1 { // stop when we do not find any "["
|
||||
fldPath = fldPath[idx+1:] // move the path to the begining of the index
|
||||
nextBeginIdx := strings.Index(fldPath, IdxStart) // get the next "[" if any
|
||||
nextEndIdx := strings.Index(fldPath, IdxEnd) // get the next "]" if any
|
||||
if nextEndIdx == -1 { // no end index found so return error
|
||||
err = ErrWrongPath
|
||||
newPath = EmptyString
|
||||
return
|
||||
}
|
||||
|
||||
// parse the rest of the field path until we match the [ ]
|
||||
bIdx, eIdx := nextBeginIdx, nextEndIdx
|
||||
for nextBeginIdx != -1 && nextBeginIdx < nextEndIdx { // do this until no new [ is found or the next begining [ is after the end ]
|
||||
nextBeginIdx = strings.Index(fldPath[bIdx+1:], IdxStart) // get the next "[" if any
|
||||
nextEndIdx = strings.Index(fldPath[eIdx+1:], IdxEnd) // get the next "]" if any
|
||||
if nextEndIdx == -1 { // no end index found so return error
|
||||
err = ErrWrongPath
|
||||
newPath = EmptyString
|
||||
return
|
||||
}
|
||||
if nextBeginIdx == -1 { // if no index found do not increment but replace it
|
||||
bIdx = -1
|
||||
} else {
|
||||
bIdx += nextBeginIdx + 1
|
||||
}
|
||||
// increment the indexes
|
||||
eIdx += nextEndIdx + 1
|
||||
}
|
||||
var val string
|
||||
for _, path := range strings.Split(fldPath[:eIdx], PipeSep) { // proccess the found path
|
||||
var iface interface{}
|
||||
if iface, err = DPDynamicInterface(path, ddp); err != nil {
|
||||
newPath = EmptyString
|
||||
return
|
||||
}
|
||||
val += IfaceAsString(iface) // compose the value
|
||||
}
|
||||
if bIdx == -1 { // if is the last ocurence add the rest of the path and exit
|
||||
newPath += val + fldPath[eIdx:]
|
||||
} else {
|
||||
// else just add until the next [
|
||||
newPath += val + fldPath[eIdx:bIdx+1]
|
||||
}
|
||||
idx = bIdx
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// GetFullFieldPath returns the full path for the
|
||||
func (ddp *DynamicDataProvider) GetFullFieldPath(fldPath string) (fpath *FullPath, err error) {
|
||||
var newPath string
|
||||
if newPath, err = ddp.proccesFieldPathForSet(fldPath); err != nil || newPath == EmptyString {
|
||||
if newPath, err = ddp.processFieldPathForSet(fldPath); err != nil || newPath == EmptyString {
|
||||
return
|
||||
}
|
||||
fpath = &FullPath{
|
||||
@@ -136,7 +82,7 @@ func (ddp DynamicDataProvider) FieldAsString(fldPath []string) (str string, err
|
||||
}
|
||||
|
||||
// does the same thing as ... but replaces [ with . if the value between [] is dynamic
|
||||
func (ddp *DynamicDataProvider) proccesFieldPathForSet(fldPath string) (newPath string, err error) {
|
||||
func (ddp *DynamicDataProvider) processFieldPathForSet(fldPath string) (newPath string, err error) {
|
||||
idx := strings.Index(fldPath, IdxStart)
|
||||
if idx == -1 {
|
||||
return // no proccessing requred
|
||||
|
||||
@@ -18,56 +18,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
package utils
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestDynamicDataProviderProccesFieldPath(t *testing.T) {
|
||||
dp := MapStorage{
|
||||
MetaCgrep: MapStorage{
|
||||
"Stir": MapStorage{
|
||||
"CHRG_ROUTE1_END": "Identity1",
|
||||
"CHRG_ROUTE2_END": "Identity2",
|
||||
"CHRG_ROUTE3_END": "Identity3",
|
||||
"CHRG_ROUTE4_END": "Identity4",
|
||||
},
|
||||
"Routes": MapStorage{
|
||||
"SortedRoutes": []MapStorage{
|
||||
{"ID": "ROUTE1"},
|
||||
{"ID": "ROUTE2"},
|
||||
{"ID": "ROUTE3"},
|
||||
{"ID": "ROUTE4"},
|
||||
},
|
||||
},
|
||||
"BestRoute": 0,
|
||||
},
|
||||
}
|
||||
ddp := NewDynamicDataProvider(dp)
|
||||
newpath, err := ddp.proccesFieldPath("~*cgrep.Stir[CHRG_|~*cgrep.Routes.SortedRoutes[1].ID|_END].Something[CHRG_|~*cgrep.Routes.SortedRoutes[~*cgrep.BestRoute].ID|_END]")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
expectedPath := "~*cgrep.Stir[CHRG_ROUTE2_END].Something[CHRG_ROUTE1_END]"
|
||||
if newpath != expectedPath {
|
||||
t.Errorf("Expected: %q,received %q", expectedPath, newpath)
|
||||
}
|
||||
_, err = ddp.proccesFieldPath("~*cgrep.Stir[CHRG_|~*cgrep.Routes.SortedRoutes[1].ID|_END].Something[CHRG_|~*cgrep.Routes.SortedRoutes[~*cgrep.BestRoute].ID|_END")
|
||||
if err != ErrWrongPath {
|
||||
t.Errorf("Expected error %s received %v", ErrWrongPath, err)
|
||||
}
|
||||
|
||||
_, err = ddp.proccesFieldPath("~*cgrep.Stir[CHRG_")
|
||||
if err != ErrWrongPath {
|
||||
t.Errorf("Expected error %s received %v", ErrWrongPath, err)
|
||||
}
|
||||
|
||||
_, err = ddp.proccesFieldPath("~*cgrep.Stir[CHRG_|~*cgrep.Routes.SortedRoutes[1].ID2|_END]")
|
||||
if err != ErrNotFound {
|
||||
t.Errorf("Expected error %s received %v", ErrNotFound, err)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestDynamicDataProviderFieldAsInterface(t *testing.T) {
|
||||
dp := MapStorage{
|
||||
MetaCgrep: MapStorage{
|
||||
@@ -163,7 +118,7 @@ func TestDynamicDataProviderProccesFieldPath2(t *testing.T) {
|
||||
},
|
||||
}
|
||||
ddp := NewDynamicDataProvider(dp)
|
||||
newpath, err := ddp.proccesFieldPathForSet("~*cgrep.Stir[CHRG_|~*cgrep.Routes.SortedRoutes[1].ID|_END].Something[CHRG_|~*cgrep.Routes.SortedRoutes[~*cgrep.BestRoute].ID|_END]")
|
||||
newpath, err := ddp.processFieldPathForSet("~*cgrep.Stir[CHRG_|~*cgrep.Routes.SortedRoutes[1].ID|_END].Something[CHRG_|~*cgrep.Routes.SortedRoutes[~*cgrep.BestRoute].ID|_END]")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -171,21 +126,21 @@ func TestDynamicDataProviderProccesFieldPath2(t *testing.T) {
|
||||
if newpath != expectedPath {
|
||||
t.Errorf("Expected: %q,received %q", expectedPath, newpath)
|
||||
}
|
||||
_, err = ddp.proccesFieldPathForSet("~*cgrep.Stir[CHRG_|~*cgrep.Routes.SortedRoutes[1].ID|_END].Something[CHRG_|~*cgrep.Routes.SortedRoutes[~*cgrep.BestRoute].ID|_END")
|
||||
_, err = ddp.processFieldPathForSet("~*cgrep.Stir[CHRG_|~*cgrep.Routes.SortedRoutes[1].ID|_END].Something[CHRG_|~*cgrep.Routes.SortedRoutes[~*cgrep.BestRoute].ID|_END")
|
||||
if err != ErrWrongPath {
|
||||
t.Errorf("Expected error %s received %v", ErrWrongPath, err)
|
||||
}
|
||||
|
||||
_, err = ddp.proccesFieldPathForSet("~*cgrep.Stir[CHRG_")
|
||||
_, err = ddp.processFieldPathForSet("~*cgrep.Stir[CHRG_")
|
||||
if err != ErrWrongPath {
|
||||
t.Errorf("Expected error %s received %v", ErrWrongPath, err)
|
||||
}
|
||||
|
||||
_, err = ddp.proccesFieldPathForSet("~*cgrep.Stir[CHRG_|~*cgrep.Routes.SortedRoutes[1].ID2|_END]")
|
||||
_, err = ddp.processFieldPathForSet("~*cgrep.Stir[CHRG_|~*cgrep.Routes.SortedRoutes[1].ID2|_END]")
|
||||
if err != ErrNotFound {
|
||||
t.Errorf("Expected error %s received %v", ErrNotFound, err)
|
||||
}
|
||||
newpath, err = ddp.proccesFieldPathForSet("~*cgrep.Stir[1]")
|
||||
newpath, err = ddp.processFieldPathForSet("~*cgrep.Stir[1]")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -289,4 +244,13 @@ func TestDynamicDataProviderGetFullFieldPath(t *testing.T) {
|
||||
if newpath != nil {
|
||||
t.Errorf("Expected: %v,received %q", nil, newpath)
|
||||
}
|
||||
|
||||
newpath, err = ddp.GetFullFieldPath("*cgrep.Stir[CHRG_|~*cgrep.Routes.SortedRoutes[~*cgrep.BestRoute].ID|_END]")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if newpath == nil {
|
||||
t.Errorf("Expected: %v,received %q", nil, newpath)
|
||||
}
|
||||
fmt.Println(*newpath)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user