diff --git a/actions/accounts_test.go b/actions/accounts_test.go index 516000d2e..aa42392ff 100644 --- a/actions/accounts_test.go +++ b/actions/accounts_test.go @@ -39,8 +39,10 @@ func TestACExecuteAccountsSetBalance(t *testing.T) { Type: utils.MetaSetBalance, Diktats: []*utils.APDiktat{ { - Path: "~*balance.TestBalance.Value", - Value: "\"constant;`>;q=0.7;expires=3600constant\"", + Opts: map[string]any{ + "*balancePath": "~*balance.TestBalance.Value", + "*balanceValue": "\"constant;`>;q=0.7;expires=3600constant\"", + }, }, }, } @@ -72,7 +74,7 @@ func TestACExecuteAccountsSetBalance(t *testing.T) { } //invalid to parse a value from diktats - actCdrLG.aCfg.Diktats[0].Value = "10" + actCdrLG.aCfg.Diktats[0].Opts["*balanceValue"] = "10" ctx, cancel := context.WithTimeout(context.Background(), 10) expected = context.DeadlineExceeded.Error() if err := actCdrLG.execute(ctx, dataStorage, utils.MetaBalanceLimit); err == nil || err.Error() != expected { @@ -91,8 +93,10 @@ func TestACExecuteAccountsRemBalance(t *testing.T) { Type: utils.MetaSetBalance, Diktats: []*utils.APDiktat{ { - Path: "~*balance.TestBalance.Value", - Value: "10", + Opts: map[string]any{ + "*balancePath": "~*balance.TestBalance.Value", + "*balanceValue": "10", + }, }, }, } @@ -129,8 +133,10 @@ func TestACExecuteAccountsParseError(t *testing.T) { Type: utils.MetaSetBalance, Diktats: []*utils.APDiktat{ { - Path: "~*balance.TestBalance.Value", - Value: "~10", + Opts: map[string]any{ + "*balancePath": "~*balance.TestBalance.Value", + "*balanceValue": "~10", + }, }, }, } diff --git a/actions/actions_test.go b/actions/actions_test.go index bac0a5a0b..a7e5cd472 100644 --- a/actions/actions_test.go +++ b/actions/actions_test.go @@ -63,8 +63,10 @@ func TestMatchingActionProfilesForEvent(t *testing.T) { FilterIDs: []string{}, Type: "*topup", Diktats: []*utils.APDiktat{{ - Path: "~*balance.TestBalance.Value", - Value: "10", + Opts: map[string]any{ + "*balancePath": "~*balance.TestBalance.Value", + "*balanceValue": "10", + }, }}, }, }, @@ -177,8 +179,10 @@ func TestScheduledActions(t *testing.T) { FilterIDs: []string{}, Type: utils.MetaLog, Diktats: []*utils.APDiktat{{ - Path: "~*balance.TestBalance.Value", - Value: "10", + Opts: map[string]any{ + "*balancePath": "~*balance.TestBalance.Value", + "*balanceValue": "10", + }, }}, }, }, @@ -241,8 +245,10 @@ func TestScheduleAction(t *testing.T) { FilterIDs: []string{}, Type: utils.MetaLog, Diktats: []*utils.APDiktat{{ - Path: "~*balance.TestBalance.Value", - Value: "10", + Opts: map[string]any{ + "*balancePath": "~*balance.TestBalance.Value", + "*balanceValue": "10", + }, }}, }, }, @@ -347,8 +353,10 @@ func TestV1ScheduleActions(t *testing.T) { FilterIDs: []string{}, Type: utils.MetaLog, Diktats: []*utils.APDiktat{{ - Path: "~*balance.TestBalance.Value", - Value: "10", + Opts: map[string]any{ + "*balancePath": "~*balance.TestBalance.Value", + "*balanceValue": "10", + }, }}, }, }, @@ -403,8 +411,10 @@ func TestV1ExecuteActions(t *testing.T) { FilterIDs: []string{}, Type: utils.MetaLog, Diktats: []*utils.APDiktat{{ - Path: "~*balance.TestBalance.Value", - Value: "10", + Opts: map[string]any{ + "*balancePath": "~*balance.TestBalance.Value", + "*balanceValue": "10", + }, }}, }, }, @@ -452,8 +462,10 @@ func (dbM *dataDBMockError) GetActionProfileDrv(*context.Context, string, string FilterIDs: []string{}, Type: utils.MetaLog, Diktats: []*utils.APDiktat{{ - Path: "~*balance.TestBalance.Value", - Value: "10", + Opts: map[string]any{ + "*balancePath": "~*balance.TestBalance.Value", + "*balanceValue": "10", + }, }}, }, }, @@ -962,7 +974,9 @@ func TestExportActionResetStatStaticID(t *testing.T) { ID: "ACT_RESET_ST", Type: utils.MetaResetStatQueue, Diktats: []*utils.APDiktat{{ - Value: "ST1", + Opts: map[string]any{ + "*balanceValue": "ST1", + }, }}, } exportAction := &actResetStat{ @@ -996,8 +1010,10 @@ func TestACScheduledActions(t *testing.T) { FilterIDs: []string{}, Type: "inexistent_type", Diktats: []*utils.APDiktat{{ - Path: "~*balance.TestBalance.Value", - Value: "10", + Opts: map[string]any{ + "*balancePath": "~*balance.TestBalance.Value", + "*balanceValue": "10", + }, }}, }, }, @@ -1111,8 +1127,10 @@ func TestV1ScheduleActionsProfileIgnoreFilters(t *testing.T) { FilterIDs: []string{}, Type: utils.MetaLog, Diktats: []*utils.APDiktat{{ - Path: "~*balance.TestBalance.Value", - Value: "10", + Opts: map[string]any{ + "*balancePath": "~*balance.TestBalance.Value", + "*balanceValue": "10", + }, }}, }, }, @@ -1164,8 +1182,10 @@ func TestV1ExecuteActionsProfileIgnoreFilters(t *testing.T) { FilterIDs: []string{}, Type: utils.MetaLog, Diktats: []*utils.APDiktat{{ - Path: "~*balance.TestBalance.Value", - Value: "10", + Opts: map[string]any{ + "*balancePath": "~*balance.TestBalance.Value", + "*balanceValue": "10", + }, }}, }, }, diff --git a/actions/export_test.go b/actions/export_test.go index 96a58d0f5..3e7a37071 100644 --- a/actions/export_test.go +++ b/actions/export_test.go @@ -38,8 +38,9 @@ func TestACHTTPPostExecute(t *testing.T) { Type: utils.CDRLog, Diktats: []*utils.APDiktat{ { - Path: "~*balance.TestBalance.Value", - Value: "10", + Opts: map[string]any{ + "*url": "~*balance.TestBalance.Value", + }, }, }, } @@ -101,8 +102,9 @@ func TestACHTTPPostValues(t *testing.T) { Type: utils.MetaHTTPPost, Diktats: []*utils.APDiktat{ { - Path: "~*balance.TestBalance.Value", - Value: "80", + Opts: map[string]any{ + "*balancePath": "~*balance.TestBalance.Value", + }, }, }, } diff --git a/apis/actions_it_test.go b/apis/actions_it_test.go index a0167dbc5..ac5dc6b6a 100644 --- a/apis/actions_it_test.go +++ b/apis/actions_it_test.go @@ -437,7 +437,10 @@ func testActionsSetActionProfileBeforeExecuteHTTPPost(t *testing.T) { Type: utils.MetaHTTPPost, Diktats: []*utils.APDiktat{ { - Path: actSrv.URL, + ID: "HttpPost", + Opts: map[string]any{ + "*url": actSrv.URL, + }, }, }, TTL: time.Duration(time.Minute), diff --git a/apis/filter_indexes_it_test.go b/apis/filter_indexes_it_test.go index 3def4e4e8..846c56367 100644 --- a/apis/filter_indexes_it_test.go +++ b/apis/filter_indexes_it_test.go @@ -1320,10 +1320,16 @@ func testV1FIdxSetActionProfileWithFltr(t *testing.T) { Type: utils.MetaRemBalance, Diktats: []*utils.APDiktat{ { - Path: "MONETARY", + ID: "RemBalMonetary", + Opts: map[string]any{ + "*balancePath": "MONETARY", + }, }, { - Path: "VOICE", + ID: "RemBalVoice", + Opts: map[string]any{ + "*balancePath": "VOICE", + }, }, }, }, @@ -1431,10 +1437,16 @@ func testV1FIdxSetActionProfileMoreFltrsMoreIndexing(t *testing.T) { Type: utils.MetaRemBalance, Diktats: []*utils.APDiktat{ { - Path: "MONETARY", + ID: "RemBalMonetary", + Opts: map[string]any{ + "*balancePath": "MONETARY", + }, }, { - Path: "VOICE", + ID: "RemBalVoice", + Opts: map[string]any{ + "*balancePath": "VOICE", + }, }, }, }, @@ -1549,9 +1561,13 @@ func testV1FIdxActionMoreProfileForFilters(t *testing.T) { Type: utils.MetaAddBalance, Diktats: []*utils.APDiktat{ { - Path: "MONETARY", - Value: "10", - }}, + ID: "AddBalMonetary", + Opts: map[string]any{ + "*balancePath": "MONETARY", + "*balanceValue": "10", + }, + }, + }, }, }, }, @@ -1576,9 +1592,13 @@ func testV1FIdxActionMoreProfileForFilters(t *testing.T) { Type: utils.MetaSetBalance, Diktats: []*utils.APDiktat{ { - Path: "MONETARY", - Value: "10", - }}, + ID: "SetBalMonetary", + Opts: map[string]any{ + "*balancePath": "MONETARY", + "*balanceValue": "10", + }, + }, + }, }, }, }, diff --git a/apis/loaders_it_test.go b/apis/loaders_it_test.go index 42d4f6a7e..429087820 100644 --- a/apis/loaders_it_test.go +++ b/apis/loaders_it_test.go @@ -196,17 +196,17 @@ cgrates.org,1002,,;30,;false,,VoiceBalance,,;10,,*voice,14,fltr3&fltr4;150;fltr5 // Create and populate ActionProfiles.csv if err := writeFile(utils.ActionsCsv, ` -#Tenant,ID,FilterIDs,Weights,Blockers,Schedule,TargetType,TargetIDs,ActionID,ActionFilterIDs,ActionTTL,ActionType,ActionOpts,ActionPath,ActionValue -cgrates.org,ONE_TIME_ACT,,,,,,,,,,,,, -cgrates.org,ONE_TIME_ACT,,;10,;true,*asap,*accounts,1001;1002,,,,,,, -cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP,,0s,*add_balance,,, -cgrates.org,ONE_TIME_ACT,,,,*asap,*accounts,1001;1002,,,,,,, -cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP,,,,,*balance.TestBalance.Value,10 -cgrates.org,ONE_TIME_ACT,,,,,,,SET_BALANCE_TEST_DATA,,0s,*set_balance,,*balance.TestDataBalance.Type,*data -cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_TEST_DATA,,0s,*add_balance,,*balance.TestDataBalance.Value,1024 -cgrates.org,ONE_TIME_ACT,,,,,,,SET_BALANCE_TEST_VOICE,,0s,*set_balance,,*balance.TestVoiceBalance.Type,*voice -cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_TEST_VOICE,,0s,*add_balance,,*balance.TestVoiceBalance.Value,15m15s -cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_TEST_VOICE,,0s,*add_balance,,*balance.TestVoiceBalance2.Value,15m15s +#Tenant,ID,FilterIDs,Weights,Blockers,Schedule,TargetType,TargetIDs,ActionID,ActionFilterIDs,ActionTTL,ActionType,ActionOpts,ActionWeights,ActionBlockers,ActionDiktatsID,ActionDiktatsFilterIDs,ActionDiktatsOpts,ActionDiktatsWeights,ActionDiktatsBlockers +cgrates.org,ONE_TIME_ACT,,,,,,,,,,,,,,,,,, +cgrates.org,ONE_TIME_ACT,,;10,;true,*asap,*accounts,1001;1002,,,,,,,,,,,, +cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP,,0s,*add_balance,,,,ADDBALVALUE,,,, +cgrates.org,ONE_TIME_ACT,,,,*asap,*accounts,1001;1002,,,,,,,,,,,, +cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP,,,,,,,ADDBALVALUE,,*balancePath:*balance.TestBalance.Value;*balanceValue:10,, +cgrates.org,ONE_TIME_ACT,,,,,,,SET_BALANCE_TEST_DATA,,0s,*set_balance,,,,SETBALTYPE,,*balancePath:*balance.TestDataBalance.Type;*balanceValue:*data,, +cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_TEST_DATA,,0s,*add_balance,,,,ADDBALVALUE,,*balancePath:*balance.TestDataBalance.Value;*balanceValue:1024,, +cgrates.org,ONE_TIME_ACT,,,,,,,SET_BALANCE_TEST_VOICE,,0s,*set_balance,,,,SETBALTYPE,,*balancePath:*balance.TestVoiceBalance.Type;*balanceValue:*voice,, +cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_TEST_VOICE,,0s,*add_balance,,,,ADDBALVALUE1,,*balancePath:*balance.TestVoiceBalance.Value;*balanceValue:15m15s,, +cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_TEST_VOICE,,0s,*add_balance,,,,ADDBALVALUE2,,*balancePath:*balance.TestVoiceBalance2.Value;*balanceValue:15m15s,, `); err != nil { t.Fatal(err) } @@ -544,8 +544,11 @@ func testLoadersGetActionProfiles(t *testing.T) { Opts: map[string]any{}, Diktats: []*utils.APDiktat{ { - Path: "*balance.TestBalance.Value", - Value: "10", + ID: "ADDBALVALUE", + Opts: map[string]any{ + "*balancePath": "*balance.TestBalance.Value", + "*balanceValue": "10", + }, }, }, }, @@ -556,8 +559,11 @@ func testLoadersGetActionProfiles(t *testing.T) { Opts: map[string]any{}, Diktats: []*utils.APDiktat{ { - Path: "*balance.TestDataBalance.Type", - Value: utils.MetaData, + ID: "SETBALTYPE", + Opts: map[string]any{ + "*balancePath": "*balance.TestDataBalance.Type", + "*balanceValue": utils.MetaData, + }, }, }, }, @@ -568,8 +574,11 @@ func testLoadersGetActionProfiles(t *testing.T) { Opts: map[string]any{}, Diktats: []*utils.APDiktat{ { - Path: "*balance.TestDataBalance.Value", - Value: "1024", + ID: "ADDBALVALUE", + Opts: map[string]any{ + "*balancePath": "*balance.TestDataBalance.Value", + "*balanceValue": "1024", + }, }, }, }, @@ -580,8 +589,11 @@ func testLoadersGetActionProfiles(t *testing.T) { Opts: map[string]any{}, Diktats: []*utils.APDiktat{ { - Path: "*balance.TestVoiceBalance.Type", - Value: utils.MetaVoice, + ID: "SETBALTYPE", + Opts: map[string]any{ + "*balancePath": "*balance.TestVoiceBalance.Type", + "*balanceValue": utils.MetaVoice, + }, }, }, }, @@ -592,12 +604,18 @@ func testLoadersGetActionProfiles(t *testing.T) { Opts: map[string]any{}, Diktats: []*utils.APDiktat{ { - Path: "*balance.TestVoiceBalance.Value", - Value: "15m15s", + ID: "ADDBALVALUE1", + Opts: map[string]any{ + "*balancePath": "*balance.TestVoiceBalance.Value", + "*balanceValue": "15m15s", + }, }, { - Path: "*balance.TestVoiceBalance2.Value", - Value: "15m15s", + ID: "ADDBALVALUE2", + Opts: map[string]any{ + "*balancePath": "*balance.TestVoiceBalance2.Value", + "*balanceValue": "15m15s", + }, }, }, }, diff --git a/apis/preload_it_test.go b/apis/preload_it_test.go index 96461e753..81b30e1d6 100644 --- a/apis/preload_it_test.go +++ b/apis/preload_it_test.go @@ -103,13 +103,13 @@ cgrates.org,1001,,,,,VoiceBalance,,;10,*string:~*req.Destination:1002;true;;fals } // writing in files the csv containing the profile for ActionProfile if err := os.WriteFile(path.Join("/tmp/ActionsIn", utils.ActionsCsv), []byte(` -#Tenant,ID,FilterIDs,Weights,Blockers,Schedule,TargetType,TargetIDs,ActionID,ActionFilterIDs,ActionTTL,ActionType,ActionOpts,ActionPath,ActionValue -cgrates.org,ONE_TIME_ACT,,;10,,*asap,*accounts,1001;1002,TOPUP,,0s,*add_balance,,*balance.TestBalance.Value,10 -cgrates.org,ONE_TIME_ACT,,,,,,,SET_BALANCE_TEST_DATA,,0s,*set_balance,,*balance.TestDataBalance.Type,*data -cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_TEST_DATA,,0s,*add_balance,,*balance.TestDataBalance.Value,1024 -cgrates.org,ONE_TIME_ACT,,,,,,,SET_BALANCE_TEST_VOICE,,0s,*set_balance,,*balance.TestVoiceBalance.Type,*voice -cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_TEST_VOICE,,0s,*add_balance,,*balance.TestVoiceBalance.Value,15m15s -cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_TEST_VOICE,,0s,*add_balance,,*balance.TestVoiceBalance2.Value,15m15s +#Tenant,ID,FilterIDs,Weights,Blockers,Schedule,TargetType,TargetIDs,ActionID,ActionFilterIDs,ActionTTL,ActionType,ActionOpts,ActionWeights,ActionBlockers,ActionDiktatsID,ActionDiktatsFilterIDs,ActionDiktatsOpts,ActionDiktatsWeights,ActionDiktatsBlockers +cgrates.org,ONE_TIME_ACT,,;10,,*asap,*accounts,1001;1002,TOPUP,,0s,*add_balance,,,,ADDBALVALUE,,*balancePath:*balance.TestBalance.Value;*balanceValue:10,, +cgrates.org,ONE_TIME_ACT,,,,,,,SET_BALANCE_TEST_DATA,,0s,*set_balance,,,,SETBALTYPE,,*balancePath:*balance.TestDataBalance.Type;*balanceValue:*data,, +cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_TEST_DATA,,0s,*add_balance,,,,ADDBALVALUE,,*balancePath:*balance.TestDataBalance.Value;*balanceValue:1024,, +cgrates.org,ONE_TIME_ACT,,,,,,,SET_BALANCE_TEST_VOICE,,0s,*set_balance,,,,SETBALTYPE,,*balancePath:*balance.TestVoiceBalance.Type;*balanceValue:*voice,, +cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_TEST_VOICE,,0s,*add_balance,,,,ADDBALVALUE1,,*balancePath:*balance.TestVoiceBalance.Value;*balanceValue:15m15s,, +cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_TEST_VOICE,,0s,*add_balance,,,,ADDBALVALUE2,,*balancePath:*balance.TestVoiceBalance2.Value;*balanceValue:15m15s,, `), 0644); err != nil { t.Fatalf("Err %v when writing in file %s", err, utils.ActionsCsv) } @@ -336,8 +336,11 @@ func testPreloadITVerifyActionProfiles(t *testing.T) { Opts: map[string]any{}, Diktats: []*utils.APDiktat{ { - Path: "*balance.TestBalance.Value", - Value: "10", + ID: "ADDBALVALUE", + Opts: map[string]any{ + "*balancePath": "*balance.TestBalance.Value", + "*balanceValue": "10", + }, }, }, }, @@ -348,8 +351,11 @@ func testPreloadITVerifyActionProfiles(t *testing.T) { Opts: map[string]any{}, Diktats: []*utils.APDiktat{ { - Path: "*balance.TestDataBalance.Type", - Value: utils.MetaData, + ID: "SETBALTYPE", + Opts: map[string]any{ + "*balancePath": "*balance.TestDataBalance.Type", + "*balanceValue": utils.MetaData, + }, }, }, }, @@ -360,8 +366,11 @@ func testPreloadITVerifyActionProfiles(t *testing.T) { Opts: map[string]any{}, Diktats: []*utils.APDiktat{ { - Path: "*balance.TestDataBalance.Value", - Value: "1024", + ID: "ADDBALVALUE", + Opts: map[string]any{ + "*balancePath": "*balance.TestDataBalance.Value", + "*balanceValue": "1024", + }, }, }, }, @@ -372,8 +381,11 @@ func testPreloadITVerifyActionProfiles(t *testing.T) { Opts: map[string]any{}, Diktats: []*utils.APDiktat{ { - Path: "*balance.TestVoiceBalance.Type", - Value: utils.MetaVoice, + ID: "SETBALTYPE", + Opts: map[string]any{ + "*balancePath": "*balance.TestVoiceBalance.Type", + "*balanceValue": utils.MetaVoice, + }, }, }, }, @@ -384,12 +396,18 @@ func testPreloadITVerifyActionProfiles(t *testing.T) { Opts: map[string]any{}, Diktats: []*utils.APDiktat{ { - Path: "*balance.TestVoiceBalance.Value", - Value: "15m15s", + ID: "ADDBALVALUE1", + Opts: map[string]any{ + "*balancePath": "*balance.TestVoiceBalance.Value", + "*balanceValue": "15m15s", + }, }, { - Path: "*balance.TestVoiceBalance2.Value", - Value: "15m15s", + ID: "ADDBALVALUE2", + Opts: map[string]any{ + "*balancePath": "*balance.TestVoiceBalance2.Value", + "*balanceValue": "15m15s", + }, }, }, }, diff --git a/apis/replicator_test.go b/apis/replicator_test.go index 45322cde5..d50ea1fb6 100644 --- a/apis/replicator_test.go +++ b/apis/replicator_test.go @@ -2921,8 +2921,10 @@ func TestReplicatorGetActionProfile(t *testing.T) { FilterIDs: []string{}, Type: "*topup", Diktats: []*utils.APDiktat{{ - Path: "~*balance.TestBalance.Value", - Value: "10", + Opts: map[string]any{ + "*balancePath": "~*balance.TestBalance.Value", + "*balanceValue": "10", + }, }}, }, }, @@ -2963,8 +2965,10 @@ func TestReplicatorGetActionProfileErr(t *testing.T) { FilterIDs: []string{}, Type: "*topup", Diktats: []*utils.APDiktat{{ - Path: "~*balance.TestBalance.Value", - Value: "10", + Opts: map[string]any{ + "*balancePath": "~*balance.TestBalance.Value", + "*balanceValue": "10", + }, }}, }, }, @@ -3138,8 +3142,10 @@ func TestReplicatorSetActionProfile(t *testing.T) { FilterIDs: []string{}, Type: "*topup", Diktats: []*utils.APDiktat{{ - Path: "~*balance.TestBalance.Value", - Value: "10", + Opts: map[string]any{ + "*balancePath": "~*balance.TestBalance.Value", + "*balanceValue": "10", + }, }}, }, }, @@ -3184,8 +3190,10 @@ func TestReplicatorSetActionProfileErr(t *testing.T) { FilterIDs: []string{}, Type: "*topup", Diktats: []*utils.APDiktat{{ - Path: "~*balance.TestBalance.Value", - Value: "10", + Opts: map[string]any{ + "*balancePath": "~*balance.TestBalance.Value", + "*balanceValue": "10", + }, }}, }, }, @@ -3363,8 +3371,10 @@ func TestReplicatorRemoveActionProfile(t *testing.T) { FilterIDs: []string{}, Type: "*topup", Diktats: []*utils.APDiktat{{ - Path: "~*balance.TestBalance.Value", - Value: "10", + Opts: map[string]any{ + "*balancePath": "~*balance.TestBalance.Value", + "*balanceValue": "10", + }, }}, }, }, @@ -3410,8 +3420,10 @@ func TestReplicatorRemoveActionProfileErr(t *testing.T) { FilterIDs: []string{}, Type: "*topup", Diktats: []*utils.APDiktat{{ - Path: "~*balance.TestBalance.Value", - Value: "10", + Opts: map[string]any{ + "*balancePath": "~*balance.TestBalance.Value", + "*balanceValue": "10", + }, }}, }, }, diff --git a/apis/stats_it_test.go b/apis/stats_it_test.go index ce31f1c5c..cd79503c5 100644 --- a/apis/stats_it_test.go +++ b/apis/stats_it_test.go @@ -1204,7 +1204,10 @@ func testStatsSetActionProfileBeforeProcessEv(t *testing.T) { Type: utils.MetaHTTPPost, Diktats: []*utils.APDiktat{ { - Path: sqSrv.URL, + ID: "HttpPost", + Opts: map[string]any{ + "*url": sqSrv.URL, + }, }, }, TTL: time.Duration(time.Minute), diff --git a/apis/tpes_it_test.go b/apis/tpes_it_test.go index dc911017f..081c64304 100644 --- a/apis/tpes_it_test.go +++ b/apis/tpes_it_test.go @@ -885,8 +885,11 @@ func testTPeSetActions(t *testing.T) { Type: utils.MetaSetBalance, Diktats: []*utils.APDiktat{ { - Path: "MONETARY", - Value: "10", + ID: "SetBalMonetary10", + Opts: map[string]any{ + "*balancePath": "MONETARY", + "*balanceValue": "10", + }, }}, }, }, @@ -1068,8 +1071,13 @@ func testTPeSExportTariffPlanHalfTariffPlan(t *testing.T) { {"cgrates.org", "SQ_basic", "", ";10", ";true", "0", "", "3", "true", "*none", "*tcd", "", ""}, }, utils.ActionsCsv: { - {"#Tenant", "ID", "FilterIDs", "Weights", "Blockers", "Schedule", "TargetType", "TargetIDs", "ActionID", "ActionFilterIDs", "ActionTTL", "ActionType", "ActionOpts", "ActionPath", "ActionValue"}, - {"cgrates.org", "Execute_thd", "", ";20", "", "", "*thresholds", "THD_1", "actID", "", "0s", "*reset_threshold", "", "", ""}, + {"#" + utils.Tenant, utils.ID, utils.FilterIDs, + utils.Weights, utils.Blockers, utils.Schedule, utils.TargetType, + utils.TargetIDs, utils.ActionID, utils.ActionFilterIDs, utils.ActionTTL, + utils.ActionType, utils.ActionOpts, utils.ActionWeights, utils.ActionBlockers, + utils.ActionDiktatsID, utils.ActionDiktatsFilterIDs, utils.ActionDiktatsOpts, + utils.ActionDiktatsWeights, utils.ActionDiktatsBlockers}, + {"cgrates.org", "Execute_thd", "", ";20", "", "", "*thresholds", "THD_1", "actID", "", "0s", "*reset_threshold", "", "", "", "", "", "", "", ""}, }, utils.ThresholdsCsv: { {"#Tenant", "ID", "FilterIDs", "Weights", "MaxHits", "MinHits", "MinSleep", "Blocker", "ActionProfileIDs", "Async", "EeIDs"}, @@ -1196,9 +1204,14 @@ func testTPeSExportTariffPlanAllTariffPlan(t *testing.T) { {"cgrates.org", "SQ_2", "", "", "", "0", "", "0", "false", "", "*tcd", "", ""}, }, utils.ActionsCsv: { - {"#Tenant", "ID", "FilterIDs", "Weights", "Blockers", "Schedule", "TargetType", "TargetIDs", "ActionID", "ActionFilterIDs", "ActionTTL", "ActionType", "ActionOpts", "ActionPath", "ActionValue"}, - {"cgrates.org", "Execute_thd", "", ";20", "", "", "*thresholds", "THD_1", "actID", "", "0s", "*reset_threshold", "", "", ""}, - {"cgrates.org", "SET_BAL", "*string:~*req.Account:1001", ";10", "", "*asap", "*accounts", "1001", "SET_BAL", "", "0s", "*set_balance", "", "MONETARY", "10"}, + {"#" + utils.Tenant, utils.ID, utils.FilterIDs, + utils.Weights, utils.Blockers, utils.Schedule, utils.TargetType, + utils.TargetIDs, utils.ActionID, utils.ActionFilterIDs, utils.ActionTTL, + utils.ActionType, utils.ActionOpts, utils.ActionWeights, utils.ActionBlockers, + utils.ActionDiktatsID, utils.ActionDiktatsFilterIDs, utils.ActionDiktatsOpts, + utils.ActionDiktatsWeights, utils.ActionDiktatsBlockers}, + {"cgrates.org", "Execute_thd", "", ";20", "", "", "*thresholds", "THD_1", "actID", "", "0s", "*reset_threshold", "", "", "", "", "", "", "", ""}, + {"cgrates.org", "SET_BAL", "*string:~*req.Account:1001", ";10", "", "*asap", "*accounts", "1001", "SET_BAL", "", "0s", "*set_balance", "", "", "", "SetBalMonetary10", "", "*balancePath:MONETARY;*balanceValue:10", "", ""}, }, utils.ThresholdsCsv: { {"#Tenant", "ID", "FilterIDs", "Weights", "MaxHits", "MinHits", "MinSleep", "Blocker", "ActionProfileIDs", "Async", "EeIDs"}, @@ -1212,7 +1225,15 @@ func testTPeSExportTariffPlanAllTariffPlan(t *testing.T) { expected[utils.AccountsCsv] = csvRply[utils.AccountsCsv] if !reflect.DeepEqual(expected, csvRply) { - t.Errorf("Expected %+v \n received %+v", utils.ToJSON(expected), utils.ToJSON(csvRply)) + if !reflect.DeepEqual(csvRply[utils.ActionsCsv][2], []string{"cgrates.org", "SET_BAL", "*string:~*req.Account:1001", ";10", "", "*asap", "*accounts", "1001", "SET_BAL", "", "0s", "*set_balance", "", "", "", "SetBalMonetary10", "", "*balanceValue:10;*balancePath:MONETARY", "", ""}) { + t.Errorf("Expected %+v \n received %+v", utils.ToJSON(expected), utils.ToJSON(csvRply)) + } else { + newCsvReply := csvRply[utils.ActionsCsv][:1] + newExpected := expected[utils.ActionsCsv][:1] // make sure the rest of the tariffs are equal + if !reflect.DeepEqual(newExpected, newCsvReply) { + t.Errorf("Expected %+v \n received %+v", utils.ToJSON(newExpected), utils.ToJSON(newCsvReply)) + } + } } // by giving an empty list of exportItems, this will do the same, it will get all the tariffplan in CSV format @@ -1245,7 +1266,15 @@ func testTPeSExportTariffPlanAllTariffPlan(t *testing.T) { } // expected will remain the same if !reflect.DeepEqual(expected, csvRply) { - t.Errorf("Expected %+v \n received %+v", utils.ToJSON(expected), utils.ToJSON(csvRply)) + if !reflect.DeepEqual(csvRply[utils.ActionsCsv][2], []string{"cgrates.org", "SET_BAL", "*string:~*req.Account:1001", ";10", "", "*asap", "*accounts", "1001", "SET_BAL", "", "0s", "*set_balance", "", "", "", "SetBalMonetary10", "", "*balanceValue:10;*balancePath:MONETARY", "", ""}) { + t.Errorf("Expected %+v \n received %+v", utils.ToJSON(expected), utils.ToJSON(csvRply)) + } else { + csvRply[utils.ActionsCsv][2] = nil + expected[utils.ActionsCsv][2] = nil // make sure the rest of the tariffs are equal + if !reflect.DeepEqual(expected, csvRply) { + t.Errorf("Expected %+v \n received %+v", utils.ToJSON(expected), utils.ToJSON(csvRply)) + } + } } } diff --git a/cmd/cgr-loader/cgr-loader_remove_it_test.go b/cmd/cgr-loader/cgr-loader_remove_it_test.go index 45566e630..111821886 100644 --- a/cmd/cgr-loader/cgr-loader_remove_it_test.go +++ b/cmd/cgr-loader/cgr-loader_remove_it_test.go @@ -309,8 +309,11 @@ func testCgrLdrGetActionProfileAfterLoad(t *testing.T) { Type: utils.MetaAddBalance, Diktats: []*utils.APDiktat{ { - Path: "*balance.TestBalance.Units", - Value: "10", + ID: "ADDBALUNITS", + Opts: map[string]any{ + "*balancePath": "*balance.TestBalance.Units", + "*balanceValue": "10", + }, }, }, }, @@ -319,8 +322,11 @@ func testCgrLdrGetActionProfileAfterLoad(t *testing.T) { Type: utils.MetaSetBalance, Diktats: []*utils.APDiktat{ { - Path: "*balance.TestDataBalance.Type", - Value: utils.MetaData, + ID: "SETBALTYPE", + Opts: map[string]any{ + "*balancePath": "*balance.TestDataBalance.Type", + "*balanceValue": utils.MetaData, + }, }, }, }, @@ -329,8 +335,11 @@ func testCgrLdrGetActionProfileAfterLoad(t *testing.T) { Type: utils.MetaAddBalance, Diktats: []*utils.APDiktat{ { - Path: "*balance.TestDataBalance.Units", - Value: "1024", + ID: "ADDBALUNITS", + Opts: map[string]any{ + "*balancePath": "*balance.TestDataBalance.Units", + "*balanceValue": "1024", + }, }, }, }, @@ -339,8 +348,11 @@ func testCgrLdrGetActionProfileAfterLoad(t *testing.T) { Type: utils.MetaSetBalance, Diktats: []*utils.APDiktat{ { - Path: "*balance.TestVoiceBalance.Type", - Value: utils.MetaVoice, + ID: "SETBALTYPE", + Opts: map[string]any{ + "*balancePath": "*balance.TestVoiceBalance.Type", + "*balanceValue": utils.MetaVoice, + }, }, }, }, @@ -349,8 +361,11 @@ func testCgrLdrGetActionProfileAfterLoad(t *testing.T) { Type: utils.MetaAddBalance, Diktats: []*utils.APDiktat{ { - Path: "*balance.TestVoiceBalance.Units", - Value: "15m15s", + ID: "ADDBALUNITS", + Opts: map[string]any{ + "*balancePath": "*balance.TestVoiceBalance.Units", + "*balanceValue": "15m15s", + }, }, }, }, @@ -359,8 +374,11 @@ func testCgrLdrGetActionProfileAfterLoad(t *testing.T) { Type: utils.MetaSetBalance, Diktats: []*utils.APDiktat{ { - Path: "*balance.TestVoiceBalance.Filters", - Value: "*string:~*req.CustomField:500", + ID: "SETBALFILTER", + Opts: map[string]any{ + "*balancePath": "*balance.TestVoiceBalance.Filters", + "*balanceValue": "*string:~*req.CustomField:500", + }, }, }, }, @@ -369,7 +387,10 @@ func testCgrLdrGetActionProfileAfterLoad(t *testing.T) { Type: utils.MetaRemBalance, Diktats: []*utils.APDiktat{ { - Path: "TestVoiceBalance2", + ID: "REMBAL", + Opts: map[string]any{ + "*balancePath": "TestVoiceBalance2", + }, }, }, }, diff --git a/config/config_json_test.go b/config/config_json_test.go index f465de39c..d8c2b19eb 100644 --- a/config/config_json_test.go +++ b/config/config_json_test.go @@ -1738,17 +1738,42 @@ func TestDfLoaderJsonCfg(t *testing.T) { Type: utils.StringPointer(utils.MetaVariable), Filters: &[]string{"*notempty:~*req.8:"}, Value: utils.StringPointer("~*req.12")}, - {Tag: utils.StringPointer("ActionPath"), - Path: utils.StringPointer("Actions[<~*req.8>].Diktats.Path"), - Type: utils.StringPointer(utils.MetaVariable), - Filters: &[]string{"*notempty:~*req.8:"}, - Value: utils.StringPointer("~*req.13"), - New_branch: utils.BoolPointer(true)}, - {Tag: utils.StringPointer("ActionValue"), - Path: utils.StringPointer("Actions[<~*req.8>].Diktats.Value"), + {Tag: utils.StringPointer("ActionWeights"), + Path: utils.StringPointer("Actions[<~*req.8>].Weights"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.8:"}, + Value: utils.StringPointer("~*req.13")}, + {Tag: utils.StringPointer("ActionBlockers"), + Path: utils.StringPointer("Actions[<~*req.8>].Blockers"), Type: utils.StringPointer(utils.MetaVariable), Filters: &[]string{"*notempty:~*req.8:"}, Value: utils.StringPointer("~*req.14")}, + {Tag: utils.StringPointer("ActionDiktatsID"), + Path: utils.StringPointer("Actions[<~*req.8>].Diktats.ID"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.8:"}, + Value: utils.StringPointer("~*req.15"), + New_branch: utils.BoolPointer(true)}, + {Tag: utils.StringPointer("ActionDiktatsFilterIDs"), + Path: utils.StringPointer("Actions[<~*req.8>].Diktats.FilterIDs"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.8:"}, + Value: utils.StringPointer("~*req.16")}, + {Tag: utils.StringPointer("ActionDiktatsOpts"), + Path: utils.StringPointer("Actions[<~*req.8>].Diktats.Opts"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.8:"}, + Value: utils.StringPointer("~*req.17")}, + {Tag: utils.StringPointer("ActionDiktatsWeights"), + Path: utils.StringPointer("Actions[<~*req.8>].Diktats.Weights"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.8:"}, + Value: utils.StringPointer("~*req.18")}, + {Tag: utils.StringPointer("ActionDiktatsBlockers"), + Path: utils.StringPointer("Actions[<~*req.8>].Diktats.Blockers"), + Type: utils.StringPointer(utils.MetaVariable), + Filters: &[]string{"*notempty:~*req.8:"}, + Value: utils.StringPointer("~*req.19")}, }, }, { diff --git a/config/config_test.go b/config/config_test.go index 540616e38..425014f41 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -3140,19 +3140,49 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) { Filters: []string{"*notempty:~*req.8:"}, Value: utils.NewRSRParsersMustCompile("~*req.12", utils.InfieldSep), Layout: time.RFC3339}, - {Tag: "ActionPath", - Path: "Actions[<~*req.8>].Diktats.Path", - Type: utils.MetaVariable, - Filters: []string{"*notempty:~*req.8:"}, - Value: utils.NewRSRParsersMustCompile("~*req.13", utils.InfieldSep), - NewBranch: true, - Layout: time.RFC3339}, - {Tag: "ActionValue", - Path: "Actions[<~*req.8>].Diktats.Value", + {Tag: "ActionWeights", + Path: "Actions[<~*req.8>].Weights", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.8:"}, + Value: utils.NewRSRParsersMustCompile("~*req.13", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "ActionBlockers", + Path: "Actions[<~*req.8>].Blockers", Type: utils.MetaVariable, Filters: []string{"*notempty:~*req.8:"}, Value: utils.NewRSRParsersMustCompile("~*req.14", utils.InfieldSep), Layout: time.RFC3339}, + {Tag: "ActionDiktatsID", + Path: "Actions[<~*req.8>].Diktats.ID", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.8:"}, + Value: utils.NewRSRParsersMustCompile("~*req.15", utils.InfieldSep), + NewBranch: true, + Layout: time.RFC3339}, + {Tag: "ActionDiktatsFilterIDs", + Path: "Actions[<~*req.8>].Diktats.FilterIDs", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.8:"}, + Value: utils.NewRSRParsersMustCompile("~*req.16", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "ActionDiktatsOpts", + Path: "Actions[<~*req.8>].Diktats.Opts", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.8:"}, + Value: utils.NewRSRParsersMustCompile("~*req.17", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "ActionDiktatsWeights", + Path: "Actions[<~*req.8>].Diktats.Weights", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.8:"}, + Value: utils.NewRSRParsersMustCompile("~*req.18", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "ActionDiktatsBlockers", + Path: "Actions[<~*req.8>].Diktats.Blockers", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.8:"}, + Value: utils.NewRSRParsersMustCompile("~*req.19", utils.InfieldSep), + Layout: time.RFC3339}, }, }, { @@ -5081,7 +5111,7 @@ func TestV1GetConfigAsJSONSureTax(t *testing.T) { func TestV1GetConfigAsJSONLoaders(t *testing.T) { var reply string - expected := `{"loaders":[{"action":"*store","cache":{"*accounts":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*action_profiles":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*attributes":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*chargers":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*filters":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*ips":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*rankings":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*rate_profiles":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*resources":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*routes":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*stats":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*thresholds":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*trends":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"}},"caches_conns":["*internal"],"data":[{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"new_branch":true,"path":"Rules.Type","tag":"Type","type":"*variable","value":"~*req.2"},{"path":"Rules.Element","tag":"Element","type":"*variable","value":"~*req.3"},{"path":"Rules.Values","tag":"Values","type":"*variable","value":"~*req.4"}],"file_name":"Filters.csv","flags":null,"type":"*filters"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"TenantID","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ProfileID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"new_branch":true,"path":"Attributes.FilterIDs","tag":"AttributeFilterIDs","type":"*variable","value":"~*req.5"},{"path":"Attributes.Blockers","tag":"AttributeBlockers","type":"*variable","value":"~*req.6"},{"path":"Attributes.Path","tag":"Path","type":"*variable","value":"~*req.7"},{"path":"Attributes.Type","tag":"Type","type":"*variable","value":"~*req.8"},{"path":"Attributes.Value","tag":"Value","type":"*variable","value":"~*req.9"}],"file_name":"Attributes.csv","flags":null,"type":"*attributes"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"UsageTTL","tag":"TTL","type":"*variable","value":"~*req.4"},{"path":"Limit","tag":"Limit","type":"*variable","value":"~*req.5"},{"path":"AllocationMessage","tag":"AllocationMessage","type":"*variable","value":"~*req.6"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.7"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.8"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.9"}],"file_name":"Resources.csv","flags":null,"type":"*resources"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"TTL","tag":"TTL","type":"*variable","value":"~*req.4"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.5"},{"new_branch":true,"path":"Pools.ID","tag":"PoolID","type":"*variable","value":"~*req.6"},{"path":"Pools.FilterIDs","tag":"PoolFilterIDs","type":"*variable","value":"~*req.7"},{"path":"Pools.Type","tag":"PoolType","type":"*variable","value":"~*req.8"},{"path":"Pools.Range","tag":"PoolRange","type":"*variable","value":"~*req.9"},{"path":"Pools.Strategy","tag":"PoolStrategy","type":"*variable","value":"~*req.10"},{"path":"Pools.Message","tag":"PoolMessage","type":"*variable","value":"~*req.11"},{"path":"Pools.Weights","tag":"PoolWeights","type":"*variable","value":"~*req.12"},{"path":"Pools.Blockers","tag":"PoolBlockers","type":"*variable","value":"~*req.13"}],"file_name":"IPs.csv","flags":null,"type":"*ips"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"QueueLength","tag":"QueueLength","type":"*variable","value":"~*req.5"},{"path":"TTL","tag":"TTL","type":"*variable","value":"~*req.6"},{"path":"MinItems","tag":"MinItems","type":"*variable","value":"~*req.7"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.8"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.9"},{"new_branch":true,"path":"Metrics.MetricID","tag":"MetricIDs","type":"*variable","value":"~*req.10"},{"path":"Metrics.FilterIDs","tag":"MetricFilterIDs","type":"*variable","value":"~*req.11"},{"path":"Metrics.Blockers","tag":"MetricBlockers","type":"*variable","value":"~*req.12"}],"file_name":"Stats.csv","flags":null,"type":"*stats"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"MaxHits","tag":"MaxHits","type":"*variable","value":"~*req.4"},{"path":"MinHits","tag":"MinHits","type":"*variable","value":"~*req.5"},{"path":"MinSleep","tag":"MinSleep","type":"*variable","value":"~*req.6"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.7"},{"path":"ActionProfileIDs","tag":"ActionProfileIDs","type":"*variable","value":"~*req.8"},{"path":"Async","tag":"Async","type":"*variable","value":"~*req.9"},{"path":"EeIDs","tag":"EeIDs","type":"*variable","value":"~*req.10"}],"file_name":"Thresholds.csv","flags":null,"type":"*thresholds"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.2"},{"path":"StatID","tag":"StatID","type":"*variable","value":"~*req.3"},{"path":"Metrics","tag":"Metrics","type":"*variable","value":"~*req.4"},{"path":"TTL","tag":"TTL","type":"*variable","value":"~*req.5"},{"path":"QueueLength","tag":"QueueLength","type":"*variable","value":"~*req.6"},{"path":"MinItems","tag":"MinItems","type":"*variable","value":"~*req.7"},{"path":"CorrelationType","tag":"CorrelationType","type":"*variable","value":"~*req.8"},{"path":"Tolerance","tag":"Tolerance","type":"*variable","value":"~*req.9"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.10"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.11"}],"file_name":"Trends.csv","flags":null,"type":"*trends"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.2"},{"path":"StatIDs","tag":"StatIDs","type":"*variable","value":"~*req.3"},{"path":"MetricIDs","tag":"MetricIDs","type":"*variable","value":"~*req.4"},{"path":"Sorting","tag":"Sorting","type":"*variable","value":"~*req.5"},{"path":"SortingParameters","tag":"SortingParameters","type":"*variable","value":"~*req.6"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.7"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.8"}],"file_name":"Rankings.csv","flags":null,"type":"*rankings"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"Sorting","tag":"Sorting","type":"*variable","value":"~*req.5"},{"path":"SortingParameters","tag":"SortingParameters","type":"*variable","value":"~*req.6"},{"new_branch":true,"path":"Routes.ID","tag":"RouteID","type":"*variable","value":"~*req.7"},{"path":"Routes.FilterIDs","tag":"RouteFilterIDs","type":"*variable","value":"~*req.8"},{"path":"Routes.AccountIDs","tag":"RouteAccountIDs","type":"*variable","value":"~*req.9"},{"path":"Routes.RateProfileIDs","tag":"RouteRateProfileIDs","type":"*variable","value":"~*req.10"},{"path":"Routes.ResourceIDs","tag":"RouteResourceIDs","type":"*variable","value":"~*req.11"},{"path":"Routes.StatIDs","tag":"RouteStatIDs","type":"*variable","value":"~*req.12"},{"path":"Routes.Weights","tag":"RouteWeights","type":"*variable","value":"~*req.13"},{"path":"Routes.Blockers","tag":"RouteBlockers","type":"*variable","value":"~*req.14"},{"path":"Routes.RouteParameters","tag":"RouteParameters","type":"*variable","value":"~*req.15"}],"file_name":"Routes.csv","flags":null,"type":"*routes"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"RunID","tag":"RunID","type":"*variable","value":"~*req.5"},{"path":"AttributeIDs","tag":"AttributeIDs","type":"*variable","value":"~*req.6"}],"file_name":"Chargers.csv","flags":null,"type":"*chargers"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"MinCost","tag":"MinCost","type":"*variable","value":"~*req.4"},{"path":"MaxCost","tag":"MaxCost","type":"*variable","value":"~*req.5"},{"path":"MaxCostStrategy","tag":"MaxCostStrategy","type":"*variable","value":"~*req.6"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].FilterIDs","tag":"RateFilterIDs","type":"*variable","value":"~*req.8"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].ActivationTimes","tag":"RateActivationTimes","type":"*variable","value":"~*req.9"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].Weights","tag":"RateWeights","type":"*variable","value":"~*req.10"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].Blocker","tag":"RateBlocker","type":"*variable","value":"~*req.11"},{"filters":["*notempty:~*req.7:"],"new_branch":true,"path":"Rates[\u003c~*req.7\u003e].IntervalRates.IntervalStart","tag":"RateIntervalStart","type":"*variable","value":"~*req.12"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.FixedFee","tag":"RateFixedFee","type":"*variable","value":"~*req.13"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.RecurrentFee","tag":"RateRecurrentFee","type":"*variable","value":"~*req.14"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.Unit","tag":"RateUnit","type":"*variable","value":"~*req.15"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.Increment","tag":"RateIncrement","type":"*variable","value":"~*req.16"}],"file_name":"Rates.csv","flags":null,"type":"*rate_profiles"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.5"},{"path":"Targets[\u003c~*req.6\u003e]","tag":"TargetIDs","type":"*variable","value":"~*req.7"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].FilterIDs","tag":"ActionFilterIDs","type":"*variable","value":"~*req.9"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].TTL","tag":"ActionTTL","type":"*variable","value":"~*req.10"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Type","tag":"ActionType","type":"*variable","value":"~*req.11"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Opts","tag":"ActionOpts","type":"*variable","value":"~*req.12"},{"filters":["*notempty:~*req.8:"],"new_branch":true,"path":"Actions[\u003c~*req.8\u003e].Diktats.Path","tag":"ActionPath","type":"*variable","value":"~*req.13"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Diktats.Value","tag":"ActionValue","type":"*variable","value":"~*req.14"}],"file_name":"Actions.csv","flags":null,"type":"*action_profiles"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"Opts","tag":"Opts","type":"*variable","value":"~*req.5"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].FilterIDs","tag":"BalanceFilterIDs","type":"*variable","value":"~*req.7"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Weights","tag":"BalanceWeights","type":"*variable","value":"~*req.8"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Blockers","tag":"BalanceBlockers","type":"*variable","value":"~*req.9"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Type","tag":"BalanceType","type":"*variable","value":"~*req.10"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Units","tag":"BalanceUnits","type":"*variable","value":"~*req.11"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].UnitFactors","tag":"BalanceUnitFactors","type":"*variable","value":"~*req.12"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Opts","tag":"BalanceOpts","type":"*variable","value":"~*req.13"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].CostIncrements","tag":"BalanceCostIncrements","type":"*variable","value":"~*req.14"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].AttributeIDs","tag":"BalanceAttributeIDs","type":"*variable","value":"~*req.15"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].RateProfileIDs","tag":"BalanceRateProfileIDs","type":"*variable","value":"~*req.16"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.17"}],"file_name":"Accounts.csv","flags":null,"type":"*accounts"}],"enabled":false,"field_separator":",","id":"*default","lockfile_path":".cgr.lck","opts":{"*cache":"","*forceLock":false,"*stopOnError":false,"*withIndex":true},"run_delay":"0","tenant":"","tp_in_dir":"/var/spool/cgrates/loader/in","tp_out_dir":"/var/spool/cgrates/loader/out"}]}` + expected := `{"loaders":[{"action":"*store","cache":{"*accounts":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*action_profiles":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*attributes":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*chargers":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*filters":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*ips":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*rankings":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*rate_profiles":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*resources":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*routes":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*stats":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*thresholds":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*trends":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"}},"caches_conns":["*internal"],"data":[{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"new_branch":true,"path":"Rules.Type","tag":"Type","type":"*variable","value":"~*req.2"},{"path":"Rules.Element","tag":"Element","type":"*variable","value":"~*req.3"},{"path":"Rules.Values","tag":"Values","type":"*variable","value":"~*req.4"}],"file_name":"Filters.csv","flags":null,"type":"*filters"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"TenantID","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ProfileID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"new_branch":true,"path":"Attributes.FilterIDs","tag":"AttributeFilterIDs","type":"*variable","value":"~*req.5"},{"path":"Attributes.Blockers","tag":"AttributeBlockers","type":"*variable","value":"~*req.6"},{"path":"Attributes.Path","tag":"Path","type":"*variable","value":"~*req.7"},{"path":"Attributes.Type","tag":"Type","type":"*variable","value":"~*req.8"},{"path":"Attributes.Value","tag":"Value","type":"*variable","value":"~*req.9"}],"file_name":"Attributes.csv","flags":null,"type":"*attributes"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"UsageTTL","tag":"TTL","type":"*variable","value":"~*req.4"},{"path":"Limit","tag":"Limit","type":"*variable","value":"~*req.5"},{"path":"AllocationMessage","tag":"AllocationMessage","type":"*variable","value":"~*req.6"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.7"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.8"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.9"}],"file_name":"Resources.csv","flags":null,"type":"*resources"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"TTL","tag":"TTL","type":"*variable","value":"~*req.4"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.5"},{"new_branch":true,"path":"Pools.ID","tag":"PoolID","type":"*variable","value":"~*req.6"},{"path":"Pools.FilterIDs","tag":"PoolFilterIDs","type":"*variable","value":"~*req.7"},{"path":"Pools.Type","tag":"PoolType","type":"*variable","value":"~*req.8"},{"path":"Pools.Range","tag":"PoolRange","type":"*variable","value":"~*req.9"},{"path":"Pools.Strategy","tag":"PoolStrategy","type":"*variable","value":"~*req.10"},{"path":"Pools.Message","tag":"PoolMessage","type":"*variable","value":"~*req.11"},{"path":"Pools.Weights","tag":"PoolWeights","type":"*variable","value":"~*req.12"},{"path":"Pools.Blockers","tag":"PoolBlockers","type":"*variable","value":"~*req.13"}],"file_name":"IPs.csv","flags":null,"type":"*ips"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"QueueLength","tag":"QueueLength","type":"*variable","value":"~*req.5"},{"path":"TTL","tag":"TTL","type":"*variable","value":"~*req.6"},{"path":"MinItems","tag":"MinItems","type":"*variable","value":"~*req.7"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.8"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.9"},{"new_branch":true,"path":"Metrics.MetricID","tag":"MetricIDs","type":"*variable","value":"~*req.10"},{"path":"Metrics.FilterIDs","tag":"MetricFilterIDs","type":"*variable","value":"~*req.11"},{"path":"Metrics.Blockers","tag":"MetricBlockers","type":"*variable","value":"~*req.12"}],"file_name":"Stats.csv","flags":null,"type":"*stats"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"MaxHits","tag":"MaxHits","type":"*variable","value":"~*req.4"},{"path":"MinHits","tag":"MinHits","type":"*variable","value":"~*req.5"},{"path":"MinSleep","tag":"MinSleep","type":"*variable","value":"~*req.6"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.7"},{"path":"ActionProfileIDs","tag":"ActionProfileIDs","type":"*variable","value":"~*req.8"},{"path":"Async","tag":"Async","type":"*variable","value":"~*req.9"},{"path":"EeIDs","tag":"EeIDs","type":"*variable","value":"~*req.10"}],"file_name":"Thresholds.csv","flags":null,"type":"*thresholds"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.2"},{"path":"StatID","tag":"StatID","type":"*variable","value":"~*req.3"},{"path":"Metrics","tag":"Metrics","type":"*variable","value":"~*req.4"},{"path":"TTL","tag":"TTL","type":"*variable","value":"~*req.5"},{"path":"QueueLength","tag":"QueueLength","type":"*variable","value":"~*req.6"},{"path":"MinItems","tag":"MinItems","type":"*variable","value":"~*req.7"},{"path":"CorrelationType","tag":"CorrelationType","type":"*variable","value":"~*req.8"},{"path":"Tolerance","tag":"Tolerance","type":"*variable","value":"~*req.9"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.10"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.11"}],"file_name":"Trends.csv","flags":null,"type":"*trends"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.2"},{"path":"StatIDs","tag":"StatIDs","type":"*variable","value":"~*req.3"},{"path":"MetricIDs","tag":"MetricIDs","type":"*variable","value":"~*req.4"},{"path":"Sorting","tag":"Sorting","type":"*variable","value":"~*req.5"},{"path":"SortingParameters","tag":"SortingParameters","type":"*variable","value":"~*req.6"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.7"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.8"}],"file_name":"Rankings.csv","flags":null,"type":"*rankings"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"Sorting","tag":"Sorting","type":"*variable","value":"~*req.5"},{"path":"SortingParameters","tag":"SortingParameters","type":"*variable","value":"~*req.6"},{"new_branch":true,"path":"Routes.ID","tag":"RouteID","type":"*variable","value":"~*req.7"},{"path":"Routes.FilterIDs","tag":"RouteFilterIDs","type":"*variable","value":"~*req.8"},{"path":"Routes.AccountIDs","tag":"RouteAccountIDs","type":"*variable","value":"~*req.9"},{"path":"Routes.RateProfileIDs","tag":"RouteRateProfileIDs","type":"*variable","value":"~*req.10"},{"path":"Routes.ResourceIDs","tag":"RouteResourceIDs","type":"*variable","value":"~*req.11"},{"path":"Routes.StatIDs","tag":"RouteStatIDs","type":"*variable","value":"~*req.12"},{"path":"Routes.Weights","tag":"RouteWeights","type":"*variable","value":"~*req.13"},{"path":"Routes.Blockers","tag":"RouteBlockers","type":"*variable","value":"~*req.14"},{"path":"Routes.RouteParameters","tag":"RouteParameters","type":"*variable","value":"~*req.15"}],"file_name":"Routes.csv","flags":null,"type":"*routes"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"RunID","tag":"RunID","type":"*variable","value":"~*req.5"},{"path":"AttributeIDs","tag":"AttributeIDs","type":"*variable","value":"~*req.6"}],"file_name":"Chargers.csv","flags":null,"type":"*chargers"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"MinCost","tag":"MinCost","type":"*variable","value":"~*req.4"},{"path":"MaxCost","tag":"MaxCost","type":"*variable","value":"~*req.5"},{"path":"MaxCostStrategy","tag":"MaxCostStrategy","type":"*variable","value":"~*req.6"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].FilterIDs","tag":"RateFilterIDs","type":"*variable","value":"~*req.8"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].ActivationTimes","tag":"RateActivationTimes","type":"*variable","value":"~*req.9"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].Weights","tag":"RateWeights","type":"*variable","value":"~*req.10"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].Blocker","tag":"RateBlocker","type":"*variable","value":"~*req.11"},{"filters":["*notempty:~*req.7:"],"new_branch":true,"path":"Rates[\u003c~*req.7\u003e].IntervalRates.IntervalStart","tag":"RateIntervalStart","type":"*variable","value":"~*req.12"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.FixedFee","tag":"RateFixedFee","type":"*variable","value":"~*req.13"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.RecurrentFee","tag":"RateRecurrentFee","type":"*variable","value":"~*req.14"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.Unit","tag":"RateUnit","type":"*variable","value":"~*req.15"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.Increment","tag":"RateIncrement","type":"*variable","value":"~*req.16"}],"file_name":"Rates.csv","flags":null,"type":"*rate_profiles"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.5"},{"path":"Targets[\u003c~*req.6\u003e]","tag":"TargetIDs","type":"*variable","value":"~*req.7"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].FilterIDs","tag":"ActionFilterIDs","type":"*variable","value":"~*req.9"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].TTL","tag":"ActionTTL","type":"*variable","value":"~*req.10"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Type","tag":"ActionType","type":"*variable","value":"~*req.11"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Opts","tag":"ActionOpts","type":"*variable","value":"~*req.12"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Weights","tag":"ActionWeights","type":"*variable","value":"~*req.13"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Blockers","tag":"ActionBlockers","type":"*variable","value":"~*req.14"},{"filters":["*notempty:~*req.8:"],"new_branch":true,"path":"Actions[\u003c~*req.8\u003e].Diktats.ID","tag":"ActionDiktatsID","type":"*variable","value":"~*req.15"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Diktats.FilterIDs","tag":"ActionDiktatsFilterIDs","type":"*variable","value":"~*req.16"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Diktats.Opts","tag":"ActionDiktatsOpts","type":"*variable","value":"~*req.17"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Diktats.Weights","tag":"ActionDiktatsWeights","type":"*variable","value":"~*req.18"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Diktats.Blockers","tag":"ActionDiktatsBlockers","type":"*variable","value":"~*req.19"}],"file_name":"Actions.csv","flags":null,"type":"*action_profiles"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"Opts","tag":"Opts","type":"*variable","value":"~*req.5"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].FilterIDs","tag":"BalanceFilterIDs","type":"*variable","value":"~*req.7"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Weights","tag":"BalanceWeights","type":"*variable","value":"~*req.8"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Blockers","tag":"BalanceBlockers","type":"*variable","value":"~*req.9"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Type","tag":"BalanceType","type":"*variable","value":"~*req.10"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Units","tag":"BalanceUnits","type":"*variable","value":"~*req.11"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].UnitFactors","tag":"BalanceUnitFactors","type":"*variable","value":"~*req.12"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Opts","tag":"BalanceOpts","type":"*variable","value":"~*req.13"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].CostIncrements","tag":"BalanceCostIncrements","type":"*variable","value":"~*req.14"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].AttributeIDs","tag":"BalanceAttributeIDs","type":"*variable","value":"~*req.15"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].RateProfileIDs","tag":"BalanceRateProfileIDs","type":"*variable","value":"~*req.16"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.17"}],"file_name":"Accounts.csv","flags":null,"type":"*accounts"}],"enabled":false,"field_separator":",","id":"*default","lockfile_path":".cgr.lck","opts":{"*cache":"","*forceLock":false,"*stopOnError":false,"*withIndex":true},"run_delay":"0","tenant":"","tp_in_dir":"/var/spool/cgrates/loader/in","tp_out_dir":"/var/spool/cgrates/loader/out"}]}` cgrCfg := NewDefaultCGRConfig() if err := cgrCfg.V1GetConfigAsJSON(context.Background(), &SectionWithAPIOpts{Sections: []string{LoaderSJSON}}, &reply); err != nil { t.Error(err) diff --git a/config/loaderscfg_test.go b/config/loaderscfg_test.go index 925a0c424..7fa51a301 100644 --- a/config/loaderscfg_test.go +++ b/config/loaderscfg_test.go @@ -873,19 +873,49 @@ func TestLoaderSCfgloadFromJsonCfgCase1(t *testing.T) { Filters: []string{"*notempty:~*req.8:"}, Value: utils.NewRSRParsersMustCompile("~*req.12", utils.InfieldSep), Layout: time.RFC3339}, - {Tag: "ActionPath", - Path: "Actions[<~*req.8>].Diktats.Path", - Type: utils.MetaVariable, - Filters: []string{"*notempty:~*req.8:"}, - Value: utils.NewRSRParsersMustCompile("~*req.13", utils.InfieldSep), - NewBranch: true, - Layout: time.RFC3339}, - {Tag: "ActionValue", - Path: "Actions[<~*req.8>].Diktats.Value", + {Tag: "ActionWeights", + Path: "Actions[<~*req.8>].Weights", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.8:"}, + Value: utils.NewRSRParsersMustCompile("~*req.13", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "ActionBlockers", + Path: "Actions[<~*req.8>].Blockers", Type: utils.MetaVariable, Filters: []string{"*notempty:~*req.8:"}, Value: utils.NewRSRParsersMustCompile("~*req.14", utils.InfieldSep), Layout: time.RFC3339}, + {Tag: "ActionDiktatsID", + Path: "Actions[<~*req.8>].Diktats.ID", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.8:"}, + Value: utils.NewRSRParsersMustCompile("~*req.15", utils.InfieldSep), + NewBranch: true, + Layout: time.RFC3339}, + {Tag: "ActionDiktatsFilterIDs", + Path: "Actions[<~*req.8>].Diktats.FilterIDs", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.8:"}, + Value: utils.NewRSRParsersMustCompile("~*req.16", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "ActionDiktatsOpts", + Path: "Actions[<~*req.8>].Diktats.Opts", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.8:"}, + Value: utils.NewRSRParsersMustCompile("~*req.17", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "ActionDiktatsWeights", + Path: "Actions[<~*req.8>].Diktats.Weights", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.8:"}, + Value: utils.NewRSRParsersMustCompile("~*req.18", utils.InfieldSep), + Layout: time.RFC3339}, + {Tag: "ActionDiktatsBlockers", + Path: "Actions[<~*req.8>].Diktats.Blockers", + Type: utils.MetaVariable, + Filters: []string{"*notempty:~*req.8:"}, + Value: utils.NewRSRParsersMustCompile("~*req.19", utils.InfieldSep), + Layout: time.RFC3339}, }, }, { @@ -2098,20 +2128,55 @@ func TestLoaderCfgAsMapInterfaceCase1(t *testing.T) { utils.ValueCfg: "~*req.12", }, { - utils.NewBranchCfg: true, - utils.TagCfg: "ActionPath", - utils.PathCfg: "Actions[<~*req.8>].Diktats.Path", - utils.FiltersCfg: []string{"*notempty:~*req.8:"}, - utils.TypeCfg: "*variable", - utils.ValueCfg: "~*req.13", + utils.TagCfg: "ActionWeights", + utils.PathCfg: "Actions[<~*req.8>].Weights", + utils.FiltersCfg: []string{"*notempty:~*req.8:"}, + utils.TypeCfg: "*variable", + utils.ValueCfg: "~*req.13", }, { - utils.TagCfg: "ActionValue", - utils.PathCfg: "Actions[<~*req.8>].Diktats.Value", + utils.TagCfg: "ActionBlockers", + utils.PathCfg: "Actions[<~*req.8>].Blockers", utils.FiltersCfg: []string{"*notempty:~*req.8:"}, utils.TypeCfg: "*variable", utils.ValueCfg: "~*req.14", }, + { + utils.NewBranchCfg: true, + utils.TagCfg: "ActionDiktatsID", + utils.PathCfg: "Actions[<~*req.8>].Diktats.ID", + utils.FiltersCfg: []string{"*notempty:~*req.8:"}, + utils.TypeCfg: "*variable", + utils.ValueCfg: "~*req.15", + }, + { + utils.TagCfg: "ActionDiktatsFilterIDs", + utils.PathCfg: "Actions[<~*req.8>].Diktats.FilterIDs", + utils.FiltersCfg: []string{"*notempty:~*req.8:"}, + utils.TypeCfg: "*variable", + utils.ValueCfg: "~*req.16", + }, + { + utils.TagCfg: "ActionDiktatsOpts", + utils.PathCfg: "Actions[<~*req.8>].Diktats.Opts", + utils.FiltersCfg: []string{"*notempty:~*req.8:"}, + utils.TypeCfg: "*variable", + utils.ValueCfg: "~*req.17", + }, + { + utils.TagCfg: "ActionDiktatsWeights", + utils.PathCfg: "Actions[<~*req.8>].Diktats.Weights", + utils.FiltersCfg: []string{"*notempty:~*req.8:"}, + utils.TypeCfg: "*variable", + utils.ValueCfg: "~*req.18", + }, + { + utils.TagCfg: "ActionDiktatsBlockers", + utils.PathCfg: "Actions[<~*req.8>].Diktats.Blockers", + utils.FiltersCfg: []string{"*notempty:~*req.8:"}, + utils.TypeCfg: "*variable", + utils.ValueCfg: "~*req.19", + }, }, }, { diff --git a/data/conf/cgrates/cgrates.json b/data/conf/cgrates/cgrates.json index e43b82a4f..d01bf0626 100755 --- a/data/conf/cgrates/cgrates.json +++ b/data/conf/cgrates/cgrates.json @@ -1462,10 +1462,15 @@ // {"tag": "ActionFilterIDs", "path": "Actions[<~*req.8>].FilterIDs", "type": "*variable", "value": "~*req.9", "filters": ["*notempty:~*req.8:"]}, // {"tag": "ActionTTL", "path": "Actions[<~*req.8>].TTL", "type": "*variable", "value": "~*req.10", "filters": ["*notempty:~*req.8:"]}, // {"tag": "ActionType", "path": "Actions[<~*req.8>].Type", "type": "*variable", "value": "~*req.11", "filters": ["*notempty:~*req.8:"]}, -// {"tag": "ActionOpts", "path": "Actions[<~*req.8>].Opts", "type": "*variable", "value": "~*req.12", "filters": ["*notempty:~*req.8:"]}, -// {"tag": "ActionPath", "path": "Actions[<~*req.8>].Diktats.Path", "type": "*variable", "value": "~*req.13","new_branch":true, "filters": ["*notempty:~*req.8:"]}, -// {"tag": "ActionValue", "path": "Actions[<~*req.8>].Diktats.Value", "type": "*variable", "value": "~*req.14", "filters": ["*notempty:~*req.8:"]} -// ] +// {"tag": "ActionOpts", "path": "Actions[<~*req.8>].Opts", "type": "*variable", "value": "~*req.12", "filters": ["*notempty:~*req.8:"]}, +// {"tag": "ActionWeights", "path": "Actions[<~*req.8>].Weights", "type": "*variable", "value": "~*req.13", "filters": ["*notempty:~*req.8:"]}, +// {"tag": "ActionBlockers", "path": "Actions[<~*req.8>].Blockers", "type": "*variable", "value": "~*req.14", "filters": ["*notempty:~*req.8:"]}, +// {"tag": "ActionDiktatsID", "path": "Actions[<~*req.8>].Diktats.ID", "type": "*variable", "value": "~*req.15","new_branch":true, "filters": ["*notempty:~*req.8:"]}, +// {"tag": "ActionDiktatsFilterIDs", "path": "Actions[<~*req.8>].Diktats.FilterIDs", "type": "*variable", "value": "~*req.16", "filters": ["*notempty:~*req.8:"]}, +// {"tag": "ActionDiktatsOpts", "path": "Actions[<~*req.8>].Diktats.Opts", "type": "*variable", "value": "~*req.17", "filters": ["*notempty:~*req.8:"]}, +// {"tag": "ActionDiktatsWeights", "path": "Actions[<~*req.8>].Diktats.Weights", "type": "*variable", "value": "~*req.18", "filters": ["*notempty:~*req.8:"]}, +// {"tag": "ActionDiktatsBlockers", "path": "Actions[<~*req.8>].Diktats.Blockers", "type": "*variable", "value": "~*req.19", "filters": ["*notempty:~*req.8:"]}, +// ] // }, // { // "type": "*accounts", // data source type diff --git a/data/conf/samples/export_it_test_mongo/cgrates.json b/data/conf/samples/export_it_test_mongo/cgrates.json index ebd1d9bb5..d7ecbc103 100644 --- a/data/conf/samples/export_it_test_mongo/cgrates.json +++ b/data/conf/samples/export_it_test_mongo/cgrates.json @@ -322,8 +322,13 @@ {"tag": "ActionTTL", "path": "Actions[<~*req.8>].TTL", "type": "*variable", "value": "~*req.10", "filters": ["*notempty:~*req.8:"]}, {"tag": "ActionType", "path": "Actions[<~*req.8>].Type", "type": "*variable", "value": "~*req.11", "filters": ["*notempty:~*req.8:"]}, {"tag": "ActionOpts", "path": "Actions[<~*req.8>].Opts", "type": "*variable", "value": "~*req.12", "filters": ["*notempty:~*req.8:"]}, - {"tag": "ActionPath", "path": "Actions[<~*req.8>].Diktats.Path", "type": "*variable", "value": "~*req.13","new_branch":true, "filters": ["*notempty:~*req.8:"]}, - {"tag": "ActionValue", "path": "Actions[<~*req.8>].Diktats.Value", "type": "*variable", "value": "~*req.14", "filters": ["*notempty:~*req.8:"]}, + {"tag": "ActionWeights", "path": "Actions[<~*req.8>].Weights", "type": "*variable", "value": "~*req.13", "filters": ["*notempty:~*req.8:"]}, + {"tag": "ActionBlockers", "path": "Actions[<~*req.8>].Blockers", "type": "*variable", "value": "~*req.14", "filters": ["*notempty:~*req.8:"]}, + {"tag": "ActionDiktatsID", "path": "Actions[<~*req.8>].Diktats.ID", "type": "*variable", "value": "~*req.15","new_branch":true, "filters": ["*notempty:~*req.8:"]}, + {"tag": "ActionDiktatsFilterIDs", "path": "Actions[<~*req.8>].Diktats.FilterIDs", "type": "*variable", "value": "~*req.16", "filters": ["*notempty:~*req.8:"]}, + {"tag": "ActionDiktatsOpts", "path": "Actions[<~*req.8>].Diktats.Opts", "type": "*variable", "value": "~*req.17", "filters": ["*notempty:~*req.8:"]}, + {"tag": "ActionDiktatsWeights", "path": "Actions[<~*req.8>].Diktats.Weights", "type": "*variable", "value": "~*req.18", "filters": ["*notempty:~*req.8:"]}, + {"tag": "ActionDiktatsBlockers", "path": "Actions[<~*req.8>].Diktats.Blockers", "type": "*variable", "value": "~*req.19", "filters": ["*notempty:~*req.8:"]}, ], }, { diff --git a/data/conf/samples/preload_internal/cgrates.json b/data/conf/samples/preload_internal/cgrates.json index b8268bfa8..f40023d38 100644 --- a/data/conf/samples/preload_internal/cgrates.json +++ b/data/conf/samples/preload_internal/cgrates.json @@ -119,8 +119,13 @@ {"tag": "ActionTTL", "path": "Actions[<~*req.8>].TTL", "type": "*variable", "value": "~*req.10", "filters": ["*notempty:~*req.8:"]}, {"tag": "ActionType", "path": "Actions[<~*req.8>].Type", "type": "*variable", "value": "~*req.11", "filters": ["*notempty:~*req.8:"]}, {"tag": "ActionOpts", "path": "Actions[<~*req.8>].Opts", "type": "*variable", "value": "~*req.12", "filters": ["*notempty:~*req.8:"]}, - {"tag": "ActionPath", "path": "Actions[<~*req.8>].Diktats.Path", "type": "*variable", "value": "~*req.13","new_branch":true, "filters": ["*notempty:~*req.8:"]}, - {"tag": "ActionValue", "path": "Actions[<~*req.8>].Diktats.Value", "type": "*variable", "value": "~*req.14", "filters": ["*notempty:~*req.8:"]}, + {"tag": "ActionWeights", "path": "Actions[<~*req.8>].Weights", "type": "*variable", "value": "~*req.13", "filters": ["*notempty:~*req.8:"]}, + {"tag": "ActionBlockers", "path": "Actions[<~*req.8>].Blockers", "type": "*variable", "value": "~*req.14", "filters": ["*notempty:~*req.8:"]}, + {"tag": "ActionDiktatsID", "path": "Actions[<~*req.8>].Diktats.ID", "type": "*variable", "value": "~*req.15","new_branch":true, "filters": ["*notempty:~*req.8:"]}, + {"tag": "ActionDiktatsFilterIDs", "path": "Actions[<~*req.8>].Diktats.FilterIDs", "type": "*variable", "value": "~*req.16", "filters": ["*notempty:~*req.8:"]}, + {"tag": "ActionDiktatsOpts", "path": "Actions[<~*req.8>].Diktats.Opts", "type": "*variable", "value": "~*req.17", "filters": ["*notempty:~*req.8:"]}, + {"tag": "ActionDiktatsWeights", "path": "Actions[<~*req.8>].Diktats.Weights", "type": "*variable", "value": "~*req.18", "filters": ["*notempty:~*req.8:"]}, + {"tag": "ActionDiktatsBlockers", "path": "Actions[<~*req.8>].Diktats.Blockers", "type": "*variable", "value": "~*req.19", "filters": ["*notempty:~*req.8:"]}, ], }, ], diff --git a/data/tariffplans/loadRateTest/Actions.csv b/data/tariffplans/loadRateTest/Actions.csv index df78d9740..fad28f733 100644 --- a/data/tariffplans/loadRateTest/Actions.csv +++ b/data/tariffplans/loadRateTest/Actions.csv @@ -1,8 +1,8 @@ -#Tenant,ID,FilterIDs,Weights,Blocker,Schedule,TargetType,TargetIDs,ActionID,ActionFilterIDs,ActionTTL,ActionType,ActionOpts,ActionPath,ActionValue -cgrates.org,ONE_TIME_ACT,,;10,,*asap,*accounts,1001;1002,TOPUP,,0s,*add_balance,,*balance.TestBalance.Units,10 -cgrates.org,ONE_TIME_ACT,,,,,,,SET_BALANCE_TEST_DATA,,0s,*set_balance,,*balance.TestDataBalance.Type,*data -cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_TEST_DATA,,0s,*add_balance,,*balance.TestDataBalance.Units,1024 -cgrates.org,ONE_TIME_ACT,,,,,,,SET_BALANCE_TEST_VOICE,,0s,*set_balance,,*balance.TestVoiceBalance.Type,*voice -cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_TEST_VOICE,,0s,*add_balance,,*balance.TestVoiceBalance.Units,15m15s -cgrates.org,ONE_TIME_ACT,,,,,,,SET_BALANCE_TEST_FILTERS,,0s,*set_balance,,*balance.TestVoiceBalance.Filters,*string:~*req.CustomField:500 -cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_REM_VOICE,,0s,*rem_balance,,TestVoiceBalance2, \ No newline at end of file +#Tenant,ID,FilterIDs,Weights,Blockers,Schedule,TargetType,TargetIDs,ActionID,ActionFilterIDs,ActionTTL,ActionType,ActionOpts,ActionWeights,ActionBlockers,ActionDiktatsID,ActionDiktatsFilterIDs,ActionDiktatsOpts,ActionDiktatsWeights,ActionDiktatsBlockers +cgrates.org,ONE_TIME_ACT,,;10,,*asap,*accounts,1001;1002,TOPUP,,0s,*add_balance,,,,ADDBALUNITS,,*balancePath:*balance.TestBalance.Units:*balanceValue:10,, +cgrates.org,ONE_TIME_ACT,,,,,,,SET_BALANCE_TEST_DATA,,0s,*set_balance,,,,SETBALTYPE,,*balancePath:*balance.TestDataBalance.Type;*balanceValue:*data,, +cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_TEST_DATA,,0s,*add_balance,,,,ADDBALUNITS,,*balancePath:*balance.TestDataBalance.Units;*balanceValue:1024,, +cgrates.org,ONE_TIME_ACT,,,,,,,SET_BALANCE_TEST_VOICE,,0s,*set_balance,,,,SETBALTYPE,,*balancePath:*balance.TestVoiceBalance.Type;*balanceValue:*voice,, +cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_TEST_VOICE,,0s,*add_balance,,,,ADDBALUNITS,,*balancePath:*balance.TestVoiceBalance.Units;*balanceValue:15m15s,, +cgrates.org,ONE_TIME_ACT,,,,,,,SET_BALANCE_TEST_FILTERS,,0s,*set_balance,,,,SETBALFILTER,,*balancePath:*balance.TestVoiceBalance.Filters;*balanceValue:*string:~*req.CustomField:500,, +cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_REM_VOICE,,0s,*rem_balance,,,,REMBAL,,*balancePath:TestVoiceBalance2,, \ No newline at end of file diff --git a/data/tariffplans/testit/Actions.csv b/data/tariffplans/testit/Actions.csv index 4eec7405c..150dcb4b0 100644 --- a/data/tariffplans/testit/Actions.csv +++ b/data/tariffplans/testit/Actions.csv @@ -1,8 +1,8 @@ -#Tenant,ID,FilterIDs,Weights,Blockers,Schedule,TargetType,TargetIDs,ActionID,ActionFilterIDs,ActionTTL,ActionType,ActionOpts,ActionPath,ActionValue -cgrates.org,ONE_TIME_ACT,,;10,,*asap,*accounts,1001;1002,TOPUP,,0s,*add_balance,,*balance.TestBalance.Units,10 -cgrates.org,ONE_TIME_ACT,,,,,,,SET_BALANCE_TEST_DATA,,0s,*set_balance,,*balance.TestDataBalance.Type,*data -cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_TEST_DATA,,0s,*add_balance,,*balance.TestDataBalance.Units,1024 -cgrates.org,ONE_TIME_ACT,,,,,,,SET_BALANCE_TEST_VOICE,,0s,*set_balance,,*balance.TestVoiceBalance.Type,*voice -cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_TEST_VOICE,,0s,*add_balance,,*balance.TestVoiceBalance.Units,15m15s -cgrates.org,ONE_TIME_ACT,,,,,,,SET_BALANCE_TEST_FILTERS,,0s,*set_balance,,*balance.TestVoiceBalance.Filters,*string:~*req.CustomField:500 -cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_REM_VOICE,,0s,*rem_balance,,TestVoiceBalance2, \ No newline at end of file +#Tenant,ID,FilterIDs,Weights,Blockers,Schedule,TargetType,TargetIDs,ActionID,ActionFilterIDs,ActionTTL,ActionType,ActionOpts,ActionWeights,ActionBlockers,ActionDiktatsID,ActionDiktatsFilterIDs,ActionDiktatsOpts,ActionDiktatsWeights,ActionDiktatsBlockers +cgrates.org,ONE_TIME_ACT,,;10,,*asap,*accounts,1001;1002,TOPUP,,0s,*add_balance,,,,ADDBALUNITS,,*balancePath:*balance.TestBalance.Units;*balanceValue:10,, +cgrates.org,ONE_TIME_ACT,,,,,,,SET_BALANCE_TEST_DATA,,0s,*set_balance,,,,SETBALTYPE,,*balancePath:*balance.TestDataBalance.Type;*balanceValue:*data,, +cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_TEST_DATA,,0s,*add_balance,,,,ADDBALUNITS,,*balancePath:*balance.TestDataBalance.Units;*balanceValue:1024,, +cgrates.org,ONE_TIME_ACT,,,,,,,SET_BALANCE_TEST_VOICE,,0s,*set_balance,,,,SETBALTYPE,,*balancePath:*balance.TestVoiceBalance.Type;*balanceValue:*voice,, +cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_TEST_VOICE,,0s,*add_balance,,,,ADDBALUNITS,,*balancePath:*balance.TestVoiceBalance.Units;*balanceValue:15m15s,, +cgrates.org,ONE_TIME_ACT,,,,,,,SET_BALANCE_TEST_FILTERS,,0s,*set_balance,,,,SETBALFILTER,,*balancePath:*balance.TestVoiceBalance.Filters;*balanceValue:*string:~*req.CustomField:500,, +cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_REM_VOICE,,0s,*rem_balance,,,,REMBAL,,*balancePath:TestVoiceBalance2,, \ No newline at end of file diff --git a/data/tariffplans/testit/Filters.csv b/data/tariffplans/testit/Filters.csv index e32a42303..f33b4d174 100644 --- a/data/tariffplans/testit/Filters.csv +++ b/data/tariffplans/testit/Filters.csv @@ -26,4 +26,4 @@ cgrates.org,FLTR_QOS_SP2_2,*gte,~*vars.Cost,0.2 cgrates.org,FLTR_TEST,*string,~*req.Subject,TEST cgrates.org,FLTR_SPP_LOAD_DIST,*string,~*req.DistinctMatch,LoadDistStrategy cgrates.org,FLTR_DST_DE,*prefix,~*req.Destination,+49151 -cgrates.new,FLTR_1,*prefix,~*req.Destination,207;1207;+1207 +cgrates.new,FLTR_1,*prefix,~*req.Destination,207;1207;+1207 \ No newline at end of file diff --git a/data/tariffplans/tutactions/Actions.csv b/data/tariffplans/tutactions/Actions.csv index 09b14ea67..c9e30a9eb 100644 --- a/data/tariffplans/tutactions/Actions.csv +++ b/data/tariffplans/tutactions/Actions.csv @@ -1,8 +1,8 @@ -#Tenant,ID,FilterIDs,Weights,Blockers,Schedule,TargetType,TargetIDs,ActionID,ActionFilterIDs,ActionTTL,ActionType,ActionOpts,ActionPath,ActionValue -cgrates.org,ONE_TIME_ACT,,;10,,*asap,*accounts,1001;1002,TOPUP,,0s,*add_balance,,*balance.TestBalance.Units,10 -cgrates.org,ONE_TIME_ACT,,,,,,,SET_BALANCE_TEST_DATA,,0s,*set_balance,,*balance.TestDataBalance.Type,*data -cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_TEST_DATA,,0s,*add_balance,,*balance.TestDataBalance.Units,1024 -cgrates.org,ONE_TIME_ACT,,,,,,,SET_BALANCE_TEST_VOICE,,0s,*set_balance,,*balance.TestVoiceBalance.Type,*voice -cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_TEST_VOICE,,0s,*add_balance,,*balance.TestVoiceBalance.Units,15m15s -cgrates.org,ONE_TIME_ACT,,,,,,,SET_BALANCE_TEST_FILTERS,,0s,*set_balance,,*balance.TestVoiceBalance.Filters,*string:~*req.CustomField:500 -cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_REM_VOICE,,0s,*rem_balance,,TestVoiceBalance2, +#Tenant,ID,FilterIDs,Weights,Blockers,Schedule,TargetType,TargetIDs,ActionID,ActionFilterIDs,ActionTTL,ActionType,ActionOpts,ActionWeights,ActionBlockers,ActionDiktatsID,ActionDiktatsFilterIDs,ActionDiktatsOpts,ActionDiktatsWeights,ActionDiktatsBlockers +cgrates.org,ONE_TIME_ACT,,;10,,*asap,*accounts,1001;1002,TOPUP,,0s,*add_balance,,,,ADDBALUNITS,,*balancePath:*balance.TestBalance.Units:*balanceValue:10,, +cgrates.org,ONE_TIME_ACT,,,,,,,SET_BALANCE_TEST_DATA,,0s,*set_balance,,,,SETBALTYPE,,*balancePath:*balance.TestDataBalance.Type;*balanceValue:*data,, +cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_TEST_DATA,,0s,*add_balance,,,,ADDBALUNITS,,*balancePath:*balance.TestDataBalance.Units;*balanceValue:1024,, +cgrates.org,ONE_TIME_ACT,,,,,,,SET_BALANCE_TEST_VOICE,,0s,*set_balance,,,,SETBALTYPE,,*balancePath:*balance.TestVoiceBalance.Type;*balanceValue:*voice,, +cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_TEST_VOICE,,0s,*add_balance,,,,ADDBALUNITS,,*balancePath:*balance.TestVoiceBalance.Units;*balanceValue:15m15s,, +cgrates.org,ONE_TIME_ACT,,,,,,,SET_BALANCE_TEST_FILTERS,,0s,*set_balance,,,,SETBALFILTER,,*balancePath:*balance.TestVoiceBalance.Filters;*balanceValue:*string:~*req.CustomField:500,, +cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_REM_VOICE,,0s,*rem_balance,,,,REMBAL,,*balancePath:TestVoiceBalance2,, diff --git a/data/tariffplans/tutroutes/Actions.csv b/data/tariffplans/tutroutes/Actions.csv index a969629fa..70c982932 100644 --- a/data/tariffplans/tutroutes/Actions.csv +++ b/data/tariffplans/tutroutes/Actions.csv @@ -1,7 +1,7 @@ -#Tenant,ID,FilterIDs,Weights,Blockers,Schedule,TargetType,TargetIDs,ActionID,ActionFilterIDs,ActionTTL,ActionType,ActionOpts,ActionPath,ActionValue +#Tenant,ID,FilterIDs,Weights,Blockers,Schedule,TargetType,TargetIDs,ActionID,ActionFilterIDs,ActionTTL,ActionType,ActionOpts,ActionWeights,ActionBlockers,ActionDiktatsID,ActionDiktatsFilterIDs,ActionDiktatsOpts,ActionDiktatsWeights,ActionDiktatsBlockers # TOPUP_RST_MONETARY_10 resets the <*default> <*monetary> balance to 10 units -#cgrates.org,TOPUP_RST_MONETARY_10,,;10,,*asap,*accounts,1001,TOPUP,,0s,*add_balance,,;10,;false,*asap,,,,,,10,10,,,10 +#cgrates.org,TOPUP_RST_MONETARY_10,,;10,,*asap,*accounts,1001,TOPUP,,0s,*add_balance,,;10,;false,*asap,,,,,,10,10,,,,ADDBAL,,*balanceValue:10,, -cgrates.org,TOPUP_RST_MONETARY_10,,;10,,*asap,*accounts,1001,TOPUP,,0s,*add_balance,,*balance.Concrete1.Units,10 +cgrates.org,TOPUP_RST_MONETARY_10,,;10,,*asap,*accounts,1001,TOPUP,,0s,*add_balance,,,,ADDBALUNITS,,*balancePath:*balance.Concrete1.Units;*balanceValue:10,, diff --git a/engine/libtest.go b/engine/libtest.go index e96b3e2d4..b2ecaa1e5 100644 --- a/engine/libtest.go +++ b/engine/libtest.go @@ -552,6 +552,7 @@ func startEngine(t testing.TB, cfg *config.CGRConfig, logBuffer io.Writer, grace } if err := engine.Wait(); err != nil { t.Errorf("cgr-engine process failed to exit cleanly: %v", err) + t.Log("Logs: \n", logBuffer) } } else { if err := engine.Process.Kill(); err != nil { diff --git a/engine/loader_csv_test.go b/engine/loader_csv_test.go index f16c73339..690e23c74 100644 --- a/engine/loader_csv_test.go +++ b/engine/loader_csv_test.go @@ -149,13 +149,13 @@ cgrates.org,RP1,,,,,,RT_WEEKEND,,"* * * * 0,6",;10,false,0s,0.089,0.06,1m,1s cgrates.org,RP1,,,,,,RT_CHRISTMAS,,* * 24 12 *,;30,false,0s,0.0564,0.06,1m,1s ` ActionProfileCSVContent := ` -#Tenant,ID,FilterIDs,Weights,Blockers,Schedule,TargetType,TargetIDs,ActionID,ActionFilterIDs,ActionTTL,ActionType,ActionOpts,ActionPath,ActionValue -cgrates.org,ONE_TIME_ACT,,;10,,*asap,*accounts,1001;1002,TOPUP,,0s,*add_balance,,*balance.TestBalance.Value,10 -cgrates.org,ONE_TIME_ACT,,,,,,,SET_BALANCE_TEST_DATA,,0s,*set_balance,,*balance.TestDataBalance.Type,*data -cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_TEST_DATA,,0s,*add_balance,,*balance.TestDataBalance.Value,1024 -cgrates.org,ONE_TIME_ACT,,,,,,,SET_BALANCE_TEST_VOICE,,0s,*set_balance,,*balance.TestVoiceBalance.Type,*voice -cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_TEST_VOICE,,0s,*add_balance,,*balance.TestVoiceBalance.Value,15m15s -cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_TEST_VOICE,,0s,*add_balance,,*balance.TestVoiceBalance2.Value,15m15s +#Tenant,ID,FilterIDs,Weights,Blockers,Schedule,TargetType,TargetIDs,ActionID,ActionFilterIDs,ActionTTL,ActionType,ActionOpts,ActionWeights,ActionBlockers,ActionDiktatsID,ActionDiktatsFilterIDs,ActionDiktatsOpts,ActionDiktatsWeights,ActionDiktatsBlockers +cgrates.org,ONE_TIME_ACT,,;10,,*asap,*accounts,1001;1002,TOPUP,,0s,*add_balance,,,,ADDBALVALUE,,*balancePath:*balance.TestBalance.Value;*balanceValue:10,, +cgrates.org,ONE_TIME_ACT,,,,,,,SET_BALANCE_TEST_DATA,,0s,*set_balance,,,,SETBALTYPE,,*balancePath:*balance.TestDataBalance.Type;*balanceValue:*data,, +cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_TEST_DATA,,0s,*add_balance,,,,ADDBALVALUE,,*balancePath:*balance.TestDataBalance.Value;*balanceValue:1024,, +cgrates.org,ONE_TIME_ACT,,,,,,,SET_BALANCE_TEST_VOICE,,0s,*set_balance,,,,SETBALTYPE,,*balancePath:*balance.TestVoiceBalance.Type;*balanceValue:*voice,, +cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_TEST_VOICE,,0s,*add_balance,,,,ADDBALVALUE1,,*balancePath:*balance.TestVoiceBalance.Value;*balanceValue:15m15s,, +cgrates.org,ONE_TIME_ACT,,,,,,,TOPUP_TEST_VOICE,,0s,*add_balance,,,,ADDBALVALUE2,,*balancePath:*balance.TestVoiceBalance2.Value;*balanceValue:15m15s,, ` AccountCSVContent := ` @@ -671,8 +671,8 @@ cgrates.org,1001,,,,,VoiceBalance,,;10,*string:~*req.Destination:1002;true;;fals TTL: "0s", Type: "*add_balance", Diktats: []*utils.TPAPDiktat{{ - Path: "*balance.TestBalance.Value", - Value: "10", + ID: "ADDBALVALUE", + Opts: "*balancePath:*balance.TestBalance.Value;*balanceValue:10", }}, }, { @@ -680,8 +680,8 @@ cgrates.org,1001,,,,,VoiceBalance,,;10,*string:~*req.Destination:1002;true;;fals TTL: "0s", Type: "*set_balance", Diktats: []*utils.TPAPDiktat{{ - Path: "*balance.TestDataBalance.Type", - Value: "*data", + ID: "SETBALTYPE", + Opts: "*balancePath:*balance.TestDataBalance.Type;*balanceValue:*data", }}, }, { @@ -689,8 +689,8 @@ cgrates.org,1001,,,,,VoiceBalance,,;10,*string:~*req.Destination:1002;true;;fals TTL: "0s", Type: "*add_balance", Diktats: []*utils.TPAPDiktat{{ - Path: "*balance.TestDataBalance.Value", - Value: "1024", + ID: "ADDBALVALUE", + Opts: "*balancePath:*balance.TestDataBalance.Value;*balanceValue:1024", }}, }, { @@ -698,8 +698,8 @@ cgrates.org,1001,,,,,VoiceBalance,,;10,*string:~*req.Destination:1002;true;;fals TTL: "0s", Type: "*set_balance", Diktats: []*utils.TPAPDiktat{{ - Path: "*balance.TestVoiceBalance.Type", - Value: "*voice", + ID: "SETBALTYPE", + Opts: "*balancePath:*balance.TestVoiceBalance.Type;*balanceValue:*voice", }}, }, { @@ -707,11 +707,11 @@ cgrates.org,1001,,,,,VoiceBalance,,;10,*string:~*req.Destination:1002;true;;fals TTL: "0s", Type: "*add_balance", Diktats: []*utils.TPAPDiktat{{ - Path: "*balance.TestVoiceBalance.Value", - Value: "15m15s", + ID: "ADDBALVALUE1", + Opts: "*balancePath:*balance.TestVoiceBalance.Value;*balanceValue:15m15s", }, { - Path: "*balance.TestVoiceBalance2.Value", - Value: "15m15s", + ID: "ADDBALVALUE2", + Opts: "*balancePath:*balance.TestVoiceBalance2.Value;*balanceValue:15m15s", }}, }, }, diff --git a/engine/model_helpers_test.go b/engine/model_helpers_test.go index 850e58975..54bd7c074 100644 --- a/engine/model_helpers_test.go +++ b/engine/model_helpers_test.go @@ -3148,7 +3148,9 @@ func TestActionProfileMdlsCSVHeader(t *testing.T) { expStruct := []string{"#" + utils.Tenant, utils.ID, utils.FilterIDs, utils.Weights, utils.Blockers, utils.Schedule, utils.TargetType, utils.TargetIDs, utils.ActionID, utils.ActionFilterIDs, utils.ActionTTL, - utils.ActionType, utils.ActionOpts, utils.ActionPath, utils.ActionValue, + utils.ActionType, utils.ActionOpts, utils.ActionWeights, utils.ActionBlockers, + utils.ActionDiktatsID, utils.ActionDiktatsFilterIDs, utils.ActionDiktatsOpts, + utils.ActionDiktatsWeights, utils.ActionDiktatsBlockers, } result := testStruct.CSVHeader() if !reflect.DeepEqual(result, expStruct) { @@ -3314,7 +3316,8 @@ func TestModelHelpersAPItoActionProfile(t *testing.T) { ID: "test_action_id", FilterIDs: []string{"test_action_filter_id1", "test_action_filter_id2"}, Diktats: []*utils.TPAPDiktat{{ - Path: "test_path", + ID: "actDiktatID", + Opts: "*balancePath:test_path", }}, Opts: "key1:val1;key2:val2", }, @@ -3340,7 +3343,10 @@ func TestModelHelpersAPItoActionProfile(t *testing.T) { ID: "test_action_id", FilterIDs: []string{"test_action_filter_id1", "test_action_filter_id2"}, Diktats: []*utils.APDiktat{{ - Path: "test_path", + ID: "actDiktatID", + Opts: map[string]any{ + "*balancePath": "test_path", + }, }}, Opts: map[string]any{ "key1": "val1", @@ -3349,7 +3355,10 @@ func TestModelHelpersAPItoActionProfile(t *testing.T) { }, }, } - result, _ := APItoActionProfile(testStruct, "") + result, err := APItoActionProfile(testStruct, "") + if err != nil { + t.Fatal(err) + } sort.Strings(result.FilterIDs) if !reflect.DeepEqual(result, expStruct) { t.Errorf("\nExpecting <%+v>,\n Received <%+v>", utils.ToJSON(expStruct), utils.ToJSON(result)) @@ -3369,7 +3378,8 @@ func TestModelHelpersAPItoActionProfileError3(t *testing.T) { ID: "test_action_id", FilterIDs: []string{"test_action_filter_id1", "test_action_filter_id2"}, Diktats: []*utils.TPAPDiktat{{ - Path: "test_path", + ID: "actDiktatID", + Opts: "*balancePath:test_path", }}, TTL: "cat", }, @@ -3394,7 +3404,8 @@ func TestModelHelpersAPItoActionProfileError4(t *testing.T) { ID: "test_action_id", FilterIDs: []string{"test_action_filter_id1", "test_action_filter_id2"}, Diktats: []*utils.TPAPDiktat{{ - Path: "test_path", + ID: "actDiktatID", + Opts: "*balancePath:test_path", }}, Opts: "test_opt", }, @@ -3424,7 +3435,9 @@ func TestModelHelpersActionProfileToAPI(t *testing.T) { FilterIDs: []string{"test_action_filter_id1", "test_action_filter_id2"}, TTL: time.Second, Diktats: []*utils.APDiktat{{ - Path: "test_path", + Opts: map[string]any{ + "*balancePath": "test_path", + }, }}, Opts: map[string]any{ "key1": "val1", @@ -3445,7 +3458,7 @@ func TestModelHelpersActionProfileToAPI(t *testing.T) { FilterIDs: []string{"test_action_filter_id1", "test_action_filter_id2"}, TTL: "1s", Diktats: []*utils.TPAPDiktat{{ - Path: "test_path", + Opts: "*balancePath:test_path", }}, Opts: "key1:val1", }, @@ -4462,7 +4475,8 @@ func TestModelHelpersActionProfileToAPICase2(t *testing.T) { ID: "test_action_id", FilterIDs: []string{"test_action_filter_id1"}, Diktats: []*utils.TPAPDiktat{{ - Path: "test_path", + ID: "actDiktatID", + Opts: "*balancePath:test_path", }}, Opts: "key1:val1", }, @@ -4486,7 +4500,8 @@ func TestModelHelpersActionProfileToAPICase2(t *testing.T) { ID: "test_action_id", FilterIDs: []string{"test_action_filter_id1"}, Diktats: []*utils.TPAPDiktat{{ - Path: "test_path", + ID: "actDiktatID", + Opts: "*balancePath:test_path", }}, Opts: "key1:val1", TTL: "0s", @@ -4496,7 +4511,7 @@ func TestModelHelpersActionProfileToAPICase2(t *testing.T) { result, err := APItoActionProfile(testStruct, "") if err != nil { - t.Errorf("\nExpecting ,\n Received <%+v>", err) + t.Fatalf("\nExpecting ,\n Received <%+v>", err) } result2 := ActionProfileToAPI(result) sort.Strings(result2.FilterIDs) @@ -4778,7 +4793,7 @@ func TestAPItoActionProfileNewDynamicWeightsFromStringErr(t *testing.T) { ID: "test_action_id", FilterIDs: []string{"test_action_filter_id1"}, Diktats: []*utils.TPAPDiktat{{ - Path: "test_path", + Opts: "*balancePath:test_path", }}, Opts: "key1:val1", }, @@ -4811,7 +4826,7 @@ func TestAPItoActionProfileNewDynamicBlockersFromStringErr(t *testing.T) { ID: "test_action_id", FilterIDs: []string{"test_action_filter_id1"}, Diktats: []*utils.TPAPDiktat{{ - Path: "test_path", + Opts: "*balancePath:test_path", }}, Opts: "key1:val1", }, @@ -4845,24 +4860,21 @@ func TestAPItoModelTPActionProfileActionProfileMdl(t *testing.T) { FilterIDs: []string{"test_action_filter_id1", "test_action_filter_id2"}, Diktats: []*utils.TPAPDiktat{ { - Path: "*balance.AbstractBalance1.Units", - Value: "10", + Opts: "*balancePath:*balance.AbstractBalance1.Units;*balanceValue:10", }, { - Path: "*balance.AbstractBalance1.Units", - Value: "5", + Opts: "*balancePath:*balance.AbstractBalance1.Units;*balanceValue:5", }}, }, }, } expStruct := ActionProfileMdls{{ - Tpid: "test_id", - Tenant: "cgrates.org", - ID: "RP1", - ActionID: "test_action_id", - ActionPath: "*balance.AbstractBalance1.Units", - ActionValue: "5", + Tpid: "test_id", + Tenant: "cgrates.org", + ID: "RP1", + ActionID: "test_action_id", + ActionDiktatsOpts: "*balancePath:*balance.AbstractBalance1.Units;*balanceValue:5", }} result := APItoModelTPActionProfile(testStruct) if !reflect.DeepEqual(result, expStruct) { diff --git a/engine/models_test.go b/engine/models_test.go index f70a6137b..7d1a6a759 100644 --- a/engine/models_test.go +++ b/engine/models_test.go @@ -320,24 +320,29 @@ func TestRateProfileMdlTableName(t *testing.T) { } func TestActionProfileMdlTableName(t *testing.T) { model := ActionProfileMdl{ - PK: 2, - Tpid: "tpid", - Tenant: "tenant", - ID: "id", - FilterIDs: "testFiltrIds", - Weights: "testWeights", - Blockers: "testBlockers", - Schedule: "testSchedule", - TargetType: "testTargetType", - TargetIDs: "testTargetIds", - ActionID: "testActionId", - ActionFilterIDs: "testActionFltrIds", - ActionTTL: "testActionTTL", - ActionType: "testActionType", - ActionOpts: "testActionOpts", - ActionPath: "testActionPath", - ActionValue: "testActionValue", - CreatedAt: time.Now(), + PK: 2, + Tpid: "tpid", + Tenant: "tenant", + ID: "id", + FilterIDs: "testFiltrIds", + Weights: "testWeights", + Blockers: "testBlockers", + Schedule: "testSchedule", + TargetType: "testTargetType", + TargetIDs: "testTargetIds", + ActionID: "testActionId", + ActionFilterIDs: "testActionFltrIds", + ActionTTL: "testActionTTL", + ActionType: "testActionType", + ActionOpts: "testActionOpts", + ActionWeights: "testActionWeights", + ActionBlockers: "testActionBlockers", + ActionDiktatsID: "testActionDiktatsID", + ActionDiktatsFilterIDs: "testActionDiktatsFilterIDs", + ActionDiktatsOpts: "testActionDiktatsOpts", + ActionDiktatsWeights: "testActionDiktatsWeights", + ActionDiktatsBlockers: "testActionDiktatsBlockers", + CreatedAt: time.Now(), } rcv := model.TableName() if !reflect.DeepEqual(rcv, utils.TBLTPActionProfiles) { diff --git a/engine/z_onstor_it_test.go b/engine/z_onstor_it_test.go index be98611a9..ea1d289d8 100644 --- a/engine/z_onstor_it_test.go +++ b/engine/z_onstor_it_test.go @@ -1066,7 +1066,9 @@ func testOnStorITActionProfile(t *testing.T) { FilterIDs: []string{}, Type: "*topup", Diktats: []*utils.APDiktat{{ - Path: "~*balance.TestBalance.Value", + Opts: map[string]any{ + "*balancePath": "~*balance.TestBalance.Value", + }, }}, }, { @@ -1074,7 +1076,9 @@ func testOnStorITActionProfile(t *testing.T) { FilterIDs: []string{}, Type: "*topup", Diktats: []*utils.APDiktat{{ - Path: "~*balance.TestVoiceBalance.Value", + Opts: map[string]any{ + "*balancePath": "~*balance.TestVoiceBalance.Value", + }, }}, }, }, diff --git a/general_tests/accountactions_it_test.go b/general_tests/accountactions_it_test.go index 691fdcab7..bca9c05dc 100644 --- a/general_tests/accountactions_it_test.go +++ b/general_tests/accountactions_it_test.go @@ -126,24 +126,39 @@ func testAccActionsSetActionProfile(t *testing.T) { Type: utils.MetaSetBalance, Diktats: []*utils.APDiktat{ { - Path: "*account.ThresholdIDs", - Value: utils.MetaNone, + ID: "SetAccThresholds", + Opts: map[string]any{ + "*balancePath": "*account.ThresholdIDs", + "*balanceValue": utils.MetaNone, + }, }, { - Path: "*balance.MONETARY.Type", - Value: utils.MetaConcrete, + ID: "SetBalMonetaryType", + Opts: map[string]any{ + "*balancePath": "*balance.MONETARY.Type", + "*balanceValue": utils.MetaConcrete, + }, }, { - Path: "*balance.MONETARY.Units", - Value: "1048576", + ID: "SetBalMonetaryUnits", + Opts: map[string]any{ + "*balancePath": "*balance.MONETARY.Units", + "*balanceValue": "1048576", + }, }, { - Path: "*balance.MONETARY.Weights", - Value: "`;0`", + ID: "SetBalMonetaryWeights", + Opts: map[string]any{ + "*balancePath": "*balance.MONETARY.Weights", + "*balanceValue": "`;0`", + }, }, { - Path: "*balance.MONETARY.CostIncrements", - Value: "`*string:~*req.ToR:*data;1024;0;0.01`", + ID: "SetBalMonetaryCostIncrements", + Opts: map[string]any{ + "*balancePath": "*balance.MONETARY.CostIncrements", + "*balanceValue": "`*string:~*req.ToR:*data;1024;0;0.01`", + }, }, }, }, @@ -153,24 +168,39 @@ func testAccActionsSetActionProfile(t *testing.T) { Type: utils.MetaAddBalance, Diktats: []*utils.APDiktat{ { - Path: "*balance.VOICE.Type", - Value: utils.MetaAbstract, + ID: "AddBalVoiceType", + Opts: map[string]any{ + "*balancePath": "*balance.VOICE.Type", + "*balanceValue": utils.MetaAbstract, + }, }, { - Path: "*balance.VOICE.Units", - Value: strconv.FormatInt((3 * time.Hour).Nanoseconds(), 10), + ID: "AddBalVoiceUnits", + Opts: map[string]any{ + "*balancePath": "*balance.VOICE.Units", + "*balanceValue": strconv.FormatInt((3 * time.Hour).Nanoseconds(), 10), + }, }, { - Path: "*balance.VOICE.FilterIDs", - Value: "`*string:~*req.ToR:*voice`", + ID: "AddBalVoiceFilters", + Opts: map[string]any{ + "*balancePath": "*balance.VOICE.FilterIDs", + "*balanceValue": "`*string:~*req.ToR:*voice`", + }, }, { - Path: "*balance.VOICE.Weights", - Value: "`;2`", + ID: "AddBalVoiceWeights", + Opts: map[string]any{ + "*balancePath": "*balance.VOICE.Weights", + "*balanceValue": "`;2`", + }, }, { - Path: "*balance.VOICE.CostIncrements", - Value: "`*string:~*req.ToR:*voice;1000000000;0;0.01`", + ID: "AddBalVoiceCostIncrements", + Opts: map[string]any{ + "*balancePath": "*balance.VOICE.CostIncrements", + "*balanceValue": "`*string:~*req.ToR:*voice;1000000000;0;0.01`", + }, }, }, }, @@ -291,10 +321,16 @@ func testAccActionsSetActionProfile2(t *testing.T) { Type: utils.MetaRemBalance, Diktats: []*utils.APDiktat{ { - Path: "MONETARY", + ID: "RemBalMonetary", + Opts: map[string]any{ + "*balancePath": "MONETARY", + }, }, { - Path: "VOICE", + ID: "RemBalVoice", + Opts: map[string]any{ + "*balancePath": "VOICE", + }, }, }, }, diff --git a/general_tests/all_cfg_rld_it_test.go b/general_tests/all_cfg_rld_it_test.go index 0aa90d5e4..7429d6db2 100644 --- a/general_tests/all_cfg_rld_it_test.go +++ b/general_tests/all_cfg_rld_it_test.go @@ -400,8 +400,9 @@ func testConfigSReload(t *testing.T) { t.Errorf("\nExpected %+v ,\n received: %+v", cfgStr, rpl25) } - if testCfgDir == "tutinternal" { - cfgStr := `{"loaders":[{"action":"*store","cache":{"*accounts":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*action_profiles":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*attributes":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*chargers":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*filters":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*rankings":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*rate_profiles":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*resources":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*routes":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*stats":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*thresholds":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*trends":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"}},"caches_conns":["*internal"],"data":[{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"new_branch":true,"path":"Rules.Type","tag":"Type","type":"*variable","value":"~*req.2"},{"path":"Rules.Element","tag":"Element","type":"*variable","value":"~*req.3"},{"path":"Rules.Values","tag":"Values","type":"*variable","value":"~*req.4"}],"file_name":"Filters.csv","flags":null,"type":"*filters"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"TenantID","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ProfileID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"new_branch":true,"path":"Attributes.FilterIDs","tag":"AttributeFilterIDs","type":"*variable","value":"~*req.5"},{"path":"Attributes.Blockers","tag":"AttributeBlockers","type":"*variable","value":"~*req.6"},{"path":"Attributes.Path","tag":"Path","type":"*variable","value":"~*req.7"},{"path":"Attributes.Type","tag":"Type","type":"*variable","value":"~*req.8"},{"path":"Attributes.Value","tag":"Value","type":"*variable","value":"~*req.9"}],"file_name":"Attributes.csv","flags":null,"type":"*attributes"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"UsageTTL","tag":"TTL","type":"*variable","value":"~*req.4"},{"path":"Limit","tag":"Limit","type":"*variable","value":"~*req.5"},{"path":"AllocationMessage","tag":"AllocationMessage","type":"*variable","value":"~*req.6"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.7"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.8"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.9"}],"file_name":"Resources.csv","flags":null,"type":"*resources"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"QueueLength","tag":"QueueLength","type":"*variable","value":"~*req.5"},{"path":"TTL","tag":"TTL","type":"*variable","value":"~*req.6"},{"path":"MinItems","tag":"MinItems","type":"*variable","value":"~*req.7"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.8"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.9"},{"new_branch":true,"path":"Metrics.MetricID","tag":"MetricIDs","type":"*variable","value":"~*req.10"},{"path":"Metrics.FilterIDs","tag":"MetricFilterIDs","type":"*variable","value":"~*req.11"},{"path":"Metrics.Blockers","tag":"MetricBlockers","type":"*variable","value":"~*req.12"}],"file_name":"Stats.csv","flags":null,"type":"*stats"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"MaxHits","tag":"MaxHits","type":"*variable","value":"~*req.4"},{"path":"MinHits","tag":"MinHits","type":"*variable","value":"~*req.5"},{"path":"MinSleep","tag":"MinSleep","type":"*variable","value":"~*req.6"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.7"},{"path":"ActionProfileIDs","tag":"ActionProfileIDs","type":"*variable","value":"~*req.8"},{"path":"Async","tag":"Async","type":"*variable","value":"~*req.9"}],"file_name":"Thresholds.csv","flags":null,"type":"*thresholds"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.2"},{"path":"StatID","tag":"StatID","type":"*variable","value":"~*req.3"},{"path":"Metrics","tag":"Metrics","type":"*variable","value":"~*req.4"},{"path":"TTL","tag":"TTL","type":"*variable","value":"~*req.5"},{"path":"QueueLength","tag":"QueueLength","type":"*variable","value":"~*req.6"},{"path":"MinItems","tag":"MinItems","type":"*variable","value":"~*req.7"},{"path":"CorrelationType","tag":"CorrelationType","type":"*variable","value":"~*req.8"},{"path":"Tolerance","tag":"Tolerance","type":"*variable","value":"~*req.9"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.10"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.11"}],"file_name":"Trends.csv","flags":null,"type":"*trends"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.2"},{"path":"StatIDs","tag":"StatIDs","type":"*variable","value":"~*req.3"},{"path":"MetricIDs","tag":"MetricIDs","type":"*variable","value":"~*req.4"},{"path":"Sorting","tag":"Sorting","type":"*variable","value":"~*req.5"},{"path":"SortingParameters","tag":"SortingParameters","type":"*variable","value":"~*req.6"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.7"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.8"}],"file_name":"Rankings.csv","flags":null,"type":"*rankings"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"Sorting","tag":"Sorting","type":"*variable","value":"~*req.5"},{"path":"SortingParameters","tag":"SortingParameters","type":"*variable","value":"~*req.6"},{"new_branch":true,"path":"Routes.ID","tag":"RouteID","type":"*variable","value":"~*req.7"},{"path":"Routes.FilterIDs","tag":"RouteFilterIDs","type":"*variable","value":"~*req.8"},{"path":"Routes.AccountIDs","tag":"RouteAccountIDs","type":"*variable","value":"~*req.9"},{"path":"Routes.RateProfileIDs","tag":"RouteRateProfileIDs","type":"*variable","value":"~*req.10"},{"path":"Routes.ResourceIDs","tag":"RouteResourceIDs","type":"*variable","value":"~*req.11"},{"path":"Routes.StatIDs","tag":"RouteStatIDs","type":"*variable","value":"~*req.12"},{"path":"Routes.Weights","tag":"RouteWeights","type":"*variable","value":"~*req.13"},{"path":"Routes.Blockers","tag":"RouteBlockers","type":"*variable","value":"~*req.14"},{"path":"Routes.RouteParameters","tag":"RouteParameters","type":"*variable","value":"~*req.15"}],"file_name":"Routes.csv","flags":null,"type":"*routes"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"RunID","tag":"RunID","type":"*variable","value":"~*req.5"},{"path":"AttributeIDs","tag":"AttributeIDs","type":"*variable","value":"~*req.6"}],"file_name":"Chargers.csv","flags":null,"type":"*chargers"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"MinCost","tag":"MinCost","type":"*variable","value":"~*req.4"},{"path":"MaxCost","tag":"MaxCost","type":"*variable","value":"~*req.5"},{"path":"MaxCostStrategy","tag":"MaxCostStrategy","type":"*variable","value":"~*req.6"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].FilterIDs","tag":"RateFilterIDs","type":"*variable","value":"~*req.8"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].ActivationTimes","tag":"RateActivationTimes","type":"*variable","value":"~*req.9"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].Weights","tag":"RateWeights","type":"*variable","value":"~*req.10"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].Blocker","tag":"RateBlocker","type":"*variable","value":"~*req.11"},{"filters":["*notempty:~*req.7:"],"new_branch":true,"path":"Rates[\u003c~*req.7\u003e].IntervalRates.IntervalStart","tag":"RateIntervalStart","type":"*variable","value":"~*req.12"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.FixedFee","tag":"RateFixedFee","type":"*variable","value":"~*req.13"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.RecurrentFee","tag":"RateRecurrentFee","type":"*variable","value":"~*req.14"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.Unit","tag":"RateUnit","type":"*variable","value":"~*req.15"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.Increment","tag":"RateIncrement","type":"*variable","value":"~*req.16"}],"file_name":"Rates.csv","flags":null,"type":"*rate_profiles"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.5"},{"path":"Targets[\u003c~*req.6\u003e]","tag":"TargetIDs","type":"*variable","value":"~*req.7"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].FilterIDs","tag":"ActionFilterIDs","type":"*variable","value":"~*req.9"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].TTL","tag":"ActionTTL","type":"*variable","value":"~*req.10"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Type","tag":"ActionType","type":"*variable","value":"~*req.11"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Opts","tag":"ActionOpts","type":"*variable","value":"~*req.12"},{"filters":["*notempty:~*req.8:"],"new_branch":true,"path":"Actions[\u003c~*req.8\u003e].Diktats.Path","tag":"ActionPath","type":"*variable","value":"~*req.13"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Diktats.Value","tag":"ActionValue","type":"*variable","value":"~*req.14"}],"file_name":"Actions.csv","flags":null,"type":"*action_profiles"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"Opts","tag":"Opts","type":"*variable","value":"~*req.5"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].FilterIDs","tag":"BalanceFilterIDs","type":"*variable","value":"~*req.7"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Weights","tag":"BalanceWeights","type":"*variable","value":"~*req.8"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Blockers","tag":"BalanceBlockers","type":"*variable","value":"~*req.9"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Type","tag":"BalanceType","type":"*variable","value":"~*req.10"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Units","tag":"BalanceUnits","type":"*variable","value":"~*req.11"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].UnitFactors","tag":"BalanceUnitFactors","type":"*variable","value":"~*req.12"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Opts","tag":"BalanceOpts","type":"*variable","value":"~*req.13"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].CostIncrements","tag":"BalanceCostIncrements","type":"*variable","value":"~*req.14"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].AttributeIDs","tag":"BalanceAttributeIDs","type":"*variable","value":"~*req.15"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].RateProfileIDs","tag":"BalanceRateProfileIDs","type":"*variable","value":"~*req.16"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.17"}],"file_name":"Accounts.csv","flags":null,"type":"*accounts"}],"enabled":false,"field_separator":",","id":"*default","lockfile_path":".cgr.lck","opts":{"*cache":"","*forceLock":false,"*stopOnError":false,"*withIndex":true},"run_delay":"0","tenant":"","tp_in_dir":"/var/spool/cgrates/loader/in","tp_out_dir":"/var/spool/cgrates/loader/out"}]}` + switch testCfgDir { + case "tutinternal": + cfgStr := `{"loaders":[{"action":"*store","cache":{"*accounts":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*action_profiles":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*attributes":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*chargers":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*filters":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*rankings":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*rate_profiles":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*resources":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*routes":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*stats":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*thresholds":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*trends":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"}},"caches_conns":["*internal"],"data":[{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"new_branch":true,"path":"Rules.Type","tag":"Type","type":"*variable","value":"~*req.2"},{"path":"Rules.Element","tag":"Element","type":"*variable","value":"~*req.3"},{"path":"Rules.Values","tag":"Values","type":"*variable","value":"~*req.4"}],"file_name":"Filters.csv","flags":null,"type":"*filters"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"TenantID","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ProfileID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"new_branch":true,"path":"Attributes.FilterIDs","tag":"AttributeFilterIDs","type":"*variable","value":"~*req.5"},{"path":"Attributes.Blockers","tag":"AttributeBlockers","type":"*variable","value":"~*req.6"},{"path":"Attributes.Path","tag":"Path","type":"*variable","value":"~*req.7"},{"path":"Attributes.Type","tag":"Type","type":"*variable","value":"~*req.8"},{"path":"Attributes.Value","tag":"Value","type":"*variable","value":"~*req.9"}],"file_name":"Attributes.csv","flags":null,"type":"*attributes"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"UsageTTL","tag":"TTL","type":"*variable","value":"~*req.4"},{"path":"Limit","tag":"Limit","type":"*variable","value":"~*req.5"},{"path":"AllocationMessage","tag":"AllocationMessage","type":"*variable","value":"~*req.6"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.7"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.8"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.9"}],"file_name":"Resources.csv","flags":null,"type":"*resources"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"QueueLength","tag":"QueueLength","type":"*variable","value":"~*req.5"},{"path":"TTL","tag":"TTL","type":"*variable","value":"~*req.6"},{"path":"MinItems","tag":"MinItems","type":"*variable","value":"~*req.7"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.8"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.9"},{"new_branch":true,"path":"Metrics.MetricID","tag":"MetricIDs","type":"*variable","value":"~*req.10"},{"path":"Metrics.FilterIDs","tag":"MetricFilterIDs","type":"*variable","value":"~*req.11"},{"path":"Metrics.Blockers","tag":"MetricBlockers","type":"*variable","value":"~*req.12"}],"file_name":"Stats.csv","flags":null,"type":"*stats"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"MaxHits","tag":"MaxHits","type":"*variable","value":"~*req.4"},{"path":"MinHits","tag":"MinHits","type":"*variable","value":"~*req.5"},{"path":"MinSleep","tag":"MinSleep","type":"*variable","value":"~*req.6"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.7"},{"path":"ActionProfileIDs","tag":"ActionProfileIDs","type":"*variable","value":"~*req.8"},{"path":"Async","tag":"Async","type":"*variable","value":"~*req.9"}],"file_name":"Thresholds.csv","flags":null,"type":"*thresholds"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.2"},{"path":"StatID","tag":"StatID","type":"*variable","value":"~*req.3"},{"path":"Metrics","tag":"Metrics","type":"*variable","value":"~*req.4"},{"path":"TTL","tag":"TTL","type":"*variable","value":"~*req.5"},{"path":"QueueLength","tag":"QueueLength","type":"*variable","value":"~*req.6"},{"path":"MinItems","tag":"MinItems","type":"*variable","value":"~*req.7"},{"path":"CorrelationType","tag":"CorrelationType","type":"*variable","value":"~*req.8"},{"path":"Tolerance","tag":"Tolerance","type":"*variable","value":"~*req.9"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.10"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.11"}],"file_name":"Trends.csv","flags":null,"type":"*trends"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.2"},{"path":"StatIDs","tag":"StatIDs","type":"*variable","value":"~*req.3"},{"path":"MetricIDs","tag":"MetricIDs","type":"*variable","value":"~*req.4"},{"path":"Sorting","tag":"Sorting","type":"*variable","value":"~*req.5"},{"path":"SortingParameters","tag":"SortingParameters","type":"*variable","value":"~*req.6"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.7"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.8"}],"file_name":"Rankings.csv","flags":null,"type":"*rankings"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"Sorting","tag":"Sorting","type":"*variable","value":"~*req.5"},{"path":"SortingParameters","tag":"SortingParameters","type":"*variable","value":"~*req.6"},{"new_branch":true,"path":"Routes.ID","tag":"RouteID","type":"*variable","value":"~*req.7"},{"path":"Routes.FilterIDs","tag":"RouteFilterIDs","type":"*variable","value":"~*req.8"},{"path":"Routes.AccountIDs","tag":"RouteAccountIDs","type":"*variable","value":"~*req.9"},{"path":"Routes.RateProfileIDs","tag":"RouteRateProfileIDs","type":"*variable","value":"~*req.10"},{"path":"Routes.ResourceIDs","tag":"RouteResourceIDs","type":"*variable","value":"~*req.11"},{"path":"Routes.StatIDs","tag":"RouteStatIDs","type":"*variable","value":"~*req.12"},{"path":"Routes.Weights","tag":"RouteWeights","type":"*variable","value":"~*req.13"},{"path":"Routes.Blockers","tag":"RouteBlockers","type":"*variable","value":"~*req.14"},{"path":"Routes.RouteParameters","tag":"RouteParameters","type":"*variable","value":"~*req.15"}],"file_name":"Routes.csv","flags":null,"type":"*routes"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"RunID","tag":"RunID","type":"*variable","value":"~*req.5"},{"path":"AttributeIDs","tag":"AttributeIDs","type":"*variable","value":"~*req.6"}],"file_name":"Chargers.csv","flags":null,"type":"*chargers"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"MinCost","tag":"MinCost","type":"*variable","value":"~*req.4"},{"path":"MaxCost","tag":"MaxCost","type":"*variable","value":"~*req.5"},{"path":"MaxCostStrategy","tag":"MaxCostStrategy","type":"*variable","value":"~*req.6"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].FilterIDs","tag":"RateFilterIDs","type":"*variable","value":"~*req.8"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].ActivationTimes","tag":"RateActivationTimes","type":"*variable","value":"~*req.9"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].Weights","tag":"RateWeights","type":"*variable","value":"~*req.10"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].Blocker","tag":"RateBlocker","type":"*variable","value":"~*req.11"},{"filters":["*notempty:~*req.7:"],"new_branch":true,"path":"Rates[\u003c~*req.7\u003e].IntervalRates.IntervalStart","tag":"RateIntervalStart","type":"*variable","value":"~*req.12"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.FixedFee","tag":"RateFixedFee","type":"*variable","value":"~*req.13"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.RecurrentFee","tag":"RateRecurrentFee","type":"*variable","value":"~*req.14"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.Unit","tag":"RateUnit","type":"*variable","value":"~*req.15"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.Increment","tag":"RateIncrement","type":"*variable","value":"~*req.16"}],"file_name":"Rates.csv","flags":null,"type":"*rate_profiles"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.5"},{"path":"Targets[\u003c~*req.6\u003e]","tag":"TargetIDs","type":"*variable","value":"~*req.7"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].FilterIDs","tag":"ActionFilterIDs","type":"*variable","value":"~*req.9"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].TTL","tag":"ActionTTL","type":"*variable","value":"~*req.10"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Type","tag":"ActionType","type":"*variable","value":"~*req.11"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Opts","tag":"ActionOpts","type":"*variable","value":"~*req.12"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Weights","tag":"ActionWeights","type":"*variable","value":"~*req.13"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Blockers","tag":"ActionBlockers","type":"*variable","value":"~*req.14"},{"filters":["*notempty:~*req.8:"],"new_branch":true,"path":"Actions[\u003c~*req.8\u003e].Diktats.ID","tag":"ActionDiktatsID","type":"*variable","value":"~*req.15"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Diktats.FilterIDs","tag":"ActionDiktatsFilterIDs","type":"*variable","value":"~*req.16"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Diktats.Opts","tag":"ActionDiktatsOpts","type":"*variable","value":"~*req.17"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Diktats.Weights","tag":"ActionDiktatsWeights","type":"*variable","value":"~*req.18"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Diktats.Blockers","tag":"ActionDiktatsBlockers","type":"*variable","value":"~*req.19"}],"file_name":"Actions.csv","flags":null,"type":"*action_profiles"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"Opts","tag":"Opts","type":"*variable","value":"~*req.5"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].FilterIDs","tag":"BalanceFilterIDs","type":"*variable","value":"~*req.7"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Weights","tag":"BalanceWeights","type":"*variable","value":"~*req.8"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Blockers","tag":"BalanceBlockers","type":"*variable","value":"~*req.9"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Type","tag":"BalanceType","type":"*variable","value":"~*req.10"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Units","tag":"BalanceUnits","type":"*variable","value":"~*req.11"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].UnitFactors","tag":"BalanceUnitFactors","type":"*variable","value":"~*req.12"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Opts","tag":"BalanceOpts","type":"*variable","value":"~*req.13"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].CostIncrements","tag":"BalanceCostIncrements","type":"*variable","value":"~*req.14"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].AttributeIDs","tag":"BalanceAttributeIDs","type":"*variable","value":"~*req.15"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].RateProfileIDs","tag":"BalanceRateProfileIDs","type":"*variable","value":"~*req.16"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.17"}],"file_name":"Accounts.csv","flags":null,"type":"*accounts"}],"enabled":false,"field_separator":",","id":"*default","lockfile_path":".cgr.lck","opts":{"*cache":"","*forceLock":false,"*stopOnError":false,"*withIndex":true},"run_delay":"0","tenant":"","tp_in_dir":"/var/spool/cgrates/loader/in","tp_out_dir":"/var/spool/cgrates/loader/out"}]}` var rpl26 string if err := testRPC.Call(context.Background(), utils.ConfigSv1GetConfigAsJSON, &config.SectionWithAPIOpts{ Tenant: "cgrates.org", @@ -412,8 +413,8 @@ func testConfigSReload(t *testing.T) { t.Errorf("\nExpected %+v ,\n received: %+v", cfgStr, rpl26) } - } else if testCfgDir == "tutmysql" || testCfgDir == "tutmongo" { - cfgStr = `{"loaders":[{"action":"*store","cache":{"*accounts":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*action_profiles":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*attributes":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*chargers":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*filters":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*rankings":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*rate_profiles":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*resources":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*routes":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*stats":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*thresholds":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*trends":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"}},"caches_conns":["*internal"],"data":[{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"new_branch":true,"path":"Rules.Type","tag":"Type","type":"*variable","value":"~*req.2"},{"path":"Rules.Element","tag":"Element","type":"*variable","value":"~*req.3"},{"path":"Rules.Values","tag":"Values","type":"*variable","value":"~*req.4"}],"file_name":"Filters.csv","flags":null,"type":"*filters"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"TenantID","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ProfileID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"new_branch":true,"path":"Attributes.FilterIDs","tag":"AttributeFilterIDs","type":"*variable","value":"~*req.5"},{"path":"Attributes.Blockers","tag":"AttributeBlockers","type":"*variable","value":"~*req.6"},{"path":"Attributes.Path","tag":"Path","type":"*variable","value":"~*req.7"},{"path":"Attributes.Type","tag":"Type","type":"*variable","value":"~*req.8"},{"path":"Attributes.Value","tag":"Value","type":"*variable","value":"~*req.9"}],"file_name":"Attributes.csv","flags":null,"type":"*attributes"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"UsageTTL","tag":"TTL","type":"*variable","value":"~*req.4"},{"path":"Limit","tag":"Limit","type":"*variable","value":"~*req.5"},{"path":"AllocationMessage","tag":"AllocationMessage","type":"*variable","value":"~*req.6"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.7"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.8"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.9"}],"file_name":"Resources.csv","flags":null,"type":"*resources"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"QueueLength","tag":"QueueLength","type":"*variable","value":"~*req.5"},{"path":"TTL","tag":"TTL","type":"*variable","value":"~*req.6"},{"path":"MinItems","tag":"MinItems","type":"*variable","value":"~*req.7"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.8"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.9"},{"new_branch":true,"path":"Metrics.MetricID","tag":"MetricIDs","type":"*variable","value":"~*req.10"},{"path":"Metrics.FilterIDs","tag":"MetricFilterIDs","type":"*variable","value":"~*req.11"},{"path":"Metrics.Blockers","tag":"MetricBlockers","type":"*variable","value":"~*req.12"}],"file_name":"Stats.csv","flags":null,"type":"*stats"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"MaxHits","tag":"MaxHits","type":"*variable","value":"~*req.4"},{"path":"MinHits","tag":"MinHits","type":"*variable","value":"~*req.5"},{"path":"MinSleep","tag":"MinSleep","type":"*variable","value":"~*req.6"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.7"},{"path":"ActionProfileIDs","tag":"ActionProfileIDs","type":"*variable","value":"~*req.8"},{"path":"Async","tag":"Async","type":"*variable","value":"~*req.9"}],"file_name":"Thresholds.csv","flags":null,"type":"*thresholds"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.2"},{"path":"StatID","tag":"StatID","type":"*variable","value":"~*req.3"},{"path":"Metrics","tag":"Metrics","type":"*variable","value":"~*req.4"},{"path":"TTL","tag":"TTL","type":"*variable","value":"~*req.5"},{"path":"QueueLength","tag":"QueueLength","type":"*variable","value":"~*req.6"},{"path":"MinItems","tag":"MinItems","type":"*variable","value":"~*req.7"},{"path":"CorrelationType","tag":"CorrelationType","type":"*variable","value":"~*req.8"},{"path":"Tolerance","tag":"Tolerance","type":"*variable","value":"~*req.9"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.10"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.11"}],"file_name":"Trends.csv","flags":null,"type":"*trends"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.2"},{"path":"StatIDs","tag":"StatIDs","type":"*variable","value":"~*req.3"},{"path":"MetricIDs","tag":"MetricIDs","type":"*variable","value":"~*req.4"},{"path":"Sorting","tag":"Sorting","type":"*variable","value":"~*req.5"},{"path":"SortingParameters","tag":"SortingParameters","type":"*variable","value":"~*req.6"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.7"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.8"}],"file_name":"Rankings.csv","flags":null,"type":"*rankings"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"Sorting","tag":"Sorting","type":"*variable","value":"~*req.5"},{"path":"SortingParameters","tag":"SortingParameters","type":"*variable","value":"~*req.6"},{"new_branch":true,"path":"Routes.ID","tag":"RouteID","type":"*variable","value":"~*req.7"},{"path":"Routes.FilterIDs","tag":"RouteFilterIDs","type":"*variable","value":"~*req.8"},{"path":"Routes.AccountIDs","tag":"RouteAccountIDs","type":"*variable","value":"~*req.9"},{"path":"Routes.RateProfileIDs","tag":"RouteRateProfileIDs","type":"*variable","value":"~*req.10"},{"path":"Routes.ResourceIDs","tag":"RouteResourceIDs","type":"*variable","value":"~*req.11"},{"path":"Routes.StatIDs","tag":"RouteStatIDs","type":"*variable","value":"~*req.12"},{"path":"Routes.Weights","tag":"RouteWeights","type":"*variable","value":"~*req.13"},{"path":"Routes.Blockers","tag":"RouteBlockers","type":"*variable","value":"~*req.14"},{"path":"Routes.RouteParameters","tag":"RouteParameters","type":"*variable","value":"~*req.15"}],"file_name":"Routes.csv","flags":null,"type":"*routes"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"RunID","tag":"RunID","type":"*variable","value":"~*req.5"},{"path":"AttributeIDs","tag":"AttributeIDs","type":"*variable","value":"~*req.6"}],"file_name":"Chargers.csv","flags":null,"type":"*chargers"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"MinCost","tag":"MinCost","type":"*variable","value":"~*req.4"},{"path":"MaxCost","tag":"MaxCost","type":"*variable","value":"~*req.5"},{"path":"MaxCostStrategy","tag":"MaxCostStrategy","type":"*variable","value":"~*req.6"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].FilterIDs","tag":"RateFilterIDs","type":"*variable","value":"~*req.8"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].ActivationTimes","tag":"RateActivationTimes","type":"*variable","value":"~*req.9"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].Weights","tag":"RateWeights","type":"*variable","value":"~*req.10"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].Blocker","tag":"RateBlocker","type":"*variable","value":"~*req.11"},{"filters":["*notempty:~*req.7:"],"new_branch":true,"path":"Rates[\u003c~*req.7\u003e].IntervalRates.IntervalStart","tag":"RateIntervalStart","type":"*variable","value":"~*req.12"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.FixedFee","tag":"RateFixedFee","type":"*variable","value":"~*req.13"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.RecurrentFee","tag":"RateRecurrentFee","type":"*variable","value":"~*req.14"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.Unit","tag":"RateUnit","type":"*variable","value":"~*req.15"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.Increment","tag":"RateIncrement","type":"*variable","value":"~*req.16"}],"file_name":"Rates.csv","flags":null,"type":"*rate_profiles"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.5"},{"path":"Targets[\u003c~*req.6\u003e]","tag":"TargetIDs","type":"*variable","value":"~*req.7"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].FilterIDs","tag":"ActionFilterIDs","type":"*variable","value":"~*req.9"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].TTL","tag":"ActionTTL","type":"*variable","value":"~*req.10"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Type","tag":"ActionType","type":"*variable","value":"~*req.11"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Opts","tag":"ActionOpts","type":"*variable","value":"~*req.12"},{"filters":["*notempty:~*req.8:"],"new_branch":true,"path":"Actions[\u003c~*req.8\u003e].Diktats.Path","tag":"ActionPath","type":"*variable","value":"~*req.13"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Diktats.Value","tag":"ActionValue","type":"*variable","value":"~*req.14"}],"file_name":"Actions.csv","flags":null,"type":"*action_profiles"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"Opts","tag":"Opts","type":"*variable","value":"~*req.5"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].FilterIDs","tag":"BalanceFilterIDs","type":"*variable","value":"~*req.7"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Weights","tag":"BalanceWeights","type":"*variable","value":"~*req.8"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Blockers","tag":"BalanceBlockers","type":"*variable","value":"~*req.9"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Type","tag":"BalanceType","type":"*variable","value":"~*req.10"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Units","tag":"BalanceUnits","type":"*variable","value":"~*req.11"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].UnitFactors","tag":"BalanceUnitFactors","type":"*variable","value":"~*req.12"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Opts","tag":"BalanceOpts","type":"*variable","value":"~*req.13"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].CostIncrements","tag":"BalanceCostIncrements","type":"*variable","value":"~*req.14"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].AttributeIDs","tag":"BalanceAttributeIDs","type":"*variable","value":"~*req.15"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].RateProfileIDs","tag":"BalanceRateProfileIDs","type":"*variable","value":"~*req.16"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.17"}],"file_name":"Accounts.csv","flags":null,"type":"*accounts"}],"enabled":false,"field_separator":",","id":"*default","lockfile_path":".cgr.lck","opts":{"*cache":"","*forceLock":false,"*stopOnError":false,"*withIndex":true},"run_delay":"0","tenant":"","tp_in_dir":"/var/spool/cgrates/loader/in","tp_out_dir":"/var/spool/cgrates/loader/out"}]}` + case "tutmysql", "tutmongo": + cfgStr = `{"loaders":[{"action":"*store","cache":{"*accounts":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*action_profiles":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*attributes":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*chargers":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*filters":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*rankings":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*rate_profiles":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*resources":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*routes":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*stats":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*thresholds":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*trends":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"}},"caches_conns":["*internal"],"data":[{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"new_branch":true,"path":"Rules.Type","tag":"Type","type":"*variable","value":"~*req.2"},{"path":"Rules.Element","tag":"Element","type":"*variable","value":"~*req.3"},{"path":"Rules.Values","tag":"Values","type":"*variable","value":"~*req.4"}],"file_name":"Filters.csv","flags":null,"type":"*filters"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"TenantID","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ProfileID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"new_branch":true,"path":"Attributes.FilterIDs","tag":"AttributeFilterIDs","type":"*variable","value":"~*req.5"},{"path":"Attributes.Blockers","tag":"AttributeBlockers","type":"*variable","value":"~*req.6"},{"path":"Attributes.Path","tag":"Path","type":"*variable","value":"~*req.7"},{"path":"Attributes.Type","tag":"Type","type":"*variable","value":"~*req.8"},{"path":"Attributes.Value","tag":"Value","type":"*variable","value":"~*req.9"}],"file_name":"Attributes.csv","flags":null,"type":"*attributes"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"UsageTTL","tag":"TTL","type":"*variable","value":"~*req.4"},{"path":"Limit","tag":"Limit","type":"*variable","value":"~*req.5"},{"path":"AllocationMessage","tag":"AllocationMessage","type":"*variable","value":"~*req.6"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.7"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.8"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.9"}],"file_name":"Resources.csv","flags":null,"type":"*resources"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"QueueLength","tag":"QueueLength","type":"*variable","value":"~*req.5"},{"path":"TTL","tag":"TTL","type":"*variable","value":"~*req.6"},{"path":"MinItems","tag":"MinItems","type":"*variable","value":"~*req.7"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.8"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.9"},{"new_branch":true,"path":"Metrics.MetricID","tag":"MetricIDs","type":"*variable","value":"~*req.10"},{"path":"Metrics.FilterIDs","tag":"MetricFilterIDs","type":"*variable","value":"~*req.11"},{"path":"Metrics.Blockers","tag":"MetricBlockers","type":"*variable","value":"~*req.12"}],"file_name":"Stats.csv","flags":null,"type":"*stats"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"MaxHits","tag":"MaxHits","type":"*variable","value":"~*req.4"},{"path":"MinHits","tag":"MinHits","type":"*variable","value":"~*req.5"},{"path":"MinSleep","tag":"MinSleep","type":"*variable","value":"~*req.6"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.7"},{"path":"ActionProfileIDs","tag":"ActionProfileIDs","type":"*variable","value":"~*req.8"},{"path":"Async","tag":"Async","type":"*variable","value":"~*req.9"}],"file_name":"Thresholds.csv","flags":null,"type":"*thresholds"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.2"},{"path":"StatID","tag":"StatID","type":"*variable","value":"~*req.3"},{"path":"Metrics","tag":"Metrics","type":"*variable","value":"~*req.4"},{"path":"TTL","tag":"TTL","type":"*variable","value":"~*req.5"},{"path":"QueueLength","tag":"QueueLength","type":"*variable","value":"~*req.6"},{"path":"MinItems","tag":"MinItems","type":"*variable","value":"~*req.7"},{"path":"CorrelationType","tag":"CorrelationType","type":"*variable","value":"~*req.8"},{"path":"Tolerance","tag":"Tolerance","type":"*variable","value":"~*req.9"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.10"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.11"}],"file_name":"Trends.csv","flags":null,"type":"*trends"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.2"},{"path":"StatIDs","tag":"StatIDs","type":"*variable","value":"~*req.3"},{"path":"MetricIDs","tag":"MetricIDs","type":"*variable","value":"~*req.4"},{"path":"Sorting","tag":"Sorting","type":"*variable","value":"~*req.5"},{"path":"SortingParameters","tag":"SortingParameters","type":"*variable","value":"~*req.6"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.7"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.8"}],"file_name":"Rankings.csv","flags":null,"type":"*rankings"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"Sorting","tag":"Sorting","type":"*variable","value":"~*req.5"},{"path":"SortingParameters","tag":"SortingParameters","type":"*variable","value":"~*req.6"},{"new_branch":true,"path":"Routes.ID","tag":"RouteID","type":"*variable","value":"~*req.7"},{"path":"Routes.FilterIDs","tag":"RouteFilterIDs","type":"*variable","value":"~*req.8"},{"path":"Routes.AccountIDs","tag":"RouteAccountIDs","type":"*variable","value":"~*req.9"},{"path":"Routes.RateProfileIDs","tag":"RouteRateProfileIDs","type":"*variable","value":"~*req.10"},{"path":"Routes.ResourceIDs","tag":"RouteResourceIDs","type":"*variable","value":"~*req.11"},{"path":"Routes.StatIDs","tag":"RouteStatIDs","type":"*variable","value":"~*req.12"},{"path":"Routes.Weights","tag":"RouteWeights","type":"*variable","value":"~*req.13"},{"path":"Routes.Blockers","tag":"RouteBlockers","type":"*variable","value":"~*req.14"},{"path":"Routes.RouteParameters","tag":"RouteParameters","type":"*variable","value":"~*req.15"}],"file_name":"Routes.csv","flags":null,"type":"*routes"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"RunID","tag":"RunID","type":"*variable","value":"~*req.5"},{"path":"AttributeIDs","tag":"AttributeIDs","type":"*variable","value":"~*req.6"}],"file_name":"Chargers.csv","flags":null,"type":"*chargers"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"MinCost","tag":"MinCost","type":"*variable","value":"~*req.4"},{"path":"MaxCost","tag":"MaxCost","type":"*variable","value":"~*req.5"},{"path":"MaxCostStrategy","tag":"MaxCostStrategy","type":"*variable","value":"~*req.6"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].FilterIDs","tag":"RateFilterIDs","type":"*variable","value":"~*req.8"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].ActivationTimes","tag":"RateActivationTimes","type":"*variable","value":"~*req.9"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].Weights","tag":"RateWeights","type":"*variable","value":"~*req.10"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].Blocker","tag":"RateBlocker","type":"*variable","value":"~*req.11"},{"filters":["*notempty:~*req.7:"],"new_branch":true,"path":"Rates[\u003c~*req.7\u003e].IntervalRates.IntervalStart","tag":"RateIntervalStart","type":"*variable","value":"~*req.12"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.FixedFee","tag":"RateFixedFee","type":"*variable","value":"~*req.13"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.RecurrentFee","tag":"RateRecurrentFee","type":"*variable","value":"~*req.14"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.Unit","tag":"RateUnit","type":"*variable","value":"~*req.15"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.Increment","tag":"RateIncrement","type":"*variable","value":"~*req.16"}],"file_name":"Rates.csv","flags":null,"type":"*rate_profiles"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.5"},{"path":"Targets[\u003c~*req.6\u003e]","tag":"TargetIDs","type":"*variable","value":"~*req.7"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].FilterIDs","tag":"ActionFilterIDs","type":"*variable","value":"~*req.9"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].TTL","tag":"ActionTTL","type":"*variable","value":"~*req.10"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Type","tag":"ActionType","type":"*variable","value":"~*req.11"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Opts","tag":"ActionOpts","type":"*variable","value":"~*req.12"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Weights","tag":"ActionWeights","type":"*variable","value":"~*req.13"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Blockers","tag":"ActionBlockers","type":"*variable","value":"~*req.14"},{"filters":["*notempty:~*req.8:"],"new_branch":true,"path":"Actions[\u003c~*req.8\u003e].Diktats.ID","tag":"ActionDiktatsID","type":"*variable","value":"~*req.15"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Diktats.FilterIDs","tag":"ActionDiktatsFilterIDs","type":"*variable","value":"~*req.16"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Diktats.Opts","tag":"ActionDiktatsOpts","type":"*variable","value":"~*req.17"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Diktats.Weights","tag":"ActionDiktatsWeights","type":"*variable","value":"~*req.18"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Diktats.Blockers","tag":"ActionDiktatsBlockers","type":"*variable","value":"~*req.19"}],"file_name":"Actions.csv","flags":null,"type":"*action_profiles"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"Opts","tag":"Opts","type":"*variable","value":"~*req.5"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].FilterIDs","tag":"BalanceFilterIDs","type":"*variable","value":"~*req.7"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Weights","tag":"BalanceWeights","type":"*variable","value":"~*req.8"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Blockers","tag":"BalanceBlockers","type":"*variable","value":"~*req.9"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Type","tag":"BalanceType","type":"*variable","value":"~*req.10"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Units","tag":"BalanceUnits","type":"*variable","value":"~*req.11"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].UnitFactors","tag":"BalanceUnitFactors","type":"*variable","value":"~*req.12"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Opts","tag":"BalanceOpts","type":"*variable","value":"~*req.13"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].CostIncrements","tag":"BalanceCostIncrements","type":"*variable","value":"~*req.14"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].AttributeIDs","tag":"BalanceAttributeIDs","type":"*variable","value":"~*req.15"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].RateProfileIDs","tag":"BalanceRateProfileIDs","type":"*variable","value":"~*req.16"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.17"}],"file_name":"Accounts.csv","flags":null,"type":"*accounts"}],"enabled":false,"field_separator":",","id":"*default","lockfile_path":".cgr.lck","opts":{"*cache":"","*forceLock":false,"*stopOnError":false,"*withIndex":true},"run_delay":"0","tenant":"","tp_in_dir":"/var/spool/cgrates/loader/in","tp_out_dir":"/var/spool/cgrates/loader/out"}]}` var rpl26 string if err := testRPC.Call(context.Background(), utils.ConfigSv1GetConfigAsJSON, &config.SectionWithAPIOpts{ Tenant: "cgrates.org", diff --git a/general_tests/all_sections_cfg_rld_it_test.go b/general_tests/all_sections_cfg_rld_it_test.go index 643dd22c5..1ae7de478 100644 --- a/general_tests/all_sections_cfg_rld_it_test.go +++ b/general_tests/all_sections_cfg_rld_it_test.go @@ -817,7 +817,7 @@ func testSectConfigSReloadLoaders(t *testing.T) { } else if reply != utils.OK { t.Errorf("Expected OK received: %+v", reply) } - cfgStr := `{"loaders":[{"action":"*store","cache":{"*accounts":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*action_profiles":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*attributes":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*chargers":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*filters":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*rankings":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*rate_profiles":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*resources":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*routes":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*stats":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*thresholds":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*trends":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"}},"caches_conns":["*internal"],"data":[{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"new_branch":true,"path":"Rules.Type","tag":"Type","type":"*variable","value":"~*req.2"},{"path":"Rules.Element","tag":"Element","type":"*variable","value":"~*req.3"},{"path":"Rules.Values","tag":"Values","type":"*variable","value":"~*req.4"}],"file_name":"Filters.csv","flags":null,"type":"*filters"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"TenantID","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ProfileID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"new_branch":true,"path":"Attributes.FilterIDs","tag":"AttributeFilterIDs","type":"*variable","value":"~*req.5"},{"path":"Attributes.Blockers","tag":"AttributeBlockers","type":"*variable","value":"~*req.6"},{"path":"Attributes.Path","tag":"Path","type":"*variable","value":"~*req.7"},{"path":"Attributes.Type","tag":"Type","type":"*variable","value":"~*req.8"},{"path":"Attributes.Value","tag":"Value","type":"*variable","value":"~*req.9"}],"file_name":"Attributes.csv","flags":null,"type":"*attributes"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"UsageTTL","tag":"TTL","type":"*variable","value":"~*req.4"},{"path":"Limit","tag":"Limit","type":"*variable","value":"~*req.5"},{"path":"AllocationMessage","tag":"AllocationMessage","type":"*variable","value":"~*req.6"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.7"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.8"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.9"}],"file_name":"Resources.csv","flags":null,"type":"*resources"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"QueueLength","tag":"QueueLength","type":"*variable","value":"~*req.5"},{"path":"TTL","tag":"TTL","type":"*variable","value":"~*req.6"},{"path":"MinItems","tag":"MinItems","type":"*variable","value":"~*req.7"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.8"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.9"},{"new_branch":true,"path":"Metrics.MetricID","tag":"MetricIDs","type":"*variable","value":"~*req.10"},{"path":"Metrics.FilterIDs","tag":"MetricFilterIDs","type":"*variable","value":"~*req.11"},{"path":"Metrics.Blockers","tag":"MetricBlockers","type":"*variable","value":"~*req.12"}],"file_name":"Stats.csv","flags":null,"type":"*stats"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"MaxHits","tag":"MaxHits","type":"*variable","value":"~*req.4"},{"path":"MinHits","tag":"MinHits","type":"*variable","value":"~*req.5"},{"path":"MinSleep","tag":"MinSleep","type":"*variable","value":"~*req.6"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.7"},{"path":"ActionProfileIDs","tag":"ActionProfileIDs","type":"*variable","value":"~*req.8"},{"path":"Async","tag":"Async","type":"*variable","value":"~*req.9"}],"file_name":"Thresholds.csv","flags":null,"type":"*thresholds"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.2"},{"path":"StatID","tag":"StatID","type":"*variable","value":"~*req.3"},{"path":"Metrics","tag":"Metrics","type":"*variable","value":"~*req.4"},{"path":"TTL","tag":"TTL","type":"*variable","value":"~*req.5"},{"path":"QueueLength","tag":"QueueLength","type":"*variable","value":"~*req.6"},{"path":"MinItems","tag":"MinItems","type":"*variable","value":"~*req.7"},{"path":"CorrelationType","tag":"CorrelationType","type":"*variable","value":"~*req.8"},{"path":"Tolerance","tag":"Tolerance","type":"*variable","value":"~*req.9"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.10"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.11"}],"file_name":"Trends.csv","flags":null,"type":"*trends"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.2"},{"path":"StatIDs","tag":"StatIDs","type":"*variable","value":"~*req.3"},{"path":"MetricIDs","tag":"MetricIDs","type":"*variable","value":"~*req.4"},{"path":"Sorting","tag":"Sorting","type":"*variable","value":"~*req.5"},{"path":"SortingParameters","tag":"SortingParameters","type":"*variable","value":"~*req.6"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.7"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.8"}],"file_name":"Rankings.csv","flags":null,"type":"*rankings"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"Sorting","tag":"Sorting","type":"*variable","value":"~*req.5"},{"path":"SortingParameters","tag":"SortingParameters","type":"*variable","value":"~*req.6"},{"new_branch":true,"path":"Routes.ID","tag":"RouteID","type":"*variable","value":"~*req.7"},{"path":"Routes.FilterIDs","tag":"RouteFilterIDs","type":"*variable","value":"~*req.8"},{"path":"Routes.AccountIDs","tag":"RouteAccountIDs","type":"*variable","value":"~*req.9"},{"path":"Routes.RateProfileIDs","tag":"RouteRateProfileIDs","type":"*variable","value":"~*req.10"},{"path":"Routes.ResourceIDs","tag":"RouteResourceIDs","type":"*variable","value":"~*req.11"},{"path":"Routes.StatIDs","tag":"RouteStatIDs","type":"*variable","value":"~*req.12"},{"path":"Routes.Weights","tag":"RouteWeights","type":"*variable","value":"~*req.13"},{"path":"Routes.Blockers","tag":"RouteBlockers","type":"*variable","value":"~*req.14"},{"path":"Routes.RouteParameters","tag":"RouteParameters","type":"*variable","value":"~*req.15"}],"file_name":"Routes.csv","flags":null,"type":"*routes"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"RunID","tag":"RunID","type":"*variable","value":"~*req.5"},{"path":"AttributeIDs","tag":"AttributeIDs","type":"*variable","value":"~*req.6"}],"file_name":"Chargers.csv","flags":null,"type":"*chargers"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"MinCost","tag":"MinCost","type":"*variable","value":"~*req.4"},{"path":"MaxCost","tag":"MaxCost","type":"*variable","value":"~*req.5"},{"path":"MaxCostStrategy","tag":"MaxCostStrategy","type":"*variable","value":"~*req.6"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].FilterIDs","tag":"RateFilterIDs","type":"*variable","value":"~*req.8"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].ActivationTimes","tag":"RateActivationTimes","type":"*variable","value":"~*req.9"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].Weights","tag":"RateWeights","type":"*variable","value":"~*req.10"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].Blocker","tag":"RateBlocker","type":"*variable","value":"~*req.11"},{"filters":["*notempty:~*req.7:"],"new_branch":true,"path":"Rates[\u003c~*req.7\u003e].IntervalRates.IntervalStart","tag":"RateIntervalStart","type":"*variable","value":"~*req.12"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.FixedFee","tag":"RateFixedFee","type":"*variable","value":"~*req.13"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.RecurrentFee","tag":"RateRecurrentFee","type":"*variable","value":"~*req.14"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.Unit","tag":"RateUnit","type":"*variable","value":"~*req.15"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.Increment","tag":"RateIncrement","type":"*variable","value":"~*req.16"}],"file_name":"Rates.csv","flags":null,"type":"*rate_profiles"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.5"},{"path":"Targets[\u003c~*req.6\u003e]","tag":"TargetIDs","type":"*variable","value":"~*req.7"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].FilterIDs","tag":"ActionFilterIDs","type":"*variable","value":"~*req.9"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].TTL","tag":"ActionTTL","type":"*variable","value":"~*req.10"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Type","tag":"ActionType","type":"*variable","value":"~*req.11"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Opts","tag":"ActionOpts","type":"*variable","value":"~*req.12"},{"filters":["*notempty:~*req.8:"],"new_branch":true,"path":"Actions[\u003c~*req.8\u003e].Diktats.Path","tag":"ActionPath","type":"*variable","value":"~*req.13"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Diktats.Value","tag":"ActionValue","type":"*variable","value":"~*req.14"}],"file_name":"Actions.csv","flags":null,"type":"*action_profiles"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"Opts","tag":"Opts","type":"*variable","value":"~*req.5"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].FilterIDs","tag":"BalanceFilterIDs","type":"*variable","value":"~*req.7"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Weights","tag":"BalanceWeights","type":"*variable","value":"~*req.8"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Blockers","tag":"BalanceBlockers","type":"*variable","value":"~*req.9"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Type","tag":"BalanceType","type":"*variable","value":"~*req.10"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Units","tag":"BalanceUnits","type":"*variable","value":"~*req.11"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].UnitFactors","tag":"BalanceUnitFactors","type":"*variable","value":"~*req.12"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Opts","tag":"BalanceOpts","type":"*variable","value":"~*req.13"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].CostIncrements","tag":"BalanceCostIncrements","type":"*variable","value":"~*req.14"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].AttributeIDs","tag":"BalanceAttributeIDs","type":"*variable","value":"~*req.15"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].RateProfileIDs","tag":"BalanceRateProfileIDs","type":"*variable","value":"~*req.16"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.17"}],"file_name":"Accounts.csv","flags":null,"type":"*accounts"}],"enabled":false,"field_separator":",","id":"*default","lockfile_path":".cgr.lck","opts":{"*cache":"","*forceLock":false,"*stopOnError":false,"*withIndex":true},"run_delay":"0","tenant":"","tp_in_dir":"/var/spool/cgrates/loader/in","tp_out_dir":"/var/spool/cgrates/loader/out"}]}` + cfgStr := `{"loaders":[{"action":"*store","cache":{"*accounts":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*action_profiles":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*attributes":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*chargers":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*filters":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*rankings":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*rate_profiles":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*resources":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*routes":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*stats":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*thresholds":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"},"*trends":{"limit":-1,"precache":false,"remote":false,"replicate":false,"static_ttl":false,"ttl":"5s"}},"caches_conns":["*internal"],"data":[{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"new_branch":true,"path":"Rules.Type","tag":"Type","type":"*variable","value":"~*req.2"},{"path":"Rules.Element","tag":"Element","type":"*variable","value":"~*req.3"},{"path":"Rules.Values","tag":"Values","type":"*variable","value":"~*req.4"}],"file_name":"Filters.csv","flags":null,"type":"*filters"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"TenantID","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ProfileID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"new_branch":true,"path":"Attributes.FilterIDs","tag":"AttributeFilterIDs","type":"*variable","value":"~*req.5"},{"path":"Attributes.Blockers","tag":"AttributeBlockers","type":"*variable","value":"~*req.6"},{"path":"Attributes.Path","tag":"Path","type":"*variable","value":"~*req.7"},{"path":"Attributes.Type","tag":"Type","type":"*variable","value":"~*req.8"},{"path":"Attributes.Value","tag":"Value","type":"*variable","value":"~*req.9"}],"file_name":"Attributes.csv","flags":null,"type":"*attributes"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"UsageTTL","tag":"TTL","type":"*variable","value":"~*req.4"},{"path":"Limit","tag":"Limit","type":"*variable","value":"~*req.5"},{"path":"AllocationMessage","tag":"AllocationMessage","type":"*variable","value":"~*req.6"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.7"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.8"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.9"}],"file_name":"Resources.csv","flags":null,"type":"*resources"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"QueueLength","tag":"QueueLength","type":"*variable","value":"~*req.5"},{"path":"TTL","tag":"TTL","type":"*variable","value":"~*req.6"},{"path":"MinItems","tag":"MinItems","type":"*variable","value":"~*req.7"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.8"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.9"},{"new_branch":true,"path":"Metrics.MetricID","tag":"MetricIDs","type":"*variable","value":"~*req.10"},{"path":"Metrics.FilterIDs","tag":"MetricFilterIDs","type":"*variable","value":"~*req.11"},{"path":"Metrics.Blockers","tag":"MetricBlockers","type":"*variable","value":"~*req.12"}],"file_name":"Stats.csv","flags":null,"type":"*stats"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"MaxHits","tag":"MaxHits","type":"*variable","value":"~*req.4"},{"path":"MinHits","tag":"MinHits","type":"*variable","value":"~*req.5"},{"path":"MinSleep","tag":"MinSleep","type":"*variable","value":"~*req.6"},{"path":"Blocker","tag":"Blocker","type":"*variable","value":"~*req.7"},{"path":"ActionProfileIDs","tag":"ActionProfileIDs","type":"*variable","value":"~*req.8"},{"path":"Async","tag":"Async","type":"*variable","value":"~*req.9"}],"file_name":"Thresholds.csv","flags":null,"type":"*thresholds"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.2"},{"path":"StatID","tag":"StatID","type":"*variable","value":"~*req.3"},{"path":"Metrics","tag":"Metrics","type":"*variable","value":"~*req.4"},{"path":"TTL","tag":"TTL","type":"*variable","value":"~*req.5"},{"path":"QueueLength","tag":"QueueLength","type":"*variable","value":"~*req.6"},{"path":"MinItems","tag":"MinItems","type":"*variable","value":"~*req.7"},{"path":"CorrelationType","tag":"CorrelationType","type":"*variable","value":"~*req.8"},{"path":"Tolerance","tag":"Tolerance","type":"*variable","value":"~*req.9"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.10"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.11"}],"file_name":"Trends.csv","flags":null,"type":"*trends"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.2"},{"path":"StatIDs","tag":"StatIDs","type":"*variable","value":"~*req.3"},{"path":"MetricIDs","tag":"MetricIDs","type":"*variable","value":"~*req.4"},{"path":"Sorting","tag":"Sorting","type":"*variable","value":"~*req.5"},{"path":"SortingParameters","tag":"SortingParameters","type":"*variable","value":"~*req.6"},{"path":"Stored","tag":"Stored","type":"*variable","value":"~*req.7"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.8"}],"file_name":"Rankings.csv","flags":null,"type":"*rankings"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"Sorting","tag":"Sorting","type":"*variable","value":"~*req.5"},{"path":"SortingParameters","tag":"SortingParameters","type":"*variable","value":"~*req.6"},{"new_branch":true,"path":"Routes.ID","tag":"RouteID","type":"*variable","value":"~*req.7"},{"path":"Routes.FilterIDs","tag":"RouteFilterIDs","type":"*variable","value":"~*req.8"},{"path":"Routes.AccountIDs","tag":"RouteAccountIDs","type":"*variable","value":"~*req.9"},{"path":"Routes.RateProfileIDs","tag":"RouteRateProfileIDs","type":"*variable","value":"~*req.10"},{"path":"Routes.ResourceIDs","tag":"RouteResourceIDs","type":"*variable","value":"~*req.11"},{"path":"Routes.StatIDs","tag":"RouteStatIDs","type":"*variable","value":"~*req.12"},{"path":"Routes.Weights","tag":"RouteWeights","type":"*variable","value":"~*req.13"},{"path":"Routes.Blockers","tag":"RouteBlockers","type":"*variable","value":"~*req.14"},{"path":"Routes.RouteParameters","tag":"RouteParameters","type":"*variable","value":"~*req.15"}],"file_name":"Routes.csv","flags":null,"type":"*routes"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"RunID","tag":"RunID","type":"*variable","value":"~*req.5"},{"path":"AttributeIDs","tag":"AttributeIDs","type":"*variable","value":"~*req.6"}],"file_name":"Chargers.csv","flags":null,"type":"*chargers"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"MinCost","tag":"MinCost","type":"*variable","value":"~*req.4"},{"path":"MaxCost","tag":"MaxCost","type":"*variable","value":"~*req.5"},{"path":"MaxCostStrategy","tag":"MaxCostStrategy","type":"*variable","value":"~*req.6"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].FilterIDs","tag":"RateFilterIDs","type":"*variable","value":"~*req.8"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].ActivationTimes","tag":"RateActivationTimes","type":"*variable","value":"~*req.9"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].Weights","tag":"RateWeights","type":"*variable","value":"~*req.10"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].Blocker","tag":"RateBlocker","type":"*variable","value":"~*req.11"},{"filters":["*notempty:~*req.7:"],"new_branch":true,"path":"Rates[\u003c~*req.7\u003e].IntervalRates.IntervalStart","tag":"RateIntervalStart","type":"*variable","value":"~*req.12"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.FixedFee","tag":"RateFixedFee","type":"*variable","value":"~*req.13"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.RecurrentFee","tag":"RateRecurrentFee","type":"*variable","value":"~*req.14"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.Unit","tag":"RateUnit","type":"*variable","value":"~*req.15"},{"filters":["*notempty:~*req.7:"],"path":"Rates[\u003c~*req.7\u003e].IntervalRates.Increment","tag":"RateIncrement","type":"*variable","value":"~*req.16"}],"file_name":"Rates.csv","flags":null,"type":"*rate_profiles"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"Schedule","tag":"Schedule","type":"*variable","value":"~*req.5"},{"path":"Targets[\u003c~*req.6\u003e]","tag":"TargetIDs","type":"*variable","value":"~*req.7"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].FilterIDs","tag":"ActionFilterIDs","type":"*variable","value":"~*req.9"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].TTL","tag":"ActionTTL","type":"*variable","value":"~*req.10"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Type","tag":"ActionType","type":"*variable","value":"~*req.11"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Opts","tag":"ActionOpts","type":"*variable","value":"~*req.12"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Weights","tag":"ActionWeights","type":"*variable","value":"~*req.13"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Blockers","tag":"ActionBlockers","type":"*variable","value":"~*req.14"},{"filters":["*notempty:~*req.8:"],"new_branch":true,"path":"Actions[\u003c~*req.8\u003e].Diktats.ID","tag":"ActionDiktatsID","type":"*variable","value":"~*req.15"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Diktats.FilterIDs","tag":"ActionDiktatsFilterIDs","type":"*variable","value":"~*req.16"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Diktats.Opts","tag":"ActionDiktatsOpts","type":"*variable","value":"~*req.17"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Diktats.Weights","tag":"ActionDiktatsWeights","type":"*variable","value":"~*req.18"},{"filters":["*notempty:~*req.8:"],"path":"Actions[\u003c~*req.8\u003e].Diktats.Blockers","tag":"ActionDiktatsBlockers","type":"*variable","value":"~*req.19"}],"file_name":"Actions.csv","flags":null,"type":"*action_profiles"},{"fields":[{"mandatory":true,"path":"Tenant","tag":"Tenant","type":"*variable","value":"~*req.0"},{"mandatory":true,"path":"ID","tag":"ID","type":"*variable","value":"~*req.1"},{"path":"FilterIDs","tag":"FilterIDs","type":"*variable","value":"~*req.2"},{"path":"Weights","tag":"Weights","type":"*variable","value":"~*req.3"},{"path":"Blockers","tag":"Blockers","type":"*variable","value":"~*req.4"},{"path":"Opts","tag":"Opts","type":"*variable","value":"~*req.5"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].FilterIDs","tag":"BalanceFilterIDs","type":"*variable","value":"~*req.7"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Weights","tag":"BalanceWeights","type":"*variable","value":"~*req.8"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Blockers","tag":"BalanceBlockers","type":"*variable","value":"~*req.9"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Type","tag":"BalanceType","type":"*variable","value":"~*req.10"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Units","tag":"BalanceUnits","type":"*variable","value":"~*req.11"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].UnitFactors","tag":"BalanceUnitFactors","type":"*variable","value":"~*req.12"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].Opts","tag":"BalanceOpts","type":"*variable","value":"~*req.13"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].CostIncrements","tag":"BalanceCostIncrements","type":"*variable","value":"~*req.14"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].AttributeIDs","tag":"BalanceAttributeIDs","type":"*variable","value":"~*req.15"},{"filters":["*notempty:~*req.6:"],"path":"Balances[\u003c~*req.6\u003e].RateProfileIDs","tag":"BalanceRateProfileIDs","type":"*variable","value":"~*req.16"},{"path":"ThresholdIDs","tag":"ThresholdIDs","type":"*variable","value":"~*req.17"}],"file_name":"Accounts.csv","flags":null,"type":"*accounts"}],"enabled":false,"field_separator":",","id":"*default","lockfile_path":".cgr.lck","opts":{"*cache":"","*forceLock":false,"*stopOnError":false,"*withIndex":true},"run_delay":"0","tenant":"","tp_in_dir":"/var/spool/cgrates/loader/in","tp_out_dir":"/var/spool/cgrates/loader/out"}]}` var rpl string if err := testSectRPC.Call(context.Background(), utils.ConfigSv1GetConfigAsJSON, &config.SectionWithAPIOpts{ Tenant: "cgrates.org", diff --git a/general_tests/dynamic_thresholds_it_test.go b/general_tests/dynamic_thresholds_it_test.go index 9f9e52087..6ea8b29ed 100644 --- a/general_tests/dynamic_thresholds_it_test.go +++ b/general_tests/dynamic_thresholds_it_test.go @@ -43,20 +43,19 @@ func TestDynThdIT(t *testing.T) { case utils.MetaMongo: dbCfg = engine.MongoDBCfg case utils.MetaPostgres: - t.SkipNow() + dbCfg = engine.PostgresDBCfg default: t.Fatal("Unknown Database type") } - // buf := &bytes.Buffer{} ng := engine.TestEngine{ ConfigPath: path.Join(*utils.DataDir, "conf", "samples", "tutinternal"), DBCfg: dbCfg, Encoding: *utils.Encoding, - // LogBuffer: buf, + // LogBuffer: &bytes.Buffer{}, } // t.Cleanup(func() { - // t.Log(buf) + // t.Log(ng.LogBuffer) // }) client, _ := ng.Run(t) @@ -73,24 +72,39 @@ func TestDynThdIT(t *testing.T) { Type: utils.MetaSetBalance, Diktats: []*utils.APDiktat{ { - Path: "*balance.VOICE.ID", - Value: "testBalanceIDMonetary", + ID: "SetVoiceID", + Opts: map[string]any{ + "*balancePath": "*balance.VOICE.ID", + "*balanceValue": "testBalanceIDMonetary", + }, }, { - Path: "*balance.MONETARY.Type", - Value: utils.MetaConcrete, + ID: "SetMonetaryType", + Opts: map[string]any{ + "*balancePath": "*balance.MONETARY.Type", + "*balanceValue": utils.MetaConcrete, + }, }, { - Path: "*balance.MONETARY.Units", - Value: "1048576", + ID: "SetMonetaryUnits", + Opts: map[string]any{ + "*balancePath": "*balance.MONETARY.Units", + "*balanceValue": "1048576", + }, }, { - Path: "*balance.MONETARY.Weights", - Value: "`;2`", + ID: "SetMonetaryWeights", + Opts: map[string]any{ + "*balancePath": "*balance.MONETARY.Weights", + "*balanceValue": "`;2`", + }, }, { - Path: "*balance.MONETARY.CostIncrements", - Value: "`*string:~*req.ToR:*data;1024;0;0.01`", + ID: "SetMonetaryCostIncrements", + Opts: map[string]any{ + "*balancePath": "*balance.MONETARY.CostIncrements", + "*balanceValue": "`*string:~*req.ToR:*data;1024;0;0.01`", + }, }, }, }, @@ -99,28 +113,46 @@ func TestDynThdIT(t *testing.T) { Type: utils.MetaAddBalance, Diktats: []*utils.APDiktat{ { - Path: "*balance.VOICE.ID", - Value: "testBalanceID", + ID: "AddVoiceID", + Opts: map[string]any{ + "*balancePath": "*balance.VOICE.ID", + "*balanceValue": "testBalanceID", + }, }, { - Path: "*balance.VOICE.Type", - Value: utils.MetaAbstract, + ID: "AddVoiceType", + Opts: map[string]any{ + "*balancePath": "*balance.VOICE.Type", + "*balanceValue": utils.MetaAbstract, + }, }, { - Path: "*balance.VOICE.FilterIDs", - Value: "`*string:~*req.ToR:*voice`", + ID: "AddVoiceFilterIDs", + Opts: map[string]any{ + "*balancePath": "*balance.VOICE.FilterIDs", + "*balanceValue": "`*string:~*req.ToR:*voice`", + }, }, { - Path: "*balance.VOICE.Units", - Value: strconv.FormatInt((time.Hour).Nanoseconds(), 10), + ID: "AddVoiceUnits", + Opts: map[string]any{ + "*balancePath": "*balance.VOICE.Units", + "*balanceValue": strconv.FormatInt((time.Hour).Nanoseconds(), 10), + }, }, { - Path: "*balance.VOICE.Weights", - Value: "`;2`", + ID: "AddVoiceWeights", + Opts: map[string]any{ + "*balancePath": "*balance.VOICE.Weights", + "*balanceValue": "`;2`", + }, }, { - Path: "*balance.VOICE.CostIncrements", - Value: "`*string:~*req.ToR:*voice;1000000000;0;0.01`", + ID: "AddVoiceCostIncrements", + Opts: map[string]any{ + "*balancePath": "*balance.VOICE.CostIncrements", + "*balanceValue": "`*string:~*req.ToR:*voice;1000000000;0;0.01`", + }, }, }, }, @@ -177,8 +209,10 @@ func TestDynThdIT(t *testing.T) { Type: utils.MetaDynamicThreshold, Diktats: []*utils.APDiktat{ { - Path: "ExtraParameters", - Value: "*tenant;DYNAMICLY_THD_<~*req.Account>;*string:~*req.Account:1002;*string:~*req.Account:1002&10;1;1;1s;false;ACT_LOG_WARNING;true;~*opts", + ID: "CreateDynamicThreshold1001", + Opts: map[string]any{ + "*template": "*tenant;DYNAMICLY_THD_<~*req.Account>;*string:~*req.Account:1002;*string:~*req.Account:1002&10;1;1;1s;false;ACT_LOG_WARNING;true;~*opts", + }, }, }, }, @@ -187,8 +221,10 @@ func TestDynThdIT(t *testing.T) { Type: utils.MetaDynamicStats, Diktats: []*utils.APDiktat{ { - Path: "ExtraParameters", - Value: "*tenant;DYNAMICLY_STAT_<~*req.Account>;*string:~*req.Account:1002;*string:~*req.Account:1002&30;*string:~*req.Account:1002&true;100;-1;0;false;*none;*tcc&*tcd;*string:~*req.Account:1002;*string:~*req.Account:1002&true;~*opts", + ID: "CreateDynamicStat1001", + Opts: map[string]any{ + "*template": "*tenant;DYNAMICLY_STAT_<~*req.Account>;*string:~*req.Account:1002;*string:~*req.Account:1002&30;*string:~*req.Account:1002&true;100;-1;0;false;*none;*tcc&*tcd;*string:~*req.Account:1002;*string:~*req.Account:1002&true;~*opts", + }, }, }, }, @@ -197,8 +233,10 @@ func TestDynThdIT(t *testing.T) { Type: utils.MetaDynamicAttribute, Diktats: []*utils.APDiktat{ { - Path: "ExtraParameters", - Value: "*tenant;DYNAMICLY_ATTR_<~*req.Account>;*string:~*req.Account:<~*req.Account>;*string:~*req.Account:<~*req.Account>&30;*string:~*req.Account:<~*req.Account>&true;*string:~*req.Account:<~*req.Account>;*string:~*req.Account:<~*req.Account>&true;*req.Subject;*constant;SUPPLIER1;~*opts", + ID: "CreateDynamicAttribute1001", + Opts: map[string]any{ + "*template": "*tenant;DYNAMICLY_ATTR_<~*req.Account>;*string:~*req.Account:<~*req.Account>;*string:~*req.Account:<~*req.Account>&30;*string:~*req.Account:<~*req.Account>&true;*string:~*req.Account:<~*req.Account>;*string:~*req.Account:<~*req.Account>&true;*req.Subject;*constant;SUPPLIER1;~*opts", + }, }, }, }, @@ -207,8 +245,10 @@ func TestDynThdIT(t *testing.T) { Type: utils.MetaDynamicResource, Diktats: []*utils.APDiktat{ { - Path: "ExtraParameters", - Value: "*tenant;DYNAMICLY_RES_<~*req.Account>;*string:~*req.Account:<~*req.Account>;*string:~*req.Account:<~*req.Account>&30;5s;5;alloc_msg;true;true;THID1&THID2;~*opts", + ID: "CreateDynamicResource1001", + Opts: map[string]any{ + "*template": "*tenant;DYNAMICLY_RES_<~*req.Account>;*string:~*req.Account:<~*req.Account>;*string:~*req.Account:<~*req.Account>&30;5s;5;alloc_msg;true;true;THID1&THID2;~*opts", + }, }, }, }, diff --git a/general_tests/export_it_test.go b/general_tests/export_it_test.go index b96982283..8ba919006 100644 --- a/general_tests/export_it_test.go +++ b/general_tests/export_it_test.go @@ -577,8 +577,10 @@ func testExpVerifyActionProfiles(t *testing.T) { ID: "TOPUP", Type: utils.MetaAddBalance, Diktats: []*utils.APDiktat{{ - Path: utils.MetaBalance + utils.NestingSep + "TestBalance" + utils.NestingSep + utils.Units, - Value: "10", + Opts: map[string]any{ + "*balancePath": utils.MetaBalance + utils.NestingSep + "TestBalance" + utils.NestingSep + utils.Units, + "*balanceValue": "10", + }, }}, }, @@ -586,47 +588,59 @@ func testExpVerifyActionProfiles(t *testing.T) { ID: "SET_BALANCE_TEST_DATA", Type: utils.MetaSetBalance, Diktats: []*utils.APDiktat{{ - Path: utils.MetaBalance + utils.NestingSep + "TestDataBalance" + utils.NestingSep + utils.Type, - Value: utils.MetaData, + Opts: map[string]any{ + "*balancePath": utils.MetaBalance + utils.NestingSep + "TestDataBalance" + utils.NestingSep + utils.Type, + "*balanceValue": utils.MetaData, + }, }}, }, { ID: "TOPUP_TEST_DATA", Type: utils.MetaAddBalance, Diktats: []*utils.APDiktat{{ - Path: utils.MetaBalance + utils.NestingSep + "TestDataBalance" + utils.NestingSep + utils.Units, - Value: "1024", + Opts: map[string]any{ + "*balancePath": utils.MetaBalance + utils.NestingSep + "TestDataBalance" + utils.NestingSep + utils.Units, + "*balanceValue": "1024", + }, }}, }, { ID: "SET_BALANCE_TEST_VOICE", Type: utils.MetaSetBalance, Diktats: []*utils.APDiktat{{ - Path: utils.MetaBalance + utils.NestingSep + "TestVoiceBalance" + utils.NestingSep + utils.Type, - Value: utils.MetaVoice, + Opts: map[string]any{ + "*balancePath": utils.MetaBalance + utils.NestingSep + "TestVoiceBalance" + utils.NestingSep + utils.Type, + "*balanceValue": utils.MetaVoice, + }, }}, }, { ID: "TOPUP_TEST_VOICE", Type: utils.MetaAddBalance, Diktats: []*utils.APDiktat{{ - Path: utils.MetaBalance + utils.NestingSep + "TestVoiceBalance" + utils.NestingSep + utils.Units, - Value: "15m15s", + Opts: map[string]any{ + "*balancePath": utils.MetaBalance + utils.NestingSep + "TestVoiceBalance" + utils.NestingSep + utils.Units, + "*balanceValue": "15m15s", + }, }}, }, { ID: "SET_BALANCE_TEST_FILTERS", Type: utils.MetaSetBalance, Diktats: []*utils.APDiktat{{ - Path: utils.MetaBalance + utils.NestingSep + "TestVoiceBalance" + utils.NestingSep + utils.Filters, - Value: "*string:~*req.CustomField:500", + Opts: map[string]any{ + "*balancePath": utils.MetaBalance + utils.NestingSep + "TestVoiceBalance" + utils.NestingSep + utils.Filters, + "*balanceValue": "*string:~*req.CustomField:500", + }, }}, }, { ID: "TOPUP_REM_VOICE", Type: utils.MetaRemBalance, Diktats: []*utils.APDiktat{{ - Path: "TestVoiceBalance2", + Opts: map[string]any{ + "*balancePath": "TestVoiceBalance2", + }, }}, }, }, diff --git a/general_tests/offline_internal_it_test.go b/general_tests/offline_internal_it_test.go index 59fe8643b..5963ceaff 100644 --- a/general_tests/offline_internal_it_test.go +++ b/general_tests/offline_internal_it_test.go @@ -21,6 +21,7 @@ along with this program. If not, see package general_tests import ( + "bytes" "os" "path" "path/filepath" @@ -67,7 +68,7 @@ func TestOfflineInternal(t *testing.T) { // run with sudo if err := os.MkdirAll(dfltCfg.ConfigDBCfg().Opts.InternalDBDumpPath, 0755); err != nil { t.Fatal(err) } - // buf := &bytes.Buffer{} // to print logs + buf := &bytes.Buffer{} // to print logs // t.Cleanup(func() { // fmt.Println(buf) // }) @@ -76,7 +77,7 @@ func TestOfflineInternal(t *testing.T) { // run with sudo ConfigPath: pth, GracefulShutdown: true, Encoding: *utils.Encoding, - // LogBuffer: buf, + LogBuffer: buf, } client, cfg := ng.Run(t) time.Sleep(100 * time.Millisecond) diff --git a/resources/resources_it_test.go b/resources/resources_it_test.go index 9631a156e..47ef93567 100644 --- a/resources/resources_it_test.go +++ b/resources/resources_it_test.go @@ -605,7 +605,10 @@ func testResourceSSetActionProfile(t *testing.T) { Type: utils.MetaHTTPPost, Diktats: []*utils.APDiktat{ { - Path: rsSrv.URL, + ID: "HttpsPost", + Opts: map[string]any{ + "*url": rsSrv.URL, + }, }, }, TTL: time.Duration(time.Minute), diff --git a/tpes/tpe_actions_test.go b/tpes/tpe_actions_test.go index 52dddfd0f..2bd8f2a5d 100644 --- a/tpes/tpe_actions_test.go +++ b/tpes/tpe_actions_test.go @@ -53,8 +53,10 @@ func TestTPEnewTPActions(t *testing.T) { Type: utils.MetaSetBalance, Diktats: []*utils.APDiktat{ { - Path: "MONETARY", - Value: "10", + Opts: map[string]any{ + "*balancePath": "MONETARY", + "*balanceValue": "10", + }, }}, }, }, @@ -97,8 +99,10 @@ func TestTPEExportItemsActions(t *testing.T) { Type: utils.MetaSetBalance, Diktats: []*utils.APDiktat{ { - Path: "MONETARY", - Value: "10", + Opts: map[string]any{ + "*balancePath": "MONETARY", + "*balanceValue": "10", + }, }}, }, }, @@ -150,8 +154,10 @@ func TestTPEExportItemsActionsNoDbConn(t *testing.T) { Type: utils.MetaSetBalance, Diktats: []*utils.APDiktat{ { - Path: "MONETARY", - Value: "10", + Opts: map[string]any{ + "*balancePath": "MONETARY", + "*balanceValue": "10", + }, }}, }, }, @@ -189,8 +195,10 @@ func TestTPEExportItemsActionsIDNotFound(t *testing.T) { Type: utils.MetaSetBalance, Diktats: []*utils.APDiktat{ { - Path: "MONETARY", - Value: "10", + Opts: map[string]any{ + "*balancePath": "MONETARY", + "*balanceValue": "10", + }, }}, }, }, diff --git a/tpes/tpes_test.go b/tpes/tpes_test.go index a6a44015e..e70656d32 100644 --- a/tpes/tpes_test.go +++ b/tpes/tpes_test.go @@ -103,8 +103,10 @@ func TestGetTariffPlansKeys(t *testing.T) { Type: utils.MetaSetBalance, Diktats: []*utils.APDiktat{ { - Path: "MONETARY", - Value: "10", + Opts: map[string]any{ + "*balancePath": "MONETARY", + "*balanceValue": "10", + }, }}, }, }, diff --git a/utils/actions_test.go b/utils/actions_test.go index 9c0447984..eacea7a8e 100644 --- a/utils/actions_test.go +++ b/utils/actions_test.go @@ -68,7 +68,9 @@ func TestActionAPDiktatRSRValuesNil(t *testing.T) { func TestActionAPDiktatRSRValuesError(t *testing.T) { apdDiktat := APDiktat{ - Value: "val`val2val3", + Opts: map[string]any{ + "*balanceValue": "val`val2val3", + }, } expErr := "Closed unspilit syntax" _, err := apdDiktat.RSRValues() @@ -78,7 +80,11 @@ func TestActionAPDiktatRSRValuesError(t *testing.T) { } func TestAPDiktatRSRValues(t *testing.T) { - dk := &APDiktat{Value: "1001"} + dk := &APDiktat{ + Opts: map[string]any{ + "*balanceValue": "1001", + }, + } if rply, err := dk.RSRValues(); err != nil { return } else if exp := NewRSRParsersMustCompile("1001", InfieldSep); !reflect.DeepEqual(exp, rply) { @@ -118,9 +124,33 @@ func TestActionProfileSet(t *testing.T) { "opt2": "val1", "opt3": MapStorage{"opt4": "val1"}, }, + Weights: DynamicWeights{ + { + Weight: 10, + }, + }, + Blockers: DynamicBlockers{ + { + Blocker: true, + }, + }, Diktats: []*APDiktat{{ - Path: "path", - Value: "val1", + ID: "dID", + FilterIDs: []string{"fltr1"}, + Opts: map[string]any{ + "*balancePath": "path", + "*balanceValue": "val1", + }, + Weights: DynamicWeights{ + { + Weight: 10, + }, + }, + Blockers: DynamicBlockers{ + { + Blocker: true, + }, + }, }}, }}, } @@ -149,6 +179,9 @@ func TestActionProfileSet(t *testing.T) { if err := ap.Set([]string{Weights}, ";10", false); err != nil { t.Error(err) } + if err := ap.Set([]string{Blockers}, ";true", false); err != nil { + t.Error(err) + } if err := ap.Set([]string{Targets + "[" + MetaAccounts + "]"}, "1001;1002", false); err != nil { t.Error(err) } @@ -191,20 +224,41 @@ func TestActionProfileSet(t *testing.T) { if err := ap.Set([]string{Actions, "acc1", TTL}, "10", false); err != nil { t.Error(err) } - if err := ap.Set([]string{Actions, "acc1", Diktats, Path}, "path", false); err != nil { + if err := ap.Set([]string{Actions, "acc1", Weights}, ";10", false); err != nil { + t.Error(err) + } + if err := ap.Set([]string{Actions, "acc1", Blockers}, ";true", false); err != nil { + t.Error(err) + } + if err := ap.Set([]string{Actions, "acc1", Diktats, ID}, "dID", false); err != nil { + t.Error(err) + } + if err := ap.Set([]string{Actions, "acc1", Diktats, FilterIDs}, "fltr1", false); err != nil { + t.Error(err) + } + if err := ap.Set([]string{Actions, "acc1", Diktats, Path}, "path", false); err != ErrWrongPath { t.Error(err) } - if err := ap.Set([]string{Actions, "acc1", Diktats, Value}, "val1", false); err != nil { + if err := ap.Set([]string{Actions, "acc1", Diktats, Value}, "val1", false); err != ErrWrongPath { + t.Error(err) + } + if err := ap.Set([]string{Actions, "acc1", Diktats, Opts}, "*balancePath:path", false); err != nil { + t.Error(err) + } + if err := ap.Set([]string{Actions, "acc1", Diktats, Opts, "*balanceValue"}, "val1", false); err != nil { + t.Error(err) + } + if err := ap.Set([]string{Actions, "acc1", Diktats, Weights}, ";10", false); err != nil { + t.Error(err) + } + if err := ap.Set([]string{Actions, "acc1", Diktats, Blockers}, ";true", false); err != nil { t.Error(err) } if err := ap.Actions[0].Set(nil, "", false); err != ErrWrongPath { t.Error(err) } - if err := ap.Set([]string{Blockers}, ";true", false); err != nil { - t.Error(err) - } if !reflect.DeepEqual(exp, ap) { t.Errorf("Expected %v \n but received \n %v", ToJSON(exp), ToJSON(ap)) } @@ -242,8 +296,10 @@ func TestActionProfileFieldAsInterface(t *testing.T) { "opt3": MapStorage{"opt4": "val1"}, }, Diktats: []*APDiktat{{ - Path: "path", - Value: "val1", + Opts: map[string]any{ + "*balancePath": "path", + "*balanceValue": "val1", + }, }}, }}, } @@ -412,18 +468,18 @@ func TestActionProfileFieldAsInterface(t *testing.T) { if _, err := ap.FieldAsInterface([]string{Actions + "[0]", Diktats + "[0]", "0"}); err != ErrNotFound { t.Fatal(err) } - if _, err := ap.FieldAsInterface([]string{Actions + "[0]", Diktats + "[a]", "0"}); err == nil || err.Error() != expErrMsg { + if _, err := ap.FieldAsInterface([]string{Actions + "[0]", Diktats + "[a]", FilterIDs + "[0]", "Blocker"}); err == nil || err.Error() != expErrMsg { t.Errorf("Expeceted: %v, received: %v", expErrMsg, err) } - if val, err := ap.FieldAsInterface([]string{Actions + "[0]", Diktats + "[0]", Path}); err != nil { + if val, err := ap.FieldAsInterface([]string{Actions + "[0]", Diktats + "[0]", Opts, "*balancePath"}); err != nil { t.Fatal(err) - } else if exp := ap.Actions[0].Diktats[0].Path; !reflect.DeepEqual(exp, val) { + } else if exp := ap.Actions[0].Diktats[0].Opts["*balancePath"]; !reflect.DeepEqual(exp, val) { t.Errorf("Expected %v \n but received \n %v", ToJSON(exp), ToJSON(val)) } - if val, err := ap.FieldAsInterface([]string{Actions + "[0]", Diktats + "[0]", Value}); err != nil { + if val, err := ap.FieldAsInterface([]string{Actions + "[0]", Diktats + "[0]", Opts, "*balanceValue"}); err != nil { t.Fatal(err) - } else if exp := ap.Actions[0].Diktats[0].Value; !reflect.DeepEqual(exp, val) { + } else if exp := ap.Actions[0].Diktats[0].Opts["*balanceValue"]; !reflect.DeepEqual(exp, val) { t.Errorf("Expected %v \n but received \n %v", ToJSON(exp), ToJSON(val)) } @@ -454,7 +510,7 @@ func TestActionProfileFieldAsInterface(t *testing.T) { if _, err := ap.Actions[0].Diktats[0].FieldAsString([]string{"", ""}); err != ErrNotFound { t.Fatal(err) } - if val, err := ap.Actions[0].Diktats[0].FieldAsString([]string{Path}); err != nil { + if val, err := ap.Actions[0].Diktats[0].FieldAsString([]string{Opts, "*balancePath"}); err != nil { t.Fatal(err) } else if exp := "path"; exp != val { t.Errorf("Expected %v \n but received \n %v", ToJSON(exp), ToJSON(val)) @@ -552,8 +608,10 @@ func TestActionProfileMergeAPActionMerge(t *testing.T) { }, Diktats: []*APDiktat{ { - Path: "path2", - Value: "value2", + Opts: map[string]any{ + "*balancePath": "path2", + "*balanceValue": "val2", + }, }, }, }, @@ -585,8 +643,10 @@ func TestActionProfileMergeAPActionMerge(t *testing.T) { }, Diktats: []*APDiktat{ { - Path: "path2", - Value: "value2", + Opts: map[string]any{ + "*balancePath": "path2", + "*balanceValue": "val2", + }, }, }, }, @@ -607,8 +667,10 @@ func TestActionProfileAPActionMergeEmptyV2(t *testing.T) { }, Diktats: []*APDiktat{ { - Path: "path", - Value: "value", + Opts: map[string]any{ + "*balancePath": "path", + "*balanceValue": "value", + }, }, }, } @@ -622,8 +684,10 @@ func TestActionProfileAPActionMergeEmptyV2(t *testing.T) { }, Diktats: []*APDiktat{ { - Path: "path", - Value: "value", + Opts: map[string]any{ + "*balancePath": "path", + "*balanceValue": "value", + }, }, }, } @@ -649,8 +713,10 @@ func TestActionProfileAPActionMergeEmptyV1(t *testing.T) { }, Diktats: []*APDiktat{ { - Path: "path", - Value: "value", + Opts: map[string]any{ + "*balancePath": "path", + "*balanceValue": "value", + }, }, }, } @@ -665,8 +731,10 @@ func TestActionProfileAPActionMergeEmptyV1(t *testing.T) { }, Diktats: []*APDiktat{ { - Path: "path", - Value: "value", + Opts: map[string]any{ + "*balancePath": "path", + "*balanceValue": "value", + }, }, }, }) @@ -685,10 +753,38 @@ func TestActionProfileAPActionMerge(t *testing.T) { Opts: map[string]any{ "key1": "value1", }, + Weights: DynamicWeights{ + { + FilterIDs: []string{"fltr2"}, + Weight: 40, + }, + }, + Blockers: DynamicBlockers{ + { + FilterIDs: []string{"fltr2"}, + Blocker: true, + }, + }, Diktats: []*APDiktat{ { - Path: "", - Value: "", + ID: "DID1", + FilterIDs: []string{"fltr1"}, + Opts: map[string]any{ + "*balancePath": "", + "*balanceValue": "", + }, + Weights: DynamicWeights{ + { + FilterIDs: []string{"fltr2"}, + Weight: 40, + }, + }, + Blockers: DynamicBlockers{ + { + FilterIDs: []string{"fltr2"}, + Blocker: true, + }, + }, }, }, } @@ -701,7 +797,54 @@ func TestActionProfileAPActionMerge(t *testing.T) { "key1": "value1", "key2": "value2", }, - Diktats: []*APDiktat{}, + Weights: DynamicWeights{ + { + FilterIDs: []string{"fltr2"}, + Weight: 40, + }, + { + Weight: 65, + }, + }, + Blockers: DynamicBlockers{ + { + FilterIDs: []string{"fltr2"}, + Blocker: true, + }, + { + FilterIDs: []string{"fltr3"}, + Blocker: true, + }, + }, + Diktats: []*APDiktat{ + { + ID: "DID1", + FilterIDs: []string{"fltr1", "fltr1"}, + Opts: map[string]any{ + "*balancePath": "", + "*balanceValue": "value1", + }, + Weights: DynamicWeights{ + { + FilterIDs: []string{"fltr2"}, + Weight: 40, + }, + { + Weight: 65, + }, + }, + Blockers: DynamicBlockers{ + { + FilterIDs: []string{"fltr2"}, + Blocker: true, + }, + { + FilterIDs: []string{"fltr3"}, + Blocker: true, + }, + }, + }, + }, } apAct.Merge(&APAction{ @@ -712,10 +855,36 @@ func TestActionProfileAPActionMerge(t *testing.T) { Opts: map[string]any{ "key2": "value2", }, + Weights: DynamicWeights{ + { + Weight: 65, + }, + }, + Blockers: DynamicBlockers{ + { + FilterIDs: []string{"fltr3"}, + Blocker: true, + }, + }, Diktats: []*APDiktat{ { - Path: "", - Value: "value1", + ID: "DID1", + FilterIDs: []string{"fltr1"}, + Opts: map[string]any{ + "*balancePath": "", + "*balanceValue": "value1", + }, + Weights: DynamicWeights{ + { + Weight: 65, + }, + }, + Blockers: DynamicBlockers{ + { + FilterIDs: []string{"fltr3"}, + Blocker: true, + }, + }, }, }, }) @@ -733,10 +902,58 @@ func TestActionProfileAPActionMerge(t *testing.T) { "key1": "value1", "key2": "value3", }, + Weights: DynamicWeights{ + { + FilterIDs: []string{"fltr2"}, + Weight: 40, + }, + { + Weight: 65, + }, + }, + Blockers: DynamicBlockers{ + { + FilterIDs: []string{"fltr2"}, + Blocker: true, + }, + { + FilterIDs: []string{"fltr3"}, + Blocker: true, + }, + }, Diktats: []*APDiktat{ { - Path: "path2", - Value: "value2", + ID: "DID1", + FilterIDs: []string{"fltr1", "fltr1"}, + Opts: map[string]any{ + "*balancePath": "", + "*balanceValue": "value1", + }, + Weights: DynamicWeights{ + { + FilterIDs: []string{"fltr2"}, + Weight: 40, + }, + { + Weight: 65, + }, + }, + Blockers: DynamicBlockers{ + { + FilterIDs: []string{"fltr2"}, + Blocker: true, + }, + { + FilterIDs: []string{"fltr3"}, + Blocker: true, + }, + }, + }, + { + Opts: map[string]any{ + "*balancePath": "path2", + "*balanceValue": "value2", + }, }, }, } @@ -750,8 +967,10 @@ func TestActionProfileAPActionMerge(t *testing.T) { }, Diktats: []*APDiktat{ { - Path: "path2", - Value: "value2", + Opts: map[string]any{ + "*balancePath": "path2", + "*balanceValue": "value2", + }, }, }, })