diff --git a/apis/loaders_it_test.go b/apis/loaders_it_test.go index cde2e2349..b89ef01ff 100644 --- a/apis/loaders_it_test.go +++ b/apis/loaders_it_test.go @@ -60,8 +60,8 @@ var ( testLoadersGetActionProfile, testLoadersGetAttributeProfile, testLoadersGetChargerProfile, - // testLoadersGetDispatcherProfile, - // testLoadersGetDispatcherHost, + testLoadersGetDispatcherProfile, + testLoadersGetDispatcherHost, testLoadersGetFilter, testLoadersGetRateProfile, testLoadersGetResourceProfile, @@ -69,21 +69,20 @@ var ( testLoadersGetStatQueueProfile, testLoadersGetThresholdProfile, - /* - testLoadersRemove, - testLoadersGetAccountAfterRemove, - testLoadersGetActionProfileAfterRemove, - testLoadersGetAttributeProfileAfterRemove, - testLoadersGetChargerProfileAfterRemove, - // testLoadersGetDispatcherProfileAfterRemove, - // testLoadersGetDispatcherHostAfterRemove, - testLoadersGetFilterAfterRemove, - testLoadersGetRateProfileAfterRemove, - testLoadersGetResourceProfileAfterRemove, - testLoadersGetRouteProfileAfterRemove, - testLoadersGetStatQueueProfileAfterRemove, - testLoadersGetThresholdProfileAfterRemove, - */ + testLoadersRemove, + testLoadersGetAccountAfterRemove, + testLoadersGetActionProfileAfterRemove, + testLoadersGetAttributeProfileAfterRemove, + testLoadersGetChargerProfileAfterRemove, + testLoadersGetDispatcherProfileAfterRemove, + testLoadersGetDispatcherHostAfterRemove, + testLoadersGetFilterAfterRemove, + testLoadersGetRateProfileAfterRemove, + testLoadersGetResourceProfileAfterRemove, + testLoadersGetRouteProfileAfterRemove, + testLoadersGetStatQueueProfileAfterRemove, + testLoadersGetThresholdProfileAfterRemove, + testLoadersRemoveFolders, testLoadersPing, @@ -472,77 +471,87 @@ func testLoadersGetChargerProfile(t *testing.T) { } } -// func testLoadersGetDispatcherProfile(t *testing.T) { -// expIDs := []string{"DSP1"} -// var dspPrfIDs []string -// if err := ldrRPC.Call(context.Background(), utils.AdminSv1GetDispatcherProfileIDs, -// &utils.PaginatorWithTenant{ -// Tenant: "cgrates.org", -// Paginator: utils.Paginator{}, -// }, &dspPrfIDs); err != nil { -// t.Error(err) -// } else if !reflect.DeepEqual(dspPrfIDs, expIDs) { -// t.Errorf("expected: <%+v>, \nreceived: <%+v>", expIDs, dspPrfIDs) -// } +func testLoadersGetDispatcherProfile(t *testing.T) { + expIDs := []string{"DSP1"} + var dspPrfIDs []string + if err := ldrRPC.Call(context.Background(), utils.AdminSv1GetDispatcherProfileIDs, + &utils.PaginatorWithTenant{ + Tenant: "cgrates.org", + Paginator: utils.Paginator{}, + }, &dspPrfIDs); err != nil { + t.Error(err) + } else if !reflect.DeepEqual(dspPrfIDs, expIDs) { + t.Errorf("expected: <%+v>, \nreceived: <%+v>", expIDs, dspPrfIDs) + } -// expDspPrf := engine.DispatcherProfile{ -// Tenant: "cgrates.org", -// ID: "DSP1", -// FilterIDs: []string{"FLTR_ACCOUNT_1001"}, -// Strategy: utils.MetaWeight, -// Hosts: engine.DispatcherHostProfiles{ -// { -// ID: "ALL", -// FilterIDs: []string{}, -// Weight: 20, -// Params: map[string]interface{}{}, -// }, -// }, -// Weight: 10, -// } + expDspPrf := engine.DispatcherProfile{ + Tenant: "cgrates.org", + ID: "DSP1", + FilterIDs: []string{"FLTR_ACCOUNT_1001"}, + Strategy: utils.MetaWeight, + StrategyParams: make(map[string]interface{}), + Hosts: engine.DispatcherHostProfiles{ + { + ID: "ALL", + FilterIDs: []string{}, + Weight: 20, + Params: map[string]interface{}{}, + }, + }, + Weight: 10, + } -// var rplyDspPrf engine.ChargerProfile -// if err := ldrRPC.Call(context.Background(), utils.AdminSv1GetDispatcherProfile, -// utils.TenantID{ -// Tenant: "cgrates.org", -// ID: expIDs[0], -// }, &rplyDspPrf); err != nil { -// t.Error(err) -// } else if !reflect.DeepEqual(rplyDspPrf, expDspPrf) { -// t.Errorf("expected: <%+v>, \nreceived: <%+v>", -// utils.ToJSON(expDspPrf), utils.ToJSON(rplyDspPrf)) -// } -// } + var rplyDspPrf engine.DispatcherProfile + if err := ldrRPC.Call(context.Background(), utils.AdminSv1GetDispatcherProfile, + utils.TenantID{ + Tenant: "cgrates.org", + ID: expIDs[0], + }, &rplyDspPrf); err != nil { + t.Error(err) + } else if !reflect.DeepEqual(rplyDspPrf, expDspPrf) { + t.Errorf("expected: <%+v>, \nreceived: <%+v>", + utils.ToJSON(expDspPrf), utils.ToJSON(rplyDspPrf)) + } +} -// func testLoadersGetDispatcherHost(t *testing.T) { -// expIDs := []string{"DSPHOST1"} -// var dspHostIDs []string -// if err := ldrRPC.Call(context.Background(), utils.AdminSv1GetDispatcherHostIDs, -// &utils.PaginatorWithTenant{ -// Tenant: "cgrates.org", -// Paginator: utils.Paginator{}, -// }, &dspHostIDs); err != nil { -// t.Error(err) -// } else if !reflect.DeepEqual(dspHostIDs, expIDs) { -// t.Errorf("expected: <%+v>, \nreceived: <%+v>", expIDs, dspHostIDs) -// } +func testLoadersGetDispatcherHost(t *testing.T) { + expIDs := []string{"DSPHOST1"} + var dspHostIDs []string + if err := ldrRPC.Call(context.Background(), utils.AdminSv1GetDispatcherHostIDs, + &utils.PaginatorWithTenant{ + Tenant: "cgrates.org", + Paginator: utils.Paginator{}, + }, &dspHostIDs); err != nil { + t.Error(err) + } else if !reflect.DeepEqual(dspHostIDs, expIDs) { + t.Errorf("expected: <%+v>, \nreceived: <%+v>", expIDs, dspHostIDs) + } -// expDspHost := engine.DispatcherHost{ -// Tenant: "cgrates.org", -// } + expDspHost := engine.DispatcherHost{ + Tenant: "cgrates.org", + RemoteHost: &config.RemoteHost{ + ID: expIDs[0], + Address: utils.MetaInternal, + Transport: utils.MetaJSON, + ConnectAttempts: 1, + Reconnects: 3, + ConnectTimeout: time.Minute, + ReplyTimeout: 2 * time.Minute, + }, + } -// var rplyDspHost engine.DispatcherHost -// if err := ldrRPC.Call(context.Background(), utils.AdminSv1GetDispatcherHost, -// utils.TenantID{ -// Tenant: "cgrates.org", -// ID: expIDs[0], -// }, &rplyDspHost); err != nil { -// t.Error(err) -// } else if !reflect.DeepEqual(rplyDspHost, expDspHost) { -// t.Errorf("expected: <%+v>, \nreceived: <%+v>", -// utils.ToJSON(expDspHost), utils.ToJSON(rplyDspHost)) -// } -// } + var rplyDspHost engine.DispatcherHost + if err := ldrRPC.Call(context.Background(), utils.AdminSv1GetDispatcherHost, + utils.TenantID{ + Tenant: "cgrates.org", + ID: expIDs[0], + }, &rplyDspHost); err != nil { + t.Error(err) + } else if !reflect.DeepEqual(rplyDspHost, expDspHost) { + t.Errorf("expected: <%+v>, \nreceived: <%+v>", + utils.ToJSON(expDspHost), utils.ToJSON(rplyDspHost)) + } +} func testLoadersGetFilter(t *testing.T) { expIDs := []string{"FLTR_ACCOUNT_1001"} @@ -810,6 +819,7 @@ func testLoadersRemove(t *testing.T) { var reply string if err := ldrRPC.Call(context.Background(), utils.LoaderSv1Run, //Remove, &loaders.ArgsProcessFolder{ + LoaderID: "remove", APIOpts: map[string]interface{}{ utils.MetaCache: utils.MetaReload, utils.MetaStopOnError: true, @@ -901,45 +911,45 @@ func testLoadersGetChargerProfileAfterRemove(t *testing.T) { } } -// func testLoadersGetDispatcherProfileAfterRemove(t *testing.T) { -// var dspPrfIDs []string -// if err := ldrRPC.Call(context.Background(), utils.AdminSv1GetDispatcherProfileIDs, -// &utils.PaginatorWithTenant{ -// Tenant: "cgrates.org", -// Paginator: utils.Paginator{}, -// }, &dspPrfIDs); err == nil || err.Error() != utils.ErrNotFound.Error() { -// t.Errorf("expected: <%+v>, \nreceived: <%+v>", utils.ErrNotFound, err) -// } +func testLoadersGetDispatcherProfileAfterRemove(t *testing.T) { + var dspPrfIDs []string + if err := ldrRPC.Call(context.Background(), utils.AdminSv1GetDispatcherProfileIDs, + &utils.PaginatorWithTenant{ + Tenant: "cgrates.org", + Paginator: utils.Paginator{}, + }, &dspPrfIDs); err == nil || err.Error() != utils.ErrNotFound.Error() { + t.Errorf("expected: <%+v>, \nreceived: <%+v>", utils.ErrNotFound, err) + } -// var rplyDspPrf engine.ChargerProfile -// if err := ldrRPC.Call(context.Background(), utils.AdminSv1GetDispatcherProfile, -// utils.TenantID{ -// Tenant: "cgrates.org", -// ID: "DSP1", -// }, &rplyDspPrf); err == nil || err.Error() != utils.ErrNotFound.Error() { -// t.Errorf("expected: <%+v>, \nreceived: <%+v>", utils.ErrNotFound, err) -// } -// } + var rplyDspPrf engine.ChargerProfile + if err := ldrRPC.Call(context.Background(), utils.AdminSv1GetDispatcherProfile, + utils.TenantID{ + Tenant: "cgrates.org", + ID: "DSP1", + }, &rplyDspPrf); err == nil || err.Error() != utils.ErrNotFound.Error() { + t.Errorf("expected: <%+v>, \nreceived: <%+v>", utils.ErrNotFound, err) + } +} -// func testLoadersGetDispatcherHostAfterRemove(t *testing.T) { -// var dspHostIDs []string -// if err := ldrRPC.Call(context.Background(), utils.AdminSv1GetDispatcherHostIDs, -// &utils.PaginatorWithTenant{ -// Tenant: "cgrates.org", -// Paginator: utils.Paginator{}, -// }, &dspHostIDs); err == nil || err.Error() != utils.ErrNotFound.Error() { -// t.Errorf("expected: <%+v>, \nreceived: <%+v>", utils.ErrNotFound, err) -// } +func testLoadersGetDispatcherHostAfterRemove(t *testing.T) { + var dspHostIDs []string + if err := ldrRPC.Call(context.Background(), utils.AdminSv1GetDispatcherHostIDs, + &utils.PaginatorWithTenant{ + Tenant: "cgrates.org", + Paginator: utils.Paginator{}, + }, &dspHostIDs); err == nil || err.Error() != utils.ErrNotFound.Error() { + t.Errorf("expected: <%+v>, \nreceived: <%+v>", utils.ErrNotFound, err) + } -// var rplyDspHost engine.DispatcherHost -// if err := ldrRPC.Call(context.Background(), utils.AdminSv1GetDispatcherHost, -// utils.TenantID{ -// Tenant: "cgrates.org", -// ID: "DSPHOST1", -// }, &rplyDspHost); err == nil || err.Error() != utils.ErrNotFound.Error() { -// t.Errorf("expected: <%+v>, \nreceived: <%+v>", utils.ErrNotFound, err) -// } -// } + var rplyDspHost engine.DispatcherHost + if err := ldrRPC.Call(context.Background(), utils.AdminSv1GetDispatcherHost, + utils.TenantID{ + Tenant: "cgrates.org", + ID: "DSPHOST1", + }, &rplyDspHost); err == nil || err.Error() != utils.ErrNotFound.Error() { + t.Errorf("expected: <%+v>, \nreceived: <%+v>", utils.ErrNotFound, err) + } +} func testLoadersGetFilterAfterRemove(t *testing.T) { var fltrIDs []string @@ -1123,7 +1133,4 @@ func TestLoadersLoad(t *testing.T) { t.Error(err) } - // if err := lSv1.Remove(context.Background(), args, &reply); err != nil { - // t.Error(err) - // } } diff --git a/data/conf/samples/apis_loaders_internal/cgrates.json b/data/conf/samples/apis_loaders_internal/cgrates.json index 3228ef09b..ac6322f2c 100644 --- a/data/conf/samples/apis_loaders_internal/cgrates.json +++ b/data/conf/samples/apis_loaders_internal/cgrates.json @@ -1,30 +1,110 @@ { - // CGRateS Configuration file - // will be used in apis/loaders_it_test.go - - "general": { - "log_level": 7, - }, +// CGRateS Configuration file +// will be used in apis/loaders_it_test.go - "data_db": { - "db_type": "*internal", - }, - - "stor_db": { - "db_type": "*internal", - }, - - "loaders": [ - { - "id": "*default", - "enabled": true, - "tenant": "cgrates.org", - "tp_in_dir": "/tmp/TestLoadersIT/in", - "tp_out_dir": "", - }, +"general": { + "log_level": 7, +}, + +"data_db": { + "db_type": "*internal", +}, + +"stor_db": { + "db_type": "*internal", +}, + +"loaders": [ + { + "id": "*default", + "enabled": true, + "tenant": "cgrates.org", + "tp_in_dir": "/tmp/TestLoadersIT/in", + "tp_out_dir": "", + }, + { + "id": "remove", + "action": "*remove", + "enabled": true, + "tenant": "cgrates.org", + "tp_in_dir": "/tmp/TestLoadersIT/in", + "tp_out_dir": "", + "data":[ + { + "type": "*attributes", + "file_name": "Attributes.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + { + "type": "*resources", + "file_name": "Resources.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + { + "type": "*stats", + "file_name": "Stats.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + { + "type": "*thresholds", + "file_name": "Thresholds.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + { + "type": "*routes", + "file_name": "Routes.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + { + "type": "*chargers", + "file_name": "Chargers.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + { + "type": "*dispatchers", + "file_name": "DispatcherProfiles.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + { + "type": "*dispatcher_hosts", + "file_name": "DispatcherHosts.csv", + "fields": [ + {"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}, + {"tag": "Address", "path": "Address", "type": "*variable", "value": "~*req.2"}, + ], + }, + { + "type": "*rate_profiles", + "file_name": "Rates.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + { + "type": "*action_profiles", + "file_name": "Actions.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + { + "type": "*accounts", + "file_name": "Accounts.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + { + "type": "*filters", + "file_name": "Filters.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, ], + }, +], - "admins": { - "enabled": true, - } - } \ No newline at end of file +"templates": { + "baseTmpl": [ + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "ID", "path": "ID", "type": "*variable", "value": "~*req.1", "mandatory": true} + ] +}, + +"admins": { + "enabled": true, +} +} \ No newline at end of file diff --git a/data/conf/samples/apis_loaders_mongo/cgrates.json b/data/conf/samples/apis_loaders_mongo/cgrates.json index de65572ac..8e06573d3 100644 --- a/data/conf/samples/apis_loaders_mongo/cgrates.json +++ b/data/conf/samples/apis_loaders_mongo/cgrates.json @@ -1,34 +1,114 @@ { - // CGRateS Configuration file - // will be used in apis/loaders_it_test.go - - "general": { - "log_level": 7, - }, +// CGRateS Configuration file +// will be used in apis/loaders_it_test.go - "data_db": { - "db_type": "mongo", - "db_name": "10", - "db_port": 27017, - }, - - "stor_db": { - "db_type": "mongo", - "db_name": "cgrates", - "db_port": 27017, - }, - - "loaders": [ - { - "id": "*default", - "enabled": true, - "tenant": "cgrates.org", - "tp_in_dir": "/tmp/TestLoadersIT/in", - "tp_out_dir": "", - }, - ], +"general": { + "log_level": 7, +}, - "admins": { +"data_db": { + "db_type": "mongo", + "db_name": "10", + "db_port": 27017, +}, + +"stor_db": { + "db_type": "mongo", + "db_name": "cgrates", + "db_port": 27017, +}, + +"loaders": [ + { + "id": "*default", "enabled": true, - } + "tenant": "cgrates.org", + "tp_in_dir": "/tmp/TestLoadersIT/in", + "tp_out_dir": "", + }, + { + "id": "remove", + "action": "*remove", + "enabled": true, + "tenant": "cgrates.org", + "tp_in_dir": "/tmp/TestLoadersIT/in", + "tp_out_dir": "", + "data":[ + { + "type": "*attributes", + "file_name": "Attributes.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + { + "type": "*resources", + "file_name": "Resources.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + { + "type": "*stats", + "file_name": "Stats.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + { + "type": "*thresholds", + "file_name": "Thresholds.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + { + "type": "*routes", + "file_name": "Routes.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + { + "type": "*chargers", + "file_name": "Chargers.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + { + "type": "*dispatchers", + "file_name": "DispatcherProfiles.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + { + "type": "*dispatcher_hosts", + "file_name": "DispatcherHosts.csv", + "fields": [ + {"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}, + {"tag": "Address", "path": "Address", "type": "*variable", "value": "~*req.2"}, + ], + }, + { + "type": "*rate_profiles", + "file_name": "Rates.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + { + "type": "*action_profiles", + "file_name": "Actions.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + { + "type": "*accounts", + "file_name": "Accounts.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + { + "type": "*filters", + "file_name": "Filters.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + ], + }, +], + +"templates": { + "baseTmpl": [ + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "ID", "path": "ID", "type": "*variable", "value": "~*req.1", "mandatory": true} + ] +}, + +"admins": { + "enabled": true, +} } \ No newline at end of file diff --git a/data/conf/samples/apis_loaders_mysql/cgrates.json b/data/conf/samples/apis_loaders_mysql/cgrates.json index 8bf19d129..9a6ab16ef 100644 --- a/data/conf/samples/apis_loaders_mysql/cgrates.json +++ b/data/conf/samples/apis_loaders_mysql/cgrates.json @@ -1,31 +1,111 @@ { - // CGRateS Configuration file - // will be used in apis/loaders_it_test.go - "general": { - "log_level": 7, - }, +// CGRateS Configuration file +// will be used in apis/loaders_it_test.go +"general": { + "log_level": 7, +}, - "data_db": { // database used to store runtime data (eg: accounts, cdr stats) - "db_type": "redis", // data_db type: - "db_port": 6379, // data_db port to reach the database - "db_name": "10", // data_db database name to connect to - }, - - "stor_db": { - "db_password": "CGRateS.org", - }, +"data_db": { // database used to store runtime data (eg: accounts, cdr stats) + "db_type": "redis", // data_db type: + "db_port": 6379, // data_db port to reach the database + "db_name": "10", // data_db database name to connect to +}, - "loaders": [ - { - "id": "*default", - "enabled": true, - "tenant": "cgrates.org", - "tp_in_dir": "/tmp/TestLoadersIT/in", - "tp_out_dir": "", - }, - ], +"stor_db": { + "db_password": "CGRateS.org", +}, - "admins": { +"loaders": [ + { + "id": "*default", "enabled": true, - } -} \ No newline at end of file + "tenant": "cgrates.org", + "tp_in_dir": "/tmp/TestLoadersIT/in", + "tp_out_dir": "", + }, + { + "id": "remove", + "action": "*remove", + "enabled": true, + "tenant": "cgrates.org", + "tp_in_dir": "/tmp/TestLoadersIT/in", + "tp_out_dir": "", + "data":[ + { + "type": "*attributes", + "file_name": "Attributes.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + { + "type": "*resources", + "file_name": "Resources.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + { + "type": "*stats", + "file_name": "Stats.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + { + "type": "*thresholds", + "file_name": "Thresholds.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + { + "type": "*routes", + "file_name": "Routes.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + { + "type": "*chargers", + "file_name": "Chargers.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + { + "type": "*dispatchers", + "file_name": "DispatcherProfiles.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + { + "type": "*dispatcher_hosts", + "file_name": "DispatcherHosts.csv", + "fields": [ + {"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}, + {"tag": "Address", "path": "Address", "type": "*variable", "value": "~*req.2"}, + ], + }, + { + "type": "*rate_profiles", + "file_name": "Rates.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + { + "type": "*action_profiles", + "file_name": "Actions.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + { + "type": "*accounts", + "file_name": "Accounts.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + { + "type": "*filters", + "file_name": "Filters.csv", + "fields": [{"tag": "BaseTmpl","type": "*template", "value": "baseTmpl"}], + }, + ], + }, +], + +"templates": { + "baseTmpl": [ + {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true}, + {"tag": "ID", "path": "ID", "type": "*variable", "value": "~*req.1", "mandatory": true} + ] +}, + +"admins": { + "enabled": true, +} +} diff --git a/general_tests/accounts_it_test.go b/general_tests/accounts_it_test.go index 6ee467bc6..b50b2ff80 100644 --- a/general_tests/accounts_it_test.go +++ b/general_tests/accounts_it_test.go @@ -137,10 +137,12 @@ func testV1AccLoadTarrifPlans(t *testing.T) { caching = utils.MetaNone } var reply string - if err := accRpc.Call(context.Background(), utils.LoaderSv1Load, + if err := accRpc.Call(context.Background(), utils.LoaderSv1Run, &loaders.ArgsProcessFolder{ - StopOnError: true, - Caching: utils.StringPointer(caching), + APIOpts: map[string]interface{}{ + utils.MetaStopOnError: true, + utils.MetaCache: caching, + }, }, &reply); err != nil { t.Error(err) } else if reply != utils.OK { diff --git a/general_tests/all_sections_cfg_rld_it_test.go b/general_tests/all_sections_cfg_rld_it_test.go index 72c1857f3..1bf1c0e52 100644 --- a/general_tests/all_sections_cfg_rld_it_test.go +++ b/general_tests/all_sections_cfg_rld_it_test.go @@ -913,7 +913,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,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*action_profiles\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*attributes\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*chargers\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*dispatcher_hosts\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*dispatchers\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*filters\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*rate_profiles\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*resources\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*routes\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*stats\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*thresholds\":{\"limit\":-1,\"precache\":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\"},{\"path\":\"Type\",\"tag\":\"Type\",\"type\":\"*variable\",\"value\":\"~*req.2\"},{\"path\":\"Element\",\"tag\":\"Element\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"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\":\"Weight\",\"tag\":\"Weight\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"AttributeFilterIDs\",\"tag\":\"AttributeFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"Path\",\"tag\":\"Path\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"Type\",\"tag\":\"Type\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"Value\",\"tag\":\"Value\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"Blocker\",\"tag\":\"Blocker\",\"type\":\"*variable\",\"value\":\"~*req.8\"}],\"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\":\"Weight\",\"tag\":\"Weight\",\"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\":\"Weight\",\"tag\":\"Weight\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"QueueLength\",\"tag\":\"QueueLength\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"TTL\",\"tag\":\"TTL\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"MinItems\",\"tag\":\"MinItems\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"MetricIDs\",\"tag\":\"MetricIDs\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"MetricFilterIDs\",\"tag\":\"MetricFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"Blocker\",\"tag\":\"Blocker\",\"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\":\"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\":\"Weight\",\"tag\":\"Weight\",\"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\":\"FilterIDs\",\"tag\":\"FilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.2\"},{\"path\":\"Weights\",\"tag\":\"Weights\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"Sorting\",\"tag\":\"Sorting\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"SortingParameters\",\"tag\":\"SortingParameters\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"RouteID\",\"tag\":\"RouteID\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"RouteFilterIDs\",\"tag\":\"RouteFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"RouteAccountIDs\",\"tag\":\"RouteAccountIDs\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"RouteRateProfileIDs\",\"tag\":\"RouteRateProfileIDs\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"path\":\"RouteResourceIDs\",\"tag\":\"RouteResourceIDs\",\"type\":\"*variable\",\"value\":\"~*req.10\"},{\"path\":\"RouteStatIDs\",\"tag\":\"RouteStatIDs\",\"type\":\"*variable\",\"value\":\"~*req.11\"},{\"path\":\"RouteWeights\",\"tag\":\"RouteWeights\",\"type\":\"*variable\",\"value\":\"~*req.12\"},{\"path\":\"RouteBlocker\",\"tag\":\"RouteBlocker\",\"type\":\"*variable\",\"value\":\"~*req.13\"},{\"path\":\"RouteParameters\",\"tag\":\"RouteParameters\",\"type\":\"*variable\",\"value\":\"~*req.14\"}],\"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\":\"Weight\",\"tag\":\"Weight\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"RunID\",\"tag\":\"RunID\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"AttributeIDs\",\"tag\":\"AttributeIDs\",\"type\":\"*variable\",\"value\":\"~*req.5\"}],\"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\":\"Weight\",\"tag\":\"Weight\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"Strategy\",\"tag\":\"Strategy\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"StrategyParameters\",\"tag\":\"StrategyParameters\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"ConnID\",\"tag\":\"ConnID\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"ConnFilterIDs\",\"tag\":\"ConnFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"ConnWeight\",\"tag\":\"ConnWeight\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"ConnBlocker\",\"tag\":\"ConnBlocker\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"path\":\"ConnParameters\",\"tag\":\"ConnParameters\",\"type\":\"*variable\",\"value\":\"~*req.10\"}],\"file_name\":\"DispatcherProfiles.csv\",\"flags\":null,\"type\":\"*dispatchers\"},{\"fields\":[{\"mandatory\":true,\"path\":\"Tenant\",\"tag\":\"Tenant\",\"type\":\"*variable\",\"value\":\"~*req.0\"},{\"mandatory\":true,\"path\":\"ID\",\"tag\":\"ID\",\"type\":\"*variable\",\"value\":\"~*req.1\"},{\"path\":\"Address\",\"tag\":\"Address\",\"type\":\"*variable\",\"value\":\"~*req.2\"},{\"path\":\"Transport\",\"tag\":\"Transport\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"ConnectAttempts\",\"tag\":\"ConnectAttempts\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"Reconnects\",\"tag\":\"Reconnects\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"ConnectTimeout\",\"tag\":\"ConnectTimeout\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"ReplyTimeout\",\"tag\":\"ReplyTimeout\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"TLS\",\"tag\":\"TLS\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"ClientKey\",\"tag\":\"ClientKey\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"path\":\"ClientCertificate\",\"tag\":\"ClientCertificate\",\"type\":\"*variable\",\"value\":\"~*req.10\"},{\"path\":\"CaCertificate\",\"tag\":\"CaCertificate\",\"type\":\"*variable\",\"value\":\"~*req.11\"}],\"file_name\":\"DispatcherHosts.csv\",\"flags\":null,\"type\":\"*dispatcher_hosts\"},{\"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\":\"Weight\",\"tag\":\"Weight\",\"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\"},{\"path\":\"RateID\",\"tag\":\"RateID\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"RateFilterIDs\",\"tag\":\"RateFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"RateActivationTimes\",\"tag\":\"RateActivationTimes\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"path\":\"RateWeight\",\"tag\":\"RateWeight\",\"type\":\"*variable\",\"value\":\"~*req.10\"},{\"path\":\"RateBlocker\",\"tag\":\"RateBlocker\",\"type\":\"*variable\",\"value\":\"~*req.11\"},{\"path\":\"RateIntervalStart\",\"tag\":\"RateIntervalStart\",\"type\":\"*variable\",\"value\":\"~*req.12\"},{\"path\":\"RateFixedFee\",\"tag\":\"RateFixedFee\",\"type\":\"*variable\",\"value\":\"~*req.13\"},{\"path\":\"RateRecurrentFee\",\"tag\":\"RateRecurrentFee\",\"type\":\"*variable\",\"value\":\"~*req.14\"},{\"path\":\"RateUnit\",\"tag\":\"RateUnit\",\"type\":\"*variable\",\"value\":\"~*req.15\"},{\"path\":\"RateIncrement\",\"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\":\"Weight\",\"tag\":\"Weight\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"Schedule\",\"tag\":\"Schedule\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"TargetType\",\"tag\":\"TargetType\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"TargetIDs\",\"tag\":\"TargetIDs\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"ActionID\",\"tag\":\"ActionID\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"ActionFilterIDs\",\"tag\":\"ActionFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"ActionBlocker\",\"tag\":\"ActionBlocker\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"path\":\"ActionTTL\",\"tag\":\"ActionTTL\",\"type\":\"*variable\",\"value\":\"~*req.10\"},{\"path\":\"ActionType\",\"tag\":\"ActionType\",\"type\":\"*variable\",\"value\":\"~*req.11\"},{\"path\":\"ActionOpts\",\"tag\":\"ActionOpts\",\"type\":\"*variable\",\"value\":\"~*req.12\"},{\"path\":\"ActionPath\",\"tag\":\"ActionPath\",\"type\":\"*variable\",\"value\":\"~*req.13\"},{\"path\":\"ActionValue\",\"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\":\"Opts\",\"tag\":\"Opts\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"BalanceID\",\"tag\":\"BalanceID\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"BalanceFilterIDs\",\"tag\":\"BalanceFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"BalanceWeights\",\"tag\":\"BalanceWeights\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"BalanceType\",\"tag\":\"BalanceType\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"BalanceUnits\",\"tag\":\"BalanceUnits\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"path\":\"BalanceUnitFactors\",\"tag\":\"BalanceUnitFactors\",\"type\":\"*variable\",\"value\":\"~*req.10\"},{\"path\":\"BalanceOpts\",\"tag\":\"BalanceOpts\",\"type\":\"*variable\",\"value\":\"~*req.11\"},{\"path\":\"BalanceCostIncrements\",\"tag\":\"BalanceCostIncrements\",\"type\":\"*variable\",\"value\":\"~*req.12\"},{\"path\":\"BalanceAttributeIDs\",\"tag\":\"BalanceAttributeIDs\",\"type\":\"*variable\",\"value\":\"~*req.13\"},{\"path\":\"BalanceRateProfileIDs\",\"tag\":\"BalanceRateProfileIDs\",\"type\":\"*variable\",\"value\":\"~*req.14\"},{\"path\":\"ThresholdIDs\",\"tag\":\"ThresholdIDs\",\"type\":\"*variable\",\"value\":\"~*req.15\"}],\"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,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*action_profiles\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*attributes\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*chargers\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*dispatcher_hosts\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*dispatchers\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*filters\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*rate_profiles\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*resources\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*routes\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*stats\":{\"limit\":-1,\"precache\":false,\"replicate\":false,\"static_ttl\":false,\"ttl\":\"5s\"},\"*thresholds\":{\"limit\":-1,\"precache\":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\"},{\"path\":\"Type\",\"tag\":\"Type\",\"type\":\"*variable\",\"value\":\"~*req.2\"},{\"path\":\"Element\",\"tag\":\"Element\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"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\":\"Weight\",\"tag\":\"Weight\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"AttributeFilterIDs\",\"tag\":\"AttributeFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"Path\",\"tag\":\"Path\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"Type\",\"tag\":\"Type\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"Value\",\"tag\":\"Value\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"Blocker\",\"tag\":\"Blocker\",\"type\":\"*variable\",\"value\":\"~*req.8\"}],\"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\":\"Weight\",\"tag\":\"Weight\",\"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\":\"Weight\",\"tag\":\"Weight\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"QueueLength\",\"tag\":\"QueueLength\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"TTL\",\"tag\":\"TTL\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"MinItems\",\"tag\":\"MinItems\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"MetricIDs\",\"tag\":\"MetricIDs\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"MetricFilterIDs\",\"tag\":\"MetricFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"Blocker\",\"tag\":\"Blocker\",\"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\":\"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\":\"Weight\",\"tag\":\"Weight\",\"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\":\"FilterIDs\",\"tag\":\"FilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.2\"},{\"path\":\"Weights\",\"tag\":\"Weights\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"Sorting\",\"tag\":\"Sorting\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"SortingParameters\",\"tag\":\"SortingParameters\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"RouteID\",\"tag\":\"RouteID\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"RouteFilterIDs\",\"tag\":\"RouteFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"RouteAccountIDs\",\"tag\":\"RouteAccountIDs\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"RouteRateProfileIDs\",\"tag\":\"RouteRateProfileIDs\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"path\":\"RouteResourceIDs\",\"tag\":\"RouteResourceIDs\",\"type\":\"*variable\",\"value\":\"~*req.10\"},{\"path\":\"RouteStatIDs\",\"tag\":\"RouteStatIDs\",\"type\":\"*variable\",\"value\":\"~*req.11\"},{\"path\":\"RouteWeights\",\"tag\":\"RouteWeights\",\"type\":\"*variable\",\"value\":\"~*req.12\"},{\"path\":\"RouteBlocker\",\"tag\":\"RouteBlocker\",\"type\":\"*variable\",\"value\":\"~*req.13\"},{\"path\":\"RouteParameters\",\"tag\":\"RouteParameters\",\"type\":\"*variable\",\"value\":\"~*req.14\"}],\"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\":\"Weight\",\"tag\":\"Weight\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"RunID\",\"tag\":\"RunID\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"AttributeIDs\",\"tag\":\"AttributeIDs\",\"type\":\"*variable\",\"value\":\"~*req.5\"}],\"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\":\"Weight\",\"tag\":\"Weight\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"Strategy\",\"tag\":\"Strategy\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"StrategyParameters\",\"tag\":\"StrategyParameters\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"ConnID\",\"tag\":\"ConnID\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"ConnFilterIDs\",\"tag\":\"ConnFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"ConnWeight\",\"tag\":\"ConnWeight\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"ConnBlocker\",\"tag\":\"ConnBlocker\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"path\":\"ConnParameters\",\"tag\":\"ConnParameters\",\"type\":\"*variable\",\"value\":\"~*req.10\"}],\"file_name\":\"DispatcherProfiles.csv\",\"flags\":null,\"type\":\"*dispatchers\"},{\"fields\":[{\"mandatory\":true,\"path\":\"Tenant\",\"tag\":\"Tenant\",\"type\":\"*variable\",\"value\":\"~*req.0\"},{\"mandatory\":true,\"path\":\"ID\",\"tag\":\"ID\",\"type\":\"*variable\",\"value\":\"~*req.1\"},{\"path\":\"Address\",\"tag\":\"Address\",\"type\":\"*variable\",\"value\":\"~*req.2\"},{\"path\":\"Transport\",\"tag\":\"Transport\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"ConnectAttempts\",\"tag\":\"ConnectAttempts\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"Reconnects\",\"tag\":\"Reconnects\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"ConnectTimeout\",\"tag\":\"ConnectTimeout\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"ReplyTimeout\",\"tag\":\"ReplyTimeout\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"TLS\",\"tag\":\"TLS\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"ClientKey\",\"tag\":\"ClientKey\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"path\":\"ClientCertificate\",\"tag\":\"ClientCertificate\",\"type\":\"*variable\",\"value\":\"~*req.10\"},{\"path\":\"CaCertificate\",\"tag\":\"CaCertificate\",\"type\":\"*variable\",\"value\":\"~*req.11\"}],\"file_name\":\"DispatcherHosts.csv\",\"flags\":null,\"type\":\"*dispatcher_hosts\"},{\"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\"},{\"path\":\"RateID\",\"tag\":\"RateID\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"RateFilterIDs\",\"tag\":\"RateFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"RateActivationTimes\",\"tag\":\"RateActivationTimes\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"path\":\"RateWeights\",\"tag\":\"RateWeights\",\"type\":\"*variable\",\"value\":\"~*req.10\"},{\"path\":\"RateBlocker\",\"tag\":\"RateBlocker\",\"type\":\"*variable\",\"value\":\"~*req.11\"},{\"path\":\"RateIntervalStart\",\"tag\":\"RateIntervalStart\",\"type\":\"*variable\",\"value\":\"~*req.12\"},{\"path\":\"RateFixedFee\",\"tag\":\"RateFixedFee\",\"type\":\"*variable\",\"value\":\"~*req.13\"},{\"path\":\"RateRecurrentFee\",\"tag\":\"RateRecurrentFee\",\"type\":\"*variable\",\"value\":\"~*req.14\"},{\"path\":\"RateUnit\",\"tag\":\"RateUnit\",\"type\":\"*variable\",\"value\":\"~*req.15\"},{\"path\":\"RateIncrement\",\"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\":\"Weight\",\"tag\":\"Weight\",\"type\":\"*variable\",\"value\":\"~*req.3\"},{\"path\":\"Schedule\",\"tag\":\"Schedule\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"TargetType\",\"tag\":\"TargetType\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"TargetIDs\",\"tag\":\"TargetIDs\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"ActionID\",\"tag\":\"ActionID\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"ActionFilterIDs\",\"tag\":\"ActionFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"ActionBlocker\",\"tag\":\"ActionBlocker\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"path\":\"ActionTTL\",\"tag\":\"ActionTTL\",\"type\":\"*variable\",\"value\":\"~*req.10\"},{\"path\":\"ActionType\",\"tag\":\"ActionType\",\"type\":\"*variable\",\"value\":\"~*req.11\"},{\"path\":\"ActionOpts\",\"tag\":\"ActionOpts\",\"type\":\"*variable\",\"value\":\"~*req.12\"},{\"path\":\"ActionPath\",\"tag\":\"ActionPath\",\"type\":\"*variable\",\"value\":\"~*req.13\"},{\"path\":\"ActionValue\",\"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\":\"Opts\",\"tag\":\"Opts\",\"type\":\"*variable\",\"value\":\"~*req.4\"},{\"path\":\"BalanceID\",\"tag\":\"BalanceID\",\"type\":\"*variable\",\"value\":\"~*req.5\"},{\"path\":\"BalanceFilterIDs\",\"tag\":\"BalanceFilterIDs\",\"type\":\"*variable\",\"value\":\"~*req.6\"},{\"path\":\"BalanceWeights\",\"tag\":\"BalanceWeights\",\"type\":\"*variable\",\"value\":\"~*req.7\"},{\"path\":\"BalanceType\",\"tag\":\"BalanceType\",\"type\":\"*variable\",\"value\":\"~*req.8\"},{\"path\":\"BalanceUnits\",\"tag\":\"BalanceUnits\",\"type\":\"*variable\",\"value\":\"~*req.9\"},{\"path\":\"BalanceUnitFactors\",\"tag\":\"BalanceUnitFactors\",\"type\":\"*variable\",\"value\":\"~*req.10\"},{\"path\":\"BalanceOpts\",\"tag\":\"BalanceOpts\",\"type\":\"*variable\",\"value\":\"~*req.11\"},{\"path\":\"BalanceCostIncrements\",\"tag\":\"BalanceCostIncrements\",\"type\":\"*variable\",\"value\":\"~*req.12\"},{\"path\":\"BalanceAttributeIDs\",\"tag\":\"BalanceAttributeIDs\",\"type\":\"*variable\",\"value\":\"~*req.13\"},{\"path\":\"BalanceRateProfileIDs\",\"tag\":\"BalanceRateProfileIDs\",\"type\":\"*variable\",\"value\":\"~*req.14\"},{\"path\":\"ThresholdIDs\",\"tag\":\"ThresholdIDs\",\"type\":\"*variable\",\"value\":\"~*req.15\"}],\"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/config_reload_rates_it_test.go b/general_tests/config_reload_rates_it_test.go index 2d2a6c8d1..9de56e509 100644 --- a/general_tests/config_reload_rates_it_test.go +++ b/general_tests/config_reload_rates_it_test.go @@ -93,7 +93,6 @@ func testRateStartEngine(t *testing.T) { } func testRateConfigSReloadRates(t *testing.T) { - var replyPingBf string if err := testRateRPC.Call(context.Background(), utils.RateSv1CostForEvent, &utils.CGREvent{}, &replyPingBf); err == nil || err.Error() != "rpc: can't find service RateSv1.CostForEvent" { t.Error(err) @@ -107,7 +106,7 @@ func testRateConfigSReloadRates(t *testing.T) { } else if reply != utils.OK { t.Errorf("Expected OK received: %+v", reply) } - cfgStr := "{\"rates\":{\"enabled\":true,\"indexed_selects\":true,\"nested_fields\":false,\"prefix_indexed_fields\":[],\"rate_indexed_selects\":true,\"rate_nested_fields\":false,\"rate_prefix_indexed_fields\":[],\"rate_suffix_indexed_fields\":[],\"suffix_indexed_fields\":[],\"verbosity\":1000}}" + cfgStr := "{\"rates\":{\"enabled\":true,\"indexed_selects\":true,\"nested_fields\":false,\"opts\":{\"*intervalStart\":[],\"*profileIDs\":[],\"*profileIgnoreFilters\":[],\"*startTime\":[],\"*usage\":[]},\"prefix_indexed_fields\":[],\"rate_indexed_selects\":true,\"rate_nested_fields\":false,\"rate_prefix_indexed_fields\":[],\"rate_suffix_indexed_fields\":[],\"suffix_indexed_fields\":[],\"verbosity\":1000}}" var rpl string if err := testRateRPC.Call(context.Background(), utils.ConfigSv1GetConfigAsJSON, &config.SectionWithAPIOpts{ Tenant: "cgrates.org", diff --git a/utils/consts.go b/utils/consts.go index 3205ae7e5..311494086 100644 --- a/utils/consts.go +++ b/utils/consts.go @@ -1123,16 +1123,16 @@ const ( AdminSv1GetChargersIndexesHealth = "AdminSv1.GetChargersIndexesHealth" AdminSv1GetAttributesIndexesHealth = "AdminSv1.GetAttributesIndexesHealth" AdminSv1GetDispatchersIndexesHealth = "AdminSv1.GetDispatchersIndexesHealth" - APIerSv1Ping = "APIerSv1.Ping" - APIerSv1SetDispatcherProfile = "APIerSv1.SetDispatcherProfile" - APIerSv1GetDispatcherProfile = "APIerSv1.GetDispatcherProfile" - APIerSv1GetDispatcherProfileIDs = "APIerSv1.GetDispatcherProfileIDs" - APIerSv1RemoveDispatcherProfile = "APIerSv1.RemoveDispatcherProfile" + AdminSv1Ping = "AdminSv1.Ping" + AdminSv1SetDispatcherProfile = "AdminSv1.SetDispatcherProfile" + AdminSv1GetDispatcherProfile = "AdminSv1.GetDispatcherProfile" + AdminSv1GetDispatcherProfileIDs = "AdminSv1.GetDispatcherProfileIDs" + AdminSv1RemoveDispatcherProfile = "AdminSv1.RemoveDispatcherProfile" APIerSv1SetBalances = "APIerSv1.SetBalances" - APIerSv1SetDispatcherHost = "APIerSv1.SetDispatcherHost" - APIerSv1GetDispatcherHost = "APIerSv1.GetDispatcherHost" - APIerSv1GetDispatcherHostIDs = "APIerSv1.GetDispatcherHostIDs" - APIerSv1RemoveDispatcherHost = "APIerSv1.RemoveDispatcherHost" + AdminSv1SetDispatcherHost = "AdminSv1.SetDispatcherHost" + AdminSv1GetDispatcherHost = "AdminSv1.GetDispatcherHost" + AdminSv1GetDispatcherHostIDs = "AdminSv1.GetDispatcherHostIDs" + AdminSv1RemoveDispatcherHost = "AdminSv1.RemoveDispatcherHost" APIerSv1GetEventCost = "APIerSv1.GetEventCost" APIerSv1LoadTariffPlanFromFolder = "APIerSv1.LoadTariffPlanFromFolder" APIerSv1ExportToFolder = "APIerSv1.ExportToFolder"