diff --git a/apier/v1/apier_it_test.go b/apier/v1/apier_it_test.go index 0fe209d37..aaf6c26ae 100644 --- a/apier/v1/apier_it_test.go +++ b/apier/v1/apier_it_test.go @@ -1485,7 +1485,7 @@ func testApierResetDataAfterLoadFromFolder(t *testing.T) { expStats[utils.CacheReverseDestinations].Items = 5 expStats[utils.CacheStatQueueProfiles].Items = 1 expStats[utils.CacheStatQueues].Items = 1 - expStats[utils.CacheSupplierProfiles].Items = 2 + expStats[utils.CacheRouteProfiles].Items = 2 expStats[utils.CacheThresholdProfiles].Items = 1 expStats[utils.CacheThresholds].Items = 1 expStats[utils.CacheLoadIDs].Items = 20 diff --git a/apier/v1/caches_it_test.go b/apier/v1/caches_it_test.go index 4477c0a0a..305c93851 100644 --- a/apier/v1/caches_it_test.go +++ b/apier/v1/caches_it_test.go @@ -157,7 +157,7 @@ func testCacheSAfterLoadFromFolder(t *testing.T) { expStats[utils.CacheReverseDestinations].Items = 5 expStats[utils.CacheStatQueueProfiles].Items = 1 expStats[utils.CacheStatQueues].Items = 1 - expStats[utils.CacheSupplierProfiles].Items = 2 + expStats[utils.CacheRouteProfiles].Items = 2 expStats[utils.CacheThresholdProfiles].Items = 1 expStats[utils.CacheThresholds].Items = 1 expStats[utils.CacheLoadIDs].Items = 20 @@ -210,7 +210,7 @@ func testCacheSReload(t *testing.T) { expStats[utils.CacheReverseDestinations].Items = 5 expStats[utils.CacheStatQueueProfiles].Items = 1 expStats[utils.CacheStatQueues].Items = 1 - expStats[utils.CacheSupplierProfiles].Items = 2 + expStats[utils.CacheRouteProfiles].Items = 2 expStats[utils.CacheThresholdProfiles].Items = 1 expStats[utils.CacheThresholds].Items = 1 expStats[utils.CacheLoadIDs].Items = 20 diff --git a/apier/v1/config_it_test.go b/apier/v1/config_it_test.go index 425196881..68ea3624b 100644 --- a/apier/v1/config_it_test.go +++ b/apier/v1/config_it_test.go @@ -115,7 +115,7 @@ func testConfigSReloadConfigFromJSONSessionS(t *testing.T) { "sessions": map[string]interface{}{ "enabled": true, "resources_conns": []string{"*localhost"}, - "suppliers_conns": []string{"*localhost"}, + "routes_conns": []string{"*localhost"}, "attributes_conns": []string{"*localhost"}, "rals_conns": []string{"*internal"}, "cdrs_conns": []string{"*internal"}, @@ -128,16 +128,25 @@ func testConfigSReloadConfigFromJSONSessionS(t *testing.T) { t.Errorf("Expected OK received: %s", reply) } exp := map[string]interface{}{ - "Enabled": true, - "ListenBijson": "127.0.0.1:2014", - "ChargerSConns": []interface{}{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaChargers)}, - "RALsConns": []interface{}{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaResponder)}, - "ResSConns": []interface{}{utils.MetaLocalHost}, - "ThreshSConns": []interface{}{}, - "StatSConns": []interface{}{}, - "SupplSConns": []interface{}{utils.MetaLocalHost}, - "AttrSConns": []interface{}{utils.MetaLocalHost}, - "CDRsConns": []interface{}{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaCDRs)}, + "Enabled": true, + "ListenBijson": "127.0.0.1:2014", + "ChargerSConns": []interface{}{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaChargers)}, + "RALsConns": []interface{}{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaResponder)}, + "ResSConns": []interface{}{utils.MetaLocalHost}, + "ThreshSConns": []interface{}{}, + "StatSConns": []interface{}{}, + "RouteSConns": []interface{}{utils.MetaLocalHost}, + "AttrSConns": []interface{}{utils.MetaLocalHost}, + "CDRsConns": []interface{}{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaCDRs)}, + "SchedulerConns": []interface{}{}, + + "STIRCfg": map[string]interface{}{ + "AllowedAttest": map[string]interface{}{}, + "DefaultAttest": "A", + "PayloadMaxduration": -1., + "PrivateKeyPath": "", + "PublicKeyPath": "", + }, "ReplicationConns": []interface{}{}, "MaxCallDuration": float64(3 * time.Hour), @@ -176,7 +185,7 @@ func testConfigSReloadConfigFromJSONSessionS(t *testing.T) { }, &rpl); err != nil { t.Error(err) } else if !reflect.DeepEqual(exp, rpl) { - t.Errorf("Expected %+v , received: %+v ", utils.ToJSON(exp), utils.ToJSON(rpl)) + t.Errorf("Expected %+v , received: %+v ", exp, rpl) } } diff --git a/apier/v1/filter_indexes_it_test.go b/apier/v1/filter_indexes_it_test.go index 3dfa81adb..866d6b5f0 100644 --- a/apier/v1/filter_indexes_it_test.go +++ b/apier/v1/filter_indexes_it_test.go @@ -66,11 +66,11 @@ var ( testV1FIdxSecondComputeResourceProfileIndexes, testV1FIdxRemoveResourceProfile, - testV1FIdxSetSupplierProfileIndexes, - testV1FIdxComputeSupplierProfileIndexes, - testV1FIdxSetSecondSupplierProfileIndexes, - testV1FIdxSecondComputeSupplierProfileIndexes, - testV1FIdxRemoveSupplierProfile, + testV1FIdxSetRouteProfileIndexes, + testV1FIdxComputeRouteProfileIndexes, + testV1FIdxSetSecondRouteProfileIndexes, + testV1FIdxSecondComputeRouteProfileIndexes, + testV1FIdxRemoveRouteProfile, testV1FIdxSetAttributeProfileIndexes, testV1FIdxComputeAttributeProfileIndexes, @@ -886,9 +886,9 @@ func testV1FIdxRemoveResourceProfile(t *testing.T) { } } -//SupplierProfile -func testV1FIdxSetSupplierProfileIndexes(t *testing.T) { - var reply *engine.SupplierProfile +//RouteProfile +func testV1FIdxSetRouteProfileIndexes(t *testing.T) { + var reply *engine.RouteProfile filter = &FilterWithCache{ Filter: &engine.Filter{ Tenant: tenant, @@ -912,19 +912,19 @@ func testV1FIdxSetSupplierProfileIndexes(t *testing.T) { } else if result != utils.OK { t.Error("Unexpected reply returned", result) } - if err := tFIdxRpc.Call(utils.APIerSv1GetSupplierProfile, + if err := tFIdxRpc.Call(utils.APIerSv1GetRouteProfile, &utils.TenantID{Tenant: tenant, ID: "TEST_PROFILE1"}, &reply); err == nil || err.Error() != utils.ErrNotFound.Error() { t.Error(err) } - splPrf = &SupplierWithCache{ - SupplierProfile: &engine.SupplierProfile{ + rPrf := &RouteWithCache{ + RouteProfile: &engine.RouteProfile{ Tenant: tenant, ID: "TEST_PROFILE1", FilterIDs: []string{"FLTR_1"}, Sorting: "Sort1", SortingParameters: []string{"Param1", "Param2"}, - Suppliers: []*engine.Supplier{{ + Routes: []*engine.Route{{ ID: "SPL1", RatingPlanIDs: []string{"RP1"}, FilterIDs: []string{"FLTR_1"}, @@ -938,36 +938,36 @@ func testV1FIdxSetSupplierProfileIndexes(t *testing.T) { }, } - if err := tFIdxRpc.Call(utils.APIerSv1SetSupplierProfile, splPrf, &result); err != nil { + if err := tFIdxRpc.Call(utils.APIerSv1SetRouteProfile, rPrf, &result); err != nil { t.Error(err) } else if result != utils.OK { t.Error("Unexpected reply returned", result) } - if err := tFIdxRpc.Call(utils.APIerSv1GetSupplierProfile, + if err := tFIdxRpc.Call(utils.APIerSv1GetRouteProfile, &utils.TenantID{Tenant: tenant, ID: "TEST_PROFILE1"}, &reply); err != nil { t.Error(err) - } else if !reflect.DeepEqual(splPrf.SupplierProfile, reply) { - t.Errorf("Expecting: %+v, received: %+v", splPrf.SupplierProfile, reply) + } else if !reflect.DeepEqual(rPrf.RouteProfile, reply) { + t.Errorf("Expecting: %+v, received: %+v", rPrf.RouteProfile, reply) } if err := tFIdxRpc.Call(utils.APIerSv1RemoveFilterIndexes, &AttrRemFilterIndexes{ - ItemType: utils.MetaSuppliers, Tenant: tenant}, &result); err != nil { + ItemType: utils.MetaRoutes, Tenant: tenant}, &result); err != nil { t.Error(err) } else if result != utils.OK { t.Error("Unexpected reply returned", result) } var indexes []string if err := tFIdxRpc.Call(utils.APIerSv1GetFilterIndexes, &AttrGetFilterIndexes{ - ItemType: utils.MetaSuppliers, Tenant: tenant, FilterType: utils.MetaString}, + ItemType: utils.MetaRoutes, Tenant: tenant, FilterType: utils.MetaString}, &indexes); err.Error() != utils.ErrNotFound.Error() { t.Error(err) } } -func testV1FIdxComputeSupplierProfileIndexes(t *testing.T) { +func testV1FIdxComputeRouteProfileIndexes(t *testing.T) { var reply2 string if err := tFIdxRpc.Call(utils.APIerSv1ComputeFilterIndexes, utils.ArgsComputeFilterIndexes{ - Tenant: tenant, - SupplierS: true, + Tenant: tenant, + RouteS: true, }, &reply2); err != nil { t.Error(err) } @@ -977,7 +977,7 @@ func testV1FIdxComputeSupplierProfileIndexes(t *testing.T) { expectedIDX := []string{"*string:~*req.Account:1001:TEST_PROFILE1"} var indexes []string if err := tFIdxRpc.Call(utils.APIerSv1GetFilterIndexes, &AttrGetFilterIndexes{ - ItemType: utils.MetaSuppliers, Tenant: tenant, FilterType: utils.MetaString}, + ItemType: utils.MetaRoutes, Tenant: tenant, FilterType: utils.MetaString}, &indexes); err != nil { t.Error(err) } @@ -987,8 +987,8 @@ func testV1FIdxComputeSupplierProfileIndexes(t *testing.T) { } } -func testV1FIdxSetSecondSupplierProfileIndexes(t *testing.T) { - var reply *engine.SupplierProfile +func testV1FIdxSetSecondRouteProfileIndexes(t *testing.T) { + var reply *engine.RouteProfile filter = &FilterWithCache{ Filter: &engine.Filter{ Tenant: tenant, @@ -1010,19 +1010,19 @@ func testV1FIdxSetSecondSupplierProfileIndexes(t *testing.T) { } else if result != utils.OK { t.Error("Unexpected reply returned", result) } - if err := tFIdxRpc.Call(utils.APIerSv1GetSupplierProfile, + if err := tFIdxRpc.Call(utils.APIerSv1GetRouteProfile, &utils.TenantID{Tenant: tenant, ID: "TEST_PROFILE2"}, &reply); err == nil || err.Error() != utils.ErrNotFound.Error() { t.Error(err) } - splPrf = &SupplierWithCache{ - SupplierProfile: &engine.SupplierProfile{ + rPrf := &RouteWithCache{ + RouteProfile: &engine.RouteProfile{ Tenant: tenant, ID: "TEST_PROFILE2", FilterIDs: []string{"FLTR_2"}, Sorting: "Sort1", SortingParameters: []string{"Param1", "Param2"}, - Suppliers: []*engine.Supplier{{ + Routes: []*engine.Route{{ ID: "SPL1", RatingPlanIDs: []string{"RP1"}, FilterIDs: []string{"FLTR_2"}, @@ -1035,38 +1035,38 @@ func testV1FIdxSetSecondSupplierProfileIndexes(t *testing.T) { Weight: 10, }, } - if err := tFIdxRpc.Call(utils.APIerSv1SetSupplierProfile, splPrf, &result); err != nil { + if err := tFIdxRpc.Call(utils.APIerSv1SetRouteProfile, rPrf, &result); err != nil { t.Error(err) } else if result != utils.OK { t.Error("Unexpected reply returned", result) } - if err := tFIdxRpc.Call(utils.APIerSv1GetSupplierProfile, + if err := tFIdxRpc.Call(utils.APIerSv1GetRouteProfile, &utils.TenantID{Tenant: tenant, ID: "TEST_PROFILE2"}, &reply); err != nil { t.Error(err) - } else if !reflect.DeepEqual(splPrf.SupplierProfile, reply) { - t.Errorf("Expecting: %+v, received: %+v", splPrf.SupplierProfile, reply) + } else if !reflect.DeepEqual(rPrf.RouteProfile, reply) { + t.Errorf("Expecting: %+v, received: %+v", rPrf.RouteProfile, reply) } if err := tFIdxRpc.Call(utils.APIerSv1RemoveFilterIndexes, &AttrRemFilterIndexes{ - ItemType: utils.MetaSuppliers, Tenant: tenant}, &result); err != nil { + ItemType: utils.MetaRoutes, Tenant: tenant}, &result); err != nil { t.Error(err) } else if result != utils.OK { t.Error("Unexpected reply returned", result) } var indexes []string if err := tFIdxRpc.Call(utils.APIerSv1GetFilterIndexes, &AttrGetFilterIndexes{ - ItemType: utils.MetaSuppliers, Tenant: tenant, FilterType: utils.MetaString}, + ItemType: utils.MetaRoutes, Tenant: tenant, FilterType: utils.MetaString}, &indexes); err.Error() != utils.ErrNotFound.Error() { t.Error(err) } } -func testV1FIdxSecondComputeSupplierProfileIndexes(t *testing.T) { +func testV1FIdxSecondComputeRouteProfileIndexes(t *testing.T) { spid := []string{"TEST_PROFILE2"} var reply2 string if err := tFIdxRpc.Call(utils.APIerSv1ComputeFilterIndexIDs, utils.ArgsComputeFilterIndexIDs{ - Tenant: tenant, - SupplierIDs: spid, + Tenant: tenant, + RouteIDs: spid, }, &reply2); err != nil { t.Error(err) } @@ -1076,7 +1076,7 @@ func testV1FIdxSecondComputeSupplierProfileIndexes(t *testing.T) { expectedIDX := []string{"*string:~*req.Account:1001:TEST_PROFILE2"} var indexes []string if err := tFIdxRpc.Call(utils.APIerSv1GetFilterIndexes, &AttrGetFilterIndexes{ - ItemType: utils.MetaSuppliers, Tenant: tenant, FilterType: utils.MetaString}, + ItemType: utils.MetaRoutes, Tenant: tenant, FilterType: utils.MetaString}, &indexes); err != nil { t.Error(err) } @@ -1086,43 +1086,43 @@ func testV1FIdxSecondComputeSupplierProfileIndexes(t *testing.T) { } } -func testV1FIdxRemoveSupplierProfile(t *testing.T) { +func testV1FIdxRemoveRouteProfile(t *testing.T) { var resp string var reply2 string if err := tFIdxRpc.Call(utils.APIerSv1ComputeFilterIndexes, utils.ArgsComputeFilterIndexes{ - Tenant: tenant, - SupplierS: true, + Tenant: tenant, + RouteS: true, }, &reply2); err != nil { t.Error(err) } if reply2 != utils.OK { t.Errorf("Error: %+v", reply2) } - if err := tFIdxRpc.Call(utils.APIerSv1RemoveSupplierProfile, + if err := tFIdxRpc.Call(utils.APIerSv1RemoveRouteProfile, &utils.TenantID{Tenant: tenant, ID: "TEST_PROFILE1"}, &resp); err != nil { t.Error(err) } else if resp != utils.OK { t.Error("Unexpected reply returned", resp) } - if err := tFIdxRpc.Call(utils.APIerSv1RemoveSupplierProfile, + if err := tFIdxRpc.Call(utils.APIerSv1RemoveRouteProfile, &utils.TenantID{Tenant: tenant, ID: "TEST_PROFILE2"}, &resp); err != nil { t.Error(err) } else if resp != utils.OK { t.Error("Unexpected reply returned", resp) } - if err := tFIdxRpc.Call(utils.APIerSv1GetSupplierProfile, + if err := tFIdxRpc.Call(utils.APIerSv1GetRouteProfile, &utils.TenantID{Tenant: tenant, ID: "TEST_PROFILE1"}, &reply2); err == nil || err.Error() != utils.ErrNotFound.Error() { t.Error(err) } - if err := tFIdxRpc.Call(utils.APIerSv1GetSupplierProfile, + if err := tFIdxRpc.Call(utils.APIerSv1GetRouteProfile, &utils.TenantID{Tenant: tenant, ID: "TEST_PROFILE2"}, &reply2); err == nil || err.Error() != utils.ErrNotFound.Error() { t.Error(err) } var indexes []string if err := tFIdxRpc.Call(utils.APIerSv1GetFilterIndexes, &AttrGetFilterIndexes{ - ItemType: utils.MetaSuppliers, Tenant: tenant, FilterType: utils.MetaString}, + ItemType: utils.MetaRoutes, Tenant: tenant, FilterType: utils.MetaString}, &indexes); err != nil && err.Error() != utils.ErrNotFound.Error() { t.Error(err) diff --git a/apier/v1/precache_it_test.go b/apier/v1/precache_it_test.go index 667bdf1ec..9adbb81ac 100644 --- a/apier/v1/precache_it_test.go +++ b/apier/v1/precache_it_test.go @@ -270,11 +270,15 @@ func testPrecacheGetCacheStatsAfterRestart(t *testing.T) { Items: 1, Groups: 0, }, - utils.CacheSupplierFilterIndexes: { + utils.CacheSTIR: { + Items: 0, + Groups: 0, + }, + utils.CacheRouteFilterIndexes: { Items: 6, Groups: 0, }, - utils.CacheSupplierProfiles: { + utils.CacheRouteProfiles: { Items: 3, Groups: 0, }, diff --git a/apier/v1/remote_it_test.go b/apier/v1/remote_it_test.go index 460676a27..8d51add7a 100644 --- a/apier/v1/remote_it_test.go +++ b/apier/v1/remote_it_test.go @@ -62,7 +62,7 @@ var ( testInternalRemoteITGetResource, testInternalRemoteITGetResourceProfile, testInternalRemoteITGetStatQueueProfile, - testInternalRemoteITGetSupplier, + testInternalRemoteITGetRoute, testInternalRemoteITGetFilter, testInternalRemoteITGetRatingPlan, testInternalRemoteITGetRatingProfile, @@ -405,9 +405,9 @@ func testInternalRemoteITGetStatQueueProfile(t *testing.T) { } } -func testInternalRemoteITGetSupplier(t *testing.T) { - var reply *engine.SupplierProfile - splPrf := &engine.SupplierProfile{ +func testInternalRemoteITGetRoute(t *testing.T) { + var reply *engine.RouteProfile + splPrf := &engine.RouteProfile{ Tenant: "cgrates.org", ID: "SPL_ACNT_1001", FilterIDs: []string{"FLTR_ACNT_1001"}, @@ -416,7 +416,7 @@ func testInternalRemoteITGetSupplier(t *testing.T) { }, Sorting: utils.MetaWeight, SortingParameters: []string{}, - Suppliers: []*engine.Supplier{ + Routes: []*engine.Route{ { ID: "supplier1", Weight: 10, @@ -429,7 +429,7 @@ func testInternalRemoteITGetSupplier(t *testing.T) { Weight: 20, } // supplier in reverse order - splPrf2 := &engine.SupplierProfile{ + splPrf2 := &engine.RouteProfile{ Tenant: "cgrates.org", ID: "SPL_ACNT_1001", FilterIDs: []string{"FLTR_ACNT_1001"}, @@ -438,7 +438,7 @@ func testInternalRemoteITGetSupplier(t *testing.T) { }, Sorting: utils.MetaWeight, SortingParameters: []string{}, - Suppliers: []*engine.Supplier{ + Routes: []*engine.Route{ { ID: "supplier2", Weight: 20, @@ -455,7 +455,7 @@ func testInternalRemoteITGetSupplier(t *testing.T) { splPrf2.SortingParameters = nil } - if err := internalRPC.Call(utils.APIerSv1GetSupplierProfile, + if err := internalRPC.Call(utils.APIerSv1GetRouteProfile, &utils.TenantID{Tenant: "cgrates.org", ID: "SPL_ACNT_1001"}, &reply); err != nil { t.Error(err) } else if !reflect.DeepEqual(splPrf, reply) && !reflect.DeepEqual(splPrf2, reply) { diff --git a/apier/v1/replicate_it_test.go b/apier/v1/replicate_it_test.go index 6fb5b75df..de95a84d4 100644 --- a/apier/v1/replicate_it_test.go +++ b/apier/v1/replicate_it_test.go @@ -41,7 +41,7 @@ var ( testInternalReplicateITDestination, testInternalReplicateITAttributeProfile, testInternalReplicateITRatingProfile, - testInternalReplicateITSupplierProfile, + testInternalReplicateITRouteProfile, testInternalReplicateITStatQueueProfile, testInternalReplicateITDispatcherProfile, testInternalReplicateITChargerProfile, @@ -341,35 +341,35 @@ func testInternalReplicateITRatingProfile(t *testing.T) { } } -func testInternalReplicateITSupplierProfile(t *testing.T) { +func testInternalReplicateITRouteProfile(t *testing.T) { // check - var reply *engine.SupplierProfile - if err := engineOneRPC.Call(utils.APIerSv1GetSupplierProfile, + var reply *engine.RouteProfile + if err := engineOneRPC.Call(utils.APIerSv1GetRouteProfile, &utils.TenantID{Tenant: "cgrates.org", ID: "TEST_PROFILE1"}, &reply); err == nil || err.Error() != utils.ErrNotFound.Error() { t.Error(err) } - if err := engineTwoRPC.Call(utils.APIerSv1GetSupplierProfile, + if err := engineTwoRPC.Call(utils.APIerSv1GetRouteProfile, &utils.TenantID{Tenant: "cgrates.org", ID: "TEST_PROFILE1"}, &reply); err == nil || err.Error() != utils.ErrNotFound.Error() { t.Error(err) } - splPrf = &SupplierWithCache{ - SupplierProfile: &engine.SupplierProfile{ + rPrf := &RouteWithCache{ + RouteProfile: &engine.RouteProfile{ Tenant: "cgrates.org", ID: "TEST_PROFILE1", Sorting: "Sort1", SortingParameters: []string{"Param1", "Param2"}, - Suppliers: []*engine.Supplier{ + Routes: []*engine.Route{ { - ID: "SPL1", - RatingPlanIDs: []string{"RP1"}, - AccountIDs: []string{"Acc"}, - ResourceIDs: []string{"Res1", "ResGroup2"}, - StatIDs: []string{"Stat1"}, - Weight: 20, - Blocker: false, - SupplierParameters: "SortingParameter1", + ID: "SPL1", + RatingPlanIDs: []string{"RP1"}, + AccountIDs: []string{"Acc"}, + ResourceIDs: []string{"Res1", "ResGroup2"}, + StatIDs: []string{"Stat1"}, + Weight: 20, + Blocker: false, + RouteParameters: "SortingParameter1", }, }, Weight: 10, @@ -377,39 +377,39 @@ func testInternalReplicateITSupplierProfile(t *testing.T) { } // set var result string - if err := internalRPC.Call(utils.APIerSv1SetSupplierProfile, splPrf, &result); err != nil { + if err := internalRPC.Call(utils.APIerSv1SetRouteProfile, rPrf, &result); err != nil { t.Error(err) } else if result != utils.OK { t.Error("Unexpected reply returned", result) } // check - if err := engineOneRPC.Call(utils.APIerSv1GetSupplierProfile, + if err := engineOneRPC.Call(utils.APIerSv1GetRouteProfile, &utils.TenantID{Tenant: "cgrates.org", ID: "TEST_PROFILE1"}, &reply); err != nil { t.Error(err) - } else if !reflect.DeepEqual(splPrf.SupplierProfile, reply) { - t.Errorf("Expecting: %+v, received: %+v", splPrf.SupplierProfile, reply) + } else if !reflect.DeepEqual(rPrf.RouteProfile, reply) { + t.Errorf("Expecting: %+v, received: %+v", rPrf.RouteProfile, reply) } - if err := engineTwoRPC.Call(utils.APIerSv1GetSupplierProfile, + if err := engineTwoRPC.Call(utils.APIerSv1GetRouteProfile, &utils.TenantID{Tenant: "cgrates.org", ID: "TEST_PROFILE1"}, &reply); err != nil { t.Error(err) - } else if !reflect.DeepEqual(splPrf.SupplierProfile, reply) { - t.Errorf("Expecting: %+v, received: %+v", splPrf.SupplierProfile, reply) + } else if !reflect.DeepEqual(rPrf.RouteProfile, reply) { + t.Errorf("Expecting: %+v, received: %+v", rPrf.RouteProfile, reply) } // remove var resp string - if err := internalRPC.Call(utils.APIerSv1RemoveSupplierProfile, + if err := internalRPC.Call(utils.APIerSv1RemoveRouteProfile, &utils.TenantIDWithCache{Tenant: "cgrates.org", ID: "TEST_PROFILE1"}, &resp); err != nil { t.Error(err) } else if resp != utils.OK { t.Error("Unexpected reply returned", resp) } // check - if err := engineOneRPC.Call(utils.APIerSv1GetSupplierProfile, + if err := engineOneRPC.Call(utils.APIerSv1GetRouteProfile, &utils.TenantID{Tenant: "cgrates.org", ID: "TEST_PROFILE1"}, &reply); err == nil || err.Error() != utils.ErrNotFound.Error() { t.Error(err) } - if err := engineTwoRPC.Call(utils.APIerSv1GetSupplierProfile, + if err := engineTwoRPC.Call(utils.APIerSv1GetRouteProfile, &utils.TenantID{Tenant: "cgrates.org", ID: "TEST_PROFILE1"}, &reply); err == nil || err.Error() != utils.ErrNotFound.Error() { t.Error(err) @@ -1448,8 +1448,8 @@ func testInternalReplicateITLoadIds(t *testing.T) { t.Errorf("Expecting: %+v, received: %+v", rcv1e1[utils.CacheReverseDestinations], rcv2e1[utils.CacheReverseDestinations]) } else if rcv1e1[utils.CacheStatQueueProfiles] != rcv2e1[utils.CacheStatQueueProfiles] { t.Errorf("Expecting: %+v, received: %+v", rcv1e1[utils.CacheStatQueueProfiles], rcv2e1[utils.CacheStatQueueProfiles]) - } else if rcv1e1[utils.CacheSupplierProfiles] != rcv2e1[utils.CacheSupplierProfiles] { - t.Errorf("Expecting: %+v, received: %+v", rcv1e1[utils.CacheSupplierProfiles], rcv2e1[utils.CacheSupplierProfiles]) + } else if rcv1e1[utils.CacheRouteProfiles] != rcv2e1[utils.CacheRouteProfiles] { + t.Errorf("Expecting: %+v, received: %+v", rcv1e1[utils.CacheRouteProfiles], rcv2e1[utils.CacheRouteProfiles]) } else if rcv1e1[utils.CacheThresholdProfiles] != rcv2e1[utils.CacheThresholdProfiles] { t.Errorf("Expecting: %+v, received: %+v", rcv1e1[utils.CacheThresholdProfiles], rcv2e1[utils.CacheThresholdProfiles]) } else if rcv1e1[utils.CacheThresholds] != rcv2e1[utils.CacheThresholds] { diff --git a/apier/v1/sessions_process_event_it_test.go b/apier/v1/sessions_process_event_it_test.go index a570804ed..aca444a59 100644 --- a/apier/v1/sessions_process_event_it_test.go +++ b/apier/v1/sessions_process_event_it_test.go @@ -158,7 +158,7 @@ func testSSv1ItProcessEventAuth(t *testing.T) { args := &sessions.V1ProcessEventArgs{ Flags: []string{utils.ConcatenatedKey(utils.MetaResources, utils.MetaAuthorize), utils.ConcatenatedKey(utils.MetaRALs, utils.MetaAuthorize), - utils.MetaSuppliers, utils.MetaAttributes}, + utils.MetaRoutes, utils.MetaAttributes}, CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", ID: "testSSv1ItProcessEventAuth", @@ -185,27 +185,27 @@ func testSSv1ItProcessEventAuth(t *testing.T) { if *rply.ResourceMessage == utils.EmptyString { t.Errorf("Unexpected ResourceMessage: %s", *rply.ResourceMessage) } - eSplrs := &engine.SortedSuppliers{ + eSplrs := &engine.SortedRoutes{ ProfileID: "SPL_ACNT_1001", Sorting: utils.MetaWeight, Count: 2, - SortedSuppliers: []*engine.SortedSupplier{ + SortedRoutes: []*engine.SortedRoute{ { - SupplierID: "supplier1", + RouteID: "supplier1", SortingData: map[string]interface{}{ "Weight": 20.0, }, }, { - SupplierID: "supplier2", + RouteID: "supplier2", SortingData: map[string]interface{}{ "Weight": 10.0, }, }, }, } - if !reflect.DeepEqual(eSplrs, rply.Suppliers) { - t.Errorf("expecting: %+v,\n received: %+v", utils.ToJSON(eSplrs), utils.ToJSON(rply.Suppliers)) + if !reflect.DeepEqual(eSplrs, rply.Routes) { + t.Errorf("expecting: %+v,\n received: %+v", utils.ToJSON(eSplrs), utils.ToJSON(rply.Routes)) } eAttrs := &engine.AttrSProcessEventReply{ MatchedProfiles: []string{"ATTR_ACNT_1001"}, diff --git a/apier/v1/sessionsv1_it_test.go b/apier/v1/sessionsv1_it_test.go index a1d339c34..2a1d31f99 100644 --- a/apier/v1/sessionsv1_it_test.go +++ b/apier/v1/sessionsv1_it_test.go @@ -204,7 +204,7 @@ func testSSv1ItAuth(t *testing.T) { args := &sessions.V1AuthorizeArgs{ GetMaxUsage: true, AuthorizeResources: true, - GetSuppliers: true, + GetRoutes: true, GetAttributes: true, CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", @@ -232,27 +232,27 @@ func testSSv1ItAuth(t *testing.T) { if *rply.ResourceAllocation == "" { t.Errorf("Unexpected ResourceAllocation: %s", *rply.ResourceAllocation) } - eSplrs := &engine.SortedSuppliers{ + eSplrs := &engine.SortedRoutes{ ProfileID: "SPL_ACNT_1001", Sorting: utils.MetaWeight, Count: 2, - SortedSuppliers: []*engine.SortedSupplier{ + SortedRoutes: []*engine.SortedRoute{ { - SupplierID: "supplier1", + RouteID: "supplier1", SortingData: map[string]interface{}{ "Weight": 20.0, }, }, { - SupplierID: "supplier2", + RouteID: "supplier2", SortingData: map[string]interface{}{ "Weight": 10.0, }, }, }, } - if !reflect.DeepEqual(eSplrs, rply.Suppliers) { - t.Errorf("expecting: %+v,\n received: %+v", utils.ToJSON(eSplrs), utils.ToJSON(rply.Suppliers)) + if !reflect.DeepEqual(eSplrs, rply.Routes) { + t.Errorf("expecting: %+v,\n received: %+v", utils.ToJSON(eSplrs), utils.ToJSON(rply.Routes)) } eAttrs := &engine.AttrSProcessEventReply{ MatchedProfiles: []string{"ATTR_ACNT_1001"}, @@ -286,7 +286,7 @@ func testSSv1ItAuthWithDigest(t *testing.T) { args := &sessions.V1AuthorizeArgs{ GetMaxUsage: true, AuthorizeResources: true, - GetSuppliers: true, + GetRoutes: true, GetAttributes: true, CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", @@ -317,8 +317,8 @@ func testSSv1ItAuthWithDigest(t *testing.T) { t.Errorf("Unexpected ResourceAllocation: %s", *rply.ResourceAllocation) } eSplrs := utils.StringPointer("supplier1,supplier2") - if *eSplrs != *rply.SuppliersDigest { - t.Errorf("expecting: %v, received: %v", *eSplrs, *rply.SuppliersDigest) + if *eSplrs != *rply.RoutesDigest { + t.Errorf("expecting: %v, received: %v", *eSplrs, *rply.RoutesDigest) } eAttrs := utils.StringPointer("OfficeGroup:Marketing") if *eAttrs != *rply.AttributesDigest { diff --git a/apier/v1/suppliers_it_test.go b/apier/v1/suppliers_it_test.go index 429bee095..1d8d27d84 100644 --- a/apier/v1/suppliers_it_test.go +++ b/apier/v1/suppliers_it_test.go @@ -36,41 +36,41 @@ var ( splSv1CfgPath string splSv1Cfg *config.CGRConfig splSv1Rpc *rpc.Client - splPrf *SupplierWithCache + splPrf *RouteWithCache splSv1ConfDIR string //run tests for specific configuration - sTestsSupplierSV1 = []func(t *testing.T){ + sTestsRouteSV1 = []func(t *testing.T){ testV1SplSLoadConfig, testV1SplSInitDataDb, testV1SplSResetStorDb, testV1SplSStartEngine, testV1SplSRpcConn, testV1SplSFromFolder, - testV1SplSGetWeightSuppliers, - testV1SplSGetLeastCostSuppliers, - testV1SplSGetLeastCostSuppliersWithoutUsage, - testV1SplSGetLeastCostSuppliersWithMaxCost, - testV1SplSGetLeastCostSuppliersWithMaxCost2, - testV1SplSGetLeastCostSuppliersWithMaxCostNotFound, - testV1SplSGetHighestCostSuppliers, - testV1SplSGetLeastCostSuppliersErr, + testV1SplSGetWeightRoutes, + testV1SplSGetLeastCostRoutes, + testV1SplSGetLeastCostRoutesWithoutUsage, + testV1SplSGetLeastCostRoutesWithMaxCost, + testV1SplSGetLeastCostRoutesWithMaxCost2, + testV1SplSGetLeastCostRoutesWithMaxCostNotFound, + testV1SplSGetHighestCostRoutes, + testV1SplSGetLeastCostRoutesErr, testV1SplSPolulateStatsForQOS, - testV1SplSGetQOSSuppliers, - testV1SplSGetQOSSuppliers2, - testV1SplSGetQOSSuppliers3, - testV1SplSGetQOSSuppliersFiltred, - testV1SplSGetQOSSuppliersFiltred2, - testV1SplSGetSupplierWithoutFilter, - testV1SplSSetSupplierProfiles, - testV1SplSGetSupplierProfileIDs, - testV1SplSUpdateSupplierProfiles, - testV1SplSRemSupplierProfiles, - testV1SplSGetSupplierForEvent, + testV1SplSGetQOSRoutes, + testV1SplSGetQOSRoutes2, + testV1SplSGetQOSRoutes3, + testV1SplSGetQOSRoutesFiltred, + testV1SplSGetQOSRoutesFiltred2, + testV1SplSGetRouteWithoutFilter, + testV1SplSSetRouteProfiles, + testV1SplSGetRouteProfileIDs, + testV1SplSUpdateRouteProfiles, + testV1SplSRemRouteProfiles, + testV1SplSGetRouteForEvent, // reset the database and load the TP again testV1SplSInitDataDb, testV1SplSFromFolder, - testV1SplsOneSupplierWithoutDestination, - testV1SplSupplierPing, + testV1SplsOneRouteWithoutDestination, + testV1SplRoutePing, testV1SplSStopEngine, } ) @@ -89,7 +89,7 @@ func TestSuplSV1IT(t *testing.T) { default: t.Fatal("Unknown Database type") } - for _, stest := range sTestsSupplierSV1 { + for _, stest := range sTestsRouteSV1 { t.Run(splSv1ConfDIR, stest) } } @@ -138,38 +138,38 @@ func testV1SplSFromFolder(t *testing.T) { time.Sleep(500 * time.Millisecond) } -func testV1SplSGetWeightSuppliers(t *testing.T) { - ev := &engine.ArgsGetSuppliers{ +func testV1SplSGetWeightRoutes(t *testing.T) { + ev := &engine.ArgsGetRoutes{ CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", - ID: "testV1SplSGetWeightSuppliers", + ID: "testV1SplSGetWeightRoutes", Event: map[string]interface{}{ utils.Account: "1007", utils.Destination: "+491511231234", }, }, } - eSpls := engine.SortedSuppliers{ + eSpls := engine.SortedRoutes{ ProfileID: "SPL_WEIGHT_1", Sorting: utils.MetaWeight, Count: 2, - SortedSuppliers: []*engine.SortedSupplier{ + SortedRoutes: []*engine.SortedRoute{ { - SupplierID: "supplier2", + RouteID: "supplier2", SortingData: map[string]interface{}{ utils.Weight: 20.0, }, }, { - SupplierID: "supplier1", + RouteID: "supplier1", SortingData: map[string]interface{}{ utils.Weight: 10.0, }, }, }, } - var suplsReply engine.SortedSuppliers - if err := splSv1Rpc.Call(utils.SupplierSv1GetSuppliers, + var suplsReply engine.SortedRoutes + if err := splSv1Rpc.Call(utils.RouteSv1GetRoutes, ev, &suplsReply); err != nil { t.Error(err) } else if !reflect.DeepEqual(eSpls, suplsReply) { @@ -178,11 +178,11 @@ func testV1SplSGetWeightSuppliers(t *testing.T) { } } -func testV1SplSGetLeastCostSuppliers(t *testing.T) { - ev := &engine.ArgsGetSuppliers{ +func testV1SplSGetLeastCostRoutes(t *testing.T) { + ev := &engine.ArgsGetRoutes{ CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", - ID: "testV1SplSGetLeastCostSuppliers", + ID: "testV1SplSGetLeastCostRoutes", Event: map[string]interface{}{ utils.Account: "1003", utils.Subject: "1003", @@ -192,13 +192,13 @@ func testV1SplSGetLeastCostSuppliers(t *testing.T) { }, }, } - eSpls := engine.SortedSuppliers{ + eSpls := engine.SortedRoutes{ ProfileID: "SPL_LEASTCOST_1", Sorting: utils.MetaLC, Count: 3, - SortedSuppliers: []*engine.SortedSupplier{ + SortedRoutes: []*engine.SortedRoute{ { - SupplierID: "supplier3", + RouteID: "supplier3", SortingData: map[string]interface{}{ utils.Cost: 0.0136, utils.RatingPlanID: "RP_SPECIAL_1002", @@ -206,7 +206,7 @@ func testV1SplSGetLeastCostSuppliers(t *testing.T) { }, }, { - SupplierID: "supplier1", + RouteID: "supplier1", SortingData: map[string]interface{}{ utils.Cost: 0.0136, utils.RatingPlanID: "RP_SPECIAL_1002", @@ -214,7 +214,7 @@ func testV1SplSGetLeastCostSuppliers(t *testing.T) { }, }, { - SupplierID: "supplier2", + RouteID: "supplier2", SortingData: map[string]interface{}{ utils.Cost: 1.2667, utils.RatingPlanID: "RP_RETAIL1", @@ -223,8 +223,8 @@ func testV1SplSGetLeastCostSuppliers(t *testing.T) { }, }, } - var suplsReply engine.SortedSuppliers - if err := splSv1Rpc.Call(utils.SupplierSv1GetSuppliers, + var suplsReply engine.SortedRoutes + if err := splSv1Rpc.Call(utils.RouteSv1GetRoutes, ev, &suplsReply); err != nil { t.Error(err) } else if !reflect.DeepEqual(eSpls, suplsReply) { @@ -233,11 +233,11 @@ func testV1SplSGetLeastCostSuppliers(t *testing.T) { } } -func testV1SplSGetLeastCostSuppliersWithoutUsage(t *testing.T) { - ev := &engine.ArgsGetSuppliers{ +func testV1SplSGetLeastCostRoutesWithoutUsage(t *testing.T) { + ev := &engine.ArgsGetRoutes{ CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", - ID: "testV1SplSGetLeastCostSuppliers", + ID: "testV1SplSGetLeastCostRoutes", Event: map[string]interface{}{ utils.Account: "1003", utils.Subject: "1003", @@ -246,13 +246,13 @@ func testV1SplSGetLeastCostSuppliersWithoutUsage(t *testing.T) { }, }, } - eSpls := engine.SortedSuppliers{ + eSpls := engine.SortedRoutes{ ProfileID: "SPL_LEASTCOST_1", Sorting: utils.MetaLC, Count: 3, - SortedSuppliers: []*engine.SortedSupplier{ + SortedRoutes: []*engine.SortedRoute{ { - SupplierID: "supplier3", + RouteID: "supplier3", SortingData: map[string]interface{}{ utils.Cost: 0.0102, utils.RatingPlanID: "RP_SPECIAL_1002", @@ -260,7 +260,7 @@ func testV1SplSGetLeastCostSuppliersWithoutUsage(t *testing.T) { }, }, { - SupplierID: "supplier1", + RouteID: "supplier1", SortingData: map[string]interface{}{ utils.Cost: 0.0102, utils.RatingPlanID: "RP_SPECIAL_1002", @@ -268,7 +268,7 @@ func testV1SplSGetLeastCostSuppliersWithoutUsage(t *testing.T) { }, }, { - SupplierID: "supplier2", + RouteID: "supplier2", SortingData: map[string]interface{}{ utils.Cost: 1.2, utils.RatingPlanID: "RP_RETAIL1", @@ -277,8 +277,8 @@ func testV1SplSGetLeastCostSuppliersWithoutUsage(t *testing.T) { }, }, } - var suplsReply engine.SortedSuppliers - if err := splSv1Rpc.Call(utils.SupplierSv1GetSuppliers, + var suplsReply engine.SortedRoutes + if err := splSv1Rpc.Call(utils.RouteSv1GetRoutes, ev, &suplsReply); err != nil { t.Error(err) } else if !reflect.DeepEqual(eSpls, suplsReply) { @@ -287,12 +287,12 @@ func testV1SplSGetLeastCostSuppliersWithoutUsage(t *testing.T) { } } -func testV1SplSGetLeastCostSuppliersWithMaxCost(t *testing.T) { - ev := &engine.ArgsGetSuppliers{ +func testV1SplSGetLeastCostRoutesWithMaxCost(t *testing.T) { + ev := &engine.ArgsGetRoutes{ MaxCost: "0.30", CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", - ID: "testV1SplSGetLeastCostSuppliers", + ID: "testV1SplSGetLeastCostRoutes", Event: map[string]interface{}{ utils.Account: "1003", utils.Subject: "1001", @@ -302,13 +302,13 @@ func testV1SplSGetLeastCostSuppliersWithMaxCost(t *testing.T) { }, }, } - eSpls := engine.SortedSuppliers{ + eSpls := engine.SortedRoutes{ ProfileID: "SPL_LEASTCOST_1", Sorting: utils.MetaLC, Count: 2, - SortedSuppliers: []*engine.SortedSupplier{ + SortedRoutes: []*engine.SortedRoute{ { - SupplierID: "supplier3", + RouteID: "supplier3", SortingData: map[string]interface{}{ utils.Cost: 0.0136, utils.RatingPlanID: "RP_SPECIAL_1002", @@ -316,7 +316,7 @@ func testV1SplSGetLeastCostSuppliersWithMaxCost(t *testing.T) { }, }, { - SupplierID: "supplier1", + RouteID: "supplier1", SortingData: map[string]interface{}{ utils.Cost: 0.0136, utils.RatingPlanID: "RP_SPECIAL_1002", @@ -325,8 +325,8 @@ func testV1SplSGetLeastCostSuppliersWithMaxCost(t *testing.T) { }, }, } - var suplsReply engine.SortedSuppliers - if err := splSv1Rpc.Call(utils.SupplierSv1GetSuppliers, + var suplsReply engine.SortedRoutes + if err := splSv1Rpc.Call(utils.RouteSv1GetRoutes, ev, &suplsReply); err != nil { t.Error(err) } else if !reflect.DeepEqual(eSpls, suplsReply) { @@ -335,12 +335,12 @@ func testV1SplSGetLeastCostSuppliersWithMaxCost(t *testing.T) { } } -func testV1SplSGetLeastCostSuppliersWithMaxCostNotFound(t *testing.T) { - ev := &engine.ArgsGetSuppliers{ +func testV1SplSGetLeastCostRoutesWithMaxCostNotFound(t *testing.T) { + ev := &engine.ArgsGetRoutes{ MaxCost: "0.001", CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", - ID: "testV1SplSGetLeastCostSuppliers", + ID: "testV1SplSGetLeastCostRoutes", Event: map[string]interface{}{ utils.Account: "1003", utils.Subject: "1001", @@ -350,19 +350,19 @@ func testV1SplSGetLeastCostSuppliersWithMaxCostNotFound(t *testing.T) { }, }, } - var suplsReply engine.SortedSuppliers - if err := splSv1Rpc.Call(utils.SupplierSv1GetSuppliers, + var suplsReply engine.SortedRoutes + if err := splSv1Rpc.Call(utils.RouteSv1GetRoutes, ev, &suplsReply); err != nil && err.Error() != utils.ErrNotFound.Error() { t.Error(err) } } -func testV1SplSGetLeastCostSuppliersWithMaxCost2(t *testing.T) { - ev := &engine.ArgsGetSuppliers{ +func testV1SplSGetLeastCostRoutesWithMaxCost2(t *testing.T) { + ev := &engine.ArgsGetRoutes{ MaxCost: utils.MetaEventCost, CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", - ID: "testV1SplSGetLeastCostSuppliers", + ID: "testV1SplSGetLeastCostRoutes", Event: map[string]interface{}{ utils.Account: "1003", utils.Subject: "SPECIAL_1002", @@ -373,13 +373,13 @@ func testV1SplSGetLeastCostSuppliersWithMaxCost2(t *testing.T) { }, }, } - eSpls := engine.SortedSuppliers{ + eSpls := engine.SortedRoutes{ ProfileID: "SPL_LEASTCOST_1", Sorting: utils.MetaLC, Count: 2, - SortedSuppliers: []*engine.SortedSupplier{ + SortedRoutes: []*engine.SortedRoute{ { - SupplierID: "supplier3", + RouteID: "supplier3", SortingData: map[string]interface{}{ utils.Cost: 0.1054, utils.RatingPlanID: "RP_SPECIAL_1002", @@ -387,7 +387,7 @@ func testV1SplSGetLeastCostSuppliersWithMaxCost2(t *testing.T) { }, }, { - SupplierID: "supplier1", + RouteID: "supplier1", SortingData: map[string]interface{}{ utils.Cost: 0.1054, utils.RatingPlanID: "RP_SPECIAL_1002", @@ -396,8 +396,8 @@ func testV1SplSGetLeastCostSuppliersWithMaxCost2(t *testing.T) { }, }, } - var suplsReply engine.SortedSuppliers - if err := splSv1Rpc.Call(utils.SupplierSv1GetSuppliers, + var suplsReply engine.SortedRoutes + if err := splSv1Rpc.Call(utils.RouteSv1GetRoutes, ev, &suplsReply); err != nil { t.Error(err) } else if !reflect.DeepEqual(eSpls, suplsReply) { @@ -406,11 +406,11 @@ func testV1SplSGetLeastCostSuppliersWithMaxCost2(t *testing.T) { } } -func testV1SplSGetHighestCostSuppliers(t *testing.T) { - ev := &engine.ArgsGetSuppliers{ +func testV1SplSGetHighestCostRoutes(t *testing.T) { + ev := &engine.ArgsGetRoutes{ CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", - ID: "testV1SplSGetHighestCostSuppliers", + ID: "testV1SplSGetHighestCostRoutes", Event: map[string]interface{}{ utils.Account: "1003", utils.Destination: "1002", @@ -420,13 +420,13 @@ func testV1SplSGetHighestCostSuppliers(t *testing.T) { }, }, } - eSpls := engine.SortedSuppliers{ + eSpls := engine.SortedRoutes{ ProfileID: "SPL_HIGHESTCOST_1", Sorting: utils.MetaHC, Count: 3, - SortedSuppliers: []*engine.SortedSupplier{ + SortedRoutes: []*engine.SortedRoute{ { - SupplierID: "supplier2", + RouteID: "supplier2", SortingData: map[string]interface{}{ utils.Cost: 1.2667, utils.RatingPlanID: "RP_RETAIL1", @@ -434,7 +434,7 @@ func testV1SplSGetHighestCostSuppliers(t *testing.T) { }, }, { - SupplierID: "supplier3", + RouteID: "supplier3", SortingData: map[string]interface{}{ utils.Cost: 0.0136, utils.RatingPlanID: "RP_SPECIAL_1002", @@ -442,7 +442,7 @@ func testV1SplSGetHighestCostSuppliers(t *testing.T) { }, }, { - SupplierID: "supplier1", + RouteID: "supplier1", SortingData: map[string]interface{}{ utils.Cost: 0.0136, utils.RatingPlanID: "RP_SPECIAL_1002", @@ -451,8 +451,8 @@ func testV1SplSGetHighestCostSuppliers(t *testing.T) { }, }, } - var suplsReply engine.SortedSuppliers - if err := splSv1Rpc.Call(utils.SupplierSv1GetSuppliers, + var suplsReply engine.SortedRoutes + if err := splSv1Rpc.Call(utils.RouteSv1GetRoutes, ev, &suplsReply); err != nil { t.Error(err) } else if !reflect.DeepEqual(eSpls, suplsReply) { @@ -461,12 +461,12 @@ func testV1SplSGetHighestCostSuppliers(t *testing.T) { } } -func testV1SplSGetLeastCostSuppliersErr(t *testing.T) { - ev := &engine.ArgsGetSuppliers{ +func testV1SplSGetLeastCostRoutesErr(t *testing.T) { + ev := &engine.ArgsGetRoutes{ IgnoreErrors: true, CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", - ID: "testV1SplSGetHighestCostSuppliers", + ID: "testV1SplSGetHighestCostRoutes", Event: map[string]interface{}{ utils.Account: "1000", utils.Destination: "1001", @@ -475,8 +475,8 @@ func testV1SplSGetLeastCostSuppliersErr(t *testing.T) { }, }, } - var suplsReply engine.SortedSuppliers - if err := splSv1Rpc.Call(utils.SupplierSv1GetSuppliers, + var suplsReply engine.SortedRoutes + if err := splSv1Rpc.Call(utils.RouteSv1GetRoutes, ev, &suplsReply); err.Error() != utils.ErrNotFound.Error() { t.Error(err) } @@ -620,135 +620,135 @@ func testV1SplSPolulateStatsForQOS(t *testing.T) { } } -func testV1SplSGetQOSSuppliers(t *testing.T) { - ev := &engine.ArgsGetSuppliers{ +func testV1SplSGetQOSRoutes(t *testing.T) { + ev := &engine.ArgsGetRoutes{ CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", - ID: "testV1SplSGetQOSSuppliers", + ID: "testV1SplSGetQOSRoutes", Event: map[string]interface{}{ "DistinctMatch": "*qos", }, }, } - expSupplierIDs := []string{"supplier1", "supplier3", "supplier2"} - var suplsReply engine.SortedSuppliers - if err := splSv1Rpc.Call(utils.SupplierSv1GetSuppliers, + expRouteIDs := []string{"supplier1", "supplier3", "supplier2"} + var suplsReply engine.SortedRoutes + if err := splSv1Rpc.Call(utils.RouteSv1GetRoutes, ev, &suplsReply); err != nil { t.Error(err) } else { - rcvSupl := make([]string, len(suplsReply.SortedSuppliers)) - for i, supl := range suplsReply.SortedSuppliers { - rcvSupl[i] = supl.SupplierID + rcvSupl := make([]string, len(suplsReply.SortedRoutes)) + for i, supl := range suplsReply.SortedRoutes { + rcvSupl[i] = supl.RouteID } if suplsReply.ProfileID != "SPL_QOS_1" { t.Errorf("Expecting: SPL_QOS_1, received: %s", suplsReply.ProfileID) } - if !reflect.DeepEqual(rcvSupl, expSupplierIDs) { + if !reflect.DeepEqual(rcvSupl, expRouteIDs) { t.Errorf("Expecting: %+v, \n received: %+v", - expSupplierIDs, utils.ToJSON(rcvSupl)) + expRouteIDs, utils.ToJSON(rcvSupl)) } } } -func testV1SplSGetQOSSuppliers2(t *testing.T) { - ev := &engine.ArgsGetSuppliers{ +func testV1SplSGetQOSRoutes2(t *testing.T) { + ev := &engine.ArgsGetRoutes{ CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", - ID: "testV1SplSGetQOSSuppliers", + ID: "testV1SplSGetQOSRoutes", Event: map[string]interface{}{ "DistinctMatch": "*qos2", }, }, } - expSupplierIDs := []string{"supplier3", "supplier2", "supplier1"} - var suplsReply engine.SortedSuppliers - if err := splSv1Rpc.Call(utils.SupplierSv1GetSuppliers, + expRouteIDs := []string{"supplier3", "supplier2", "supplier1"} + var suplsReply engine.SortedRoutes + if err := splSv1Rpc.Call(utils.RouteSv1GetRoutes, ev, &suplsReply); err != nil { t.Error(err) } else { - rcvSupl := make([]string, len(suplsReply.SortedSuppliers)) - for i, supl := range suplsReply.SortedSuppliers { - rcvSupl[i] = supl.SupplierID + rcvSupl := make([]string, len(suplsReply.SortedRoutes)) + for i, supl := range suplsReply.SortedRoutes { + rcvSupl[i] = supl.RouteID } if suplsReply.ProfileID != "SPL_QOS_2" { t.Errorf("Expecting: SPL_QOS_2, received: %s", suplsReply.ProfileID) } - if !reflect.DeepEqual(rcvSupl, expSupplierIDs) { + if !reflect.DeepEqual(rcvSupl, expRouteIDs) { t.Errorf("Expecting: %+v, \n received: %+v", - expSupplierIDs, utils.ToJSON(rcvSupl)) + expRouteIDs, utils.ToJSON(rcvSupl)) } } } -func testV1SplSGetQOSSuppliers3(t *testing.T) { - ev := &engine.ArgsGetSuppliers{ +func testV1SplSGetQOSRoutes3(t *testing.T) { + ev := &engine.ArgsGetRoutes{ CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", - ID: "testV1SplSGetQOSSuppliers", + ID: "testV1SplSGetQOSRoutes", Event: map[string]interface{}{ "DistinctMatch": "*qos3", }, }, } - expSupplierIDs := []string{"supplier1", "supplier3", "supplier2"} - var suplsReply engine.SortedSuppliers - if err := splSv1Rpc.Call(utils.SupplierSv1GetSuppliers, + expRouteIDs := []string{"supplier1", "supplier3", "supplier2"} + var suplsReply engine.SortedRoutes + if err := splSv1Rpc.Call(utils.RouteSv1GetRoutes, ev, &suplsReply); err != nil { t.Error(err) } else { - rcvSupl := make([]string, len(suplsReply.SortedSuppliers)) - for i, supl := range suplsReply.SortedSuppliers { - rcvSupl[i] = supl.SupplierID + rcvSupl := make([]string, len(suplsReply.SortedRoutes)) + for i, supl := range suplsReply.SortedRoutes { + rcvSupl[i] = supl.RouteID } if suplsReply.ProfileID != "SPL_QOS_3" { t.Errorf("Expecting: SPL_QOS_3, received: %s", suplsReply.ProfileID) } - if !reflect.DeepEqual(rcvSupl, expSupplierIDs) { + if !reflect.DeepEqual(rcvSupl, expRouteIDs) { t.Errorf("Expecting: %+v, \n received: %+v", - expSupplierIDs, utils.ToJSON(rcvSupl)) + expRouteIDs, utils.ToJSON(rcvSupl)) } } } -func testV1SplSGetQOSSuppliersFiltred(t *testing.T) { - ev := &engine.ArgsGetSuppliers{ +func testV1SplSGetQOSRoutesFiltred(t *testing.T) { + ev := &engine.ArgsGetRoutes{ CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", - ID: "testV1SplSGetQOSSuppliers", + ID: "testV1SplSGetQOSRoutes", Event: map[string]interface{}{ "DistinctMatch": "*qos_filtred", }, }, } - expSupplierIDs := []string{"supplier1", "supplier3"} - var suplsReply engine.SortedSuppliers - if err := splSv1Rpc.Call(utils.SupplierSv1GetSuppliers, + expRouteIDs := []string{"supplier1", "supplier3"} + var suplsReply engine.SortedRoutes + if err := splSv1Rpc.Call(utils.RouteSv1GetRoutes, ev, &suplsReply); err != nil { t.Error(err) } else { - rcvSupl := make([]string, len(suplsReply.SortedSuppliers)) - for i, supl := range suplsReply.SortedSuppliers { - rcvSupl[i] = supl.SupplierID + rcvSupl := make([]string, len(suplsReply.SortedRoutes)) + for i, supl := range suplsReply.SortedRoutes { + rcvSupl[i] = supl.RouteID } if suplsReply.ProfileID != "SPL_QOS_FILTRED" { t.Errorf("Expecting: SPL_QOS_FILTRED, received: %s", suplsReply.ProfileID) } - if !reflect.DeepEqual(rcvSupl, expSupplierIDs) { + if !reflect.DeepEqual(rcvSupl, expRouteIDs) { t.Errorf("Expecting: %+v, \n received: %+v", - expSupplierIDs, utils.ToJSON(suplsReply)) + expRouteIDs, utils.ToJSON(suplsReply)) } } } -func testV1SplSGetQOSSuppliersFiltred2(t *testing.T) { - ev := &engine.ArgsGetSuppliers{ +func testV1SplSGetQOSRoutesFiltred2(t *testing.T) { + ev := &engine.ArgsGetRoutes{ CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", - ID: "testV1SplSGetQOSSuppliers", + ID: "testV1SplSGetQOSRoutes", Event: map[string]interface{}{ "DistinctMatch": "*qos_filtred2", utils.Account: "1003", @@ -758,53 +758,53 @@ func testV1SplSGetQOSSuppliersFiltred2(t *testing.T) { }, }, } - expSupplierIDs := []string{"supplier3", "supplier2"} - var suplsReply engine.SortedSuppliers - if err := splSv1Rpc.Call(utils.SupplierSv1GetSuppliers, + expRouteIDs := []string{"supplier3", "supplier2"} + var suplsReply engine.SortedRoutes + if err := splSv1Rpc.Call(utils.RouteSv1GetRoutes, ev, &suplsReply); err != nil { t.Error(err) } else { - rcvSupl := make([]string, len(suplsReply.SortedSuppliers)) - for i, supl := range suplsReply.SortedSuppliers { - rcvSupl[i] = supl.SupplierID + rcvSupl := make([]string, len(suplsReply.SortedRoutes)) + for i, supl := range suplsReply.SortedRoutes { + rcvSupl[i] = supl.RouteID } if suplsReply.ProfileID != "SPL_QOS_FILTRED2" { t.Errorf("Expecting: SPL_QOS_FILTRED2, received: %s", suplsReply.ProfileID) } - if !reflect.DeepEqual(rcvSupl, expSupplierIDs) { + if !reflect.DeepEqual(rcvSupl, expRouteIDs) { t.Errorf("Expecting: %+v, \n received: %+v", - expSupplierIDs, utils.ToJSON(rcvSupl)) + expRouteIDs, utils.ToJSON(rcvSupl)) } } } -func testV1SplSGetSupplierWithoutFilter(t *testing.T) { - ev := &engine.ArgsGetSuppliers{ +func testV1SplSGetRouteWithoutFilter(t *testing.T) { + ev := &engine.ArgsGetRoutes{ CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", - ID: "testV1SplSGetSupplierWithoutFilter", + ID: "testV1SplSGetRouteWithoutFilter", Event: map[string]interface{}{ utils.Account: "1008", utils.Destination: "+49", }, }, } - eSpls := engine.SortedSuppliers{ + eSpls := engine.SortedRoutes{ ProfileID: "SPL_WEIGHT_2", Sorting: utils.MetaWeight, Count: 1, - SortedSuppliers: []*engine.SortedSupplier{ + SortedRoutes: []*engine.SortedRoute{ { - SupplierID: "supplier1", + RouteID: "supplier1", SortingData: map[string]interface{}{ utils.Weight: 10.0, }, }, }, } - var suplsReply engine.SortedSuppliers - if err := splSv1Rpc.Call(utils.SupplierSv1GetSuppliers, + var suplsReply engine.SortedRoutes + if err := splSv1Rpc.Call(utils.RouteSv1GetRoutes, ev, &suplsReply); err != nil { t.Error(err) } else if !reflect.DeepEqual(eSpls, suplsReply) { @@ -813,31 +813,31 @@ func testV1SplSGetSupplierWithoutFilter(t *testing.T) { } } -func testV1SplSSetSupplierProfiles(t *testing.T) { - var reply *engine.SupplierProfile - if err := splSv1Rpc.Call(utils.APIerSv1GetSupplierProfile, +func testV1SplSSetRouteProfiles(t *testing.T) { + var reply *engine.RouteProfile + if err := splSv1Rpc.Call(utils.APIerSv1GetRouteProfile, &utils.TenantID{Tenant: "cgrates.org", ID: "TEST_PROFILE1"}, &reply); err == nil || err.Error() != utils.ErrNotFound.Error() { t.Error(err) } - splPrf = &SupplierWithCache{ - SupplierProfile: &engine.SupplierProfile{ + splPrf = &RouteWithCache{ + RouteProfile: &engine.RouteProfile{ Tenant: "cgrates.org", ID: "TEST_PROFILE1", FilterIDs: []string{"FLTR_1"}, Sorting: "Sort1", SortingParameters: []string{"Param1", "Param2"}, - Suppliers: []*engine.Supplier{ + Routes: []*engine.Route{ { - ID: "SPL1", - RatingPlanIDs: []string{"RP1"}, - FilterIDs: []string{"FLTR_1"}, - AccountIDs: []string{"Acc"}, - ResourceIDs: []string{"Res1", "ResGroup2"}, - StatIDs: []string{"Stat1"}, - Weight: 20, - Blocker: false, - SupplierParameters: "SortingParameter1", + ID: "SPL1", + RatingPlanIDs: []string{"RP1"}, + FilterIDs: []string{"FLTR_1"}, + AccountIDs: []string{"Acc"}, + ResourceIDs: []string{"Res1", "ResGroup2"}, + StatIDs: []string{"Stat1"}, + Weight: 20, + Blocker: false, + RouteParameters: "SortingParameter1", }, }, Weight: 10, @@ -845,25 +845,25 @@ func testV1SplSSetSupplierProfiles(t *testing.T) { } var result string - if err := splSv1Rpc.Call(utils.APIerSv1SetSupplierProfile, splPrf, &result); err != nil { + if err := splSv1Rpc.Call(utils.APIerSv1SetRouteProfile, splPrf, &result); err != nil { t.Error(err) } else if result != utils.OK { t.Error("Unexpected reply returned", result) } - if err := splSv1Rpc.Call(utils.APIerSv1GetSupplierProfile, + if err := splSv1Rpc.Call(utils.APIerSv1GetRouteProfile, &utils.TenantID{Tenant: "cgrates.org", ID: "TEST_PROFILE1"}, &reply); err != nil { t.Error(err) - } else if !reflect.DeepEqual(splPrf.SupplierProfile, reply) { - t.Errorf("Expecting: %+v, received: %+v", splPrf.SupplierProfile, reply) + } else if !reflect.DeepEqual(splPrf.RouteProfile, reply) { + t.Errorf("Expecting: %+v, received: %+v", splPrf.RouteProfile, reply) } } -func testV1SplSGetSupplierProfileIDs(t *testing.T) { +func testV1SplSGetRouteProfileIDs(t *testing.T) { expected := []string{"SPL_HIGHESTCOST_1", "SPL_QOS_1", "SPL_QOS_2", "SPL_QOS_FILTRED", "SPL_QOS_FILTRED2", "SPL_ACNT_1001", "SPL_LEASTCOST_1", "SPL_WEIGHT_2", "SPL_WEIGHT_1", "SPL_QOS_3", "TEST_PROFILE1", "SPL_LOAD_DIST", "SPL_LCR"} var result []string - if err := splSv1Rpc.Call(utils.APIerSv1GetSupplierProfileIDs, + if err := splSv1Rpc.Call(utils.APIerSv1GetRouteProfileIDs, &utils.TenantArgWithPaginator{TenantArg: utils.TenantArg{"cgrates.org"}}, &result); err != nil { t.Error(err) } else if len(expected) != len(result) { @@ -871,104 +871,104 @@ func testV1SplSGetSupplierProfileIDs(t *testing.T) { } } -func testV1SplSUpdateSupplierProfiles(t *testing.T) { - splPrf.Suppliers = []*engine.Supplier{ +func testV1SplSUpdateRouteProfiles(t *testing.T) { + splPrf.Routes = []*engine.Route{ { - ID: "SPL1", - RatingPlanIDs: []string{"RP1"}, - FilterIDs: []string{"FLTR_1"}, - AccountIDs: []string{"Acc"}, - ResourceIDs: []string{"Res1", "ResGroup2"}, - StatIDs: []string{"Stat1"}, - Weight: 20, - Blocker: false, - SupplierParameters: "SortingParameter1", + ID: "SPL1", + RatingPlanIDs: []string{"RP1"}, + FilterIDs: []string{"FLTR_1"}, + AccountIDs: []string{"Acc"}, + ResourceIDs: []string{"Res1", "ResGroup2"}, + StatIDs: []string{"Stat1"}, + Weight: 20, + Blocker: false, + RouteParameters: "SortingParameter1", }, { - ID: "SPL2", - RatingPlanIDs: []string{"RP2"}, - FilterIDs: []string{"FLTR_2"}, - AccountIDs: []string{"Acc"}, - ResourceIDs: []string{"Res2", "ResGroup2"}, - StatIDs: []string{"Stat2"}, - Weight: 20, - Blocker: true, - SupplierParameters: "SortingParameter2", + ID: "SPL2", + RatingPlanIDs: []string{"RP2"}, + FilterIDs: []string{"FLTR_2"}, + AccountIDs: []string{"Acc"}, + ResourceIDs: []string{"Res2", "ResGroup2"}, + StatIDs: []string{"Stat2"}, + Weight: 20, + Blocker: true, + RouteParameters: "SortingParameter2", }, } - reverseSuppliers := []*engine.Supplier{ + reverseRoutes := []*engine.Route{ { - ID: "SPL2", - RatingPlanIDs: []string{"RP2"}, - FilterIDs: []string{"FLTR_2"}, - AccountIDs: []string{"Acc"}, - ResourceIDs: []string{"Res2", "ResGroup2"}, - StatIDs: []string{"Stat2"}, - Weight: 20, - Blocker: true, - SupplierParameters: "SortingParameter2", + ID: "SPL2", + RatingPlanIDs: []string{"RP2"}, + FilterIDs: []string{"FLTR_2"}, + AccountIDs: []string{"Acc"}, + ResourceIDs: []string{"Res2", "ResGroup2"}, + StatIDs: []string{"Stat2"}, + Weight: 20, + Blocker: true, + RouteParameters: "SortingParameter2", }, { - ID: "SPL1", - RatingPlanIDs: []string{"RP1"}, - FilterIDs: []string{"FLTR_1"}, - AccountIDs: []string{"Acc"}, - ResourceIDs: []string{"Res1", "ResGroup2"}, - StatIDs: []string{"Stat1"}, - Weight: 20, - Blocker: false, - SupplierParameters: "SortingParameter1", + ID: "SPL1", + RatingPlanIDs: []string{"RP1"}, + FilterIDs: []string{"FLTR_1"}, + AccountIDs: []string{"Acc"}, + ResourceIDs: []string{"Res1", "ResGroup2"}, + StatIDs: []string{"Stat1"}, + Weight: 20, + Blocker: false, + RouteParameters: "SortingParameter1", }, } var result string - if err := splSv1Rpc.Call(utils.APIerSv1SetSupplierProfile, splPrf, &result); err != nil { + if err := splSv1Rpc.Call(utils.APIerSv1SetRouteProfile, splPrf, &result); err != nil { t.Error(err) } else if result != utils.OK { t.Error("Unexpected reply returned", result) } - var reply *engine.SupplierProfile - if err := splSv1Rpc.Call(utils.APIerSv1GetSupplierProfile, + var reply *engine.RouteProfile + if err := splSv1Rpc.Call(utils.APIerSv1GetRouteProfile, &utils.TenantID{Tenant: "cgrates.org", ID: "TEST_PROFILE1"}, &reply); err != nil { t.Error(err) - } else if !reflect.DeepEqual(splPrf.Suppliers, reply.Suppliers) && !reflect.DeepEqual(reverseSuppliers, reply.Suppliers) { + } else if !reflect.DeepEqual(splPrf.Routes, reply.Routes) && !reflect.DeepEqual(reverseRoutes, reply.Routes) { t.Errorf("Expecting: %+v, received: %+v", utils.ToJSON(splPrf), utils.ToJSON(reply)) } } -func testV1SplSRemSupplierProfiles(t *testing.T) { +func testV1SplSRemRouteProfiles(t *testing.T) { var resp string - if err := splSv1Rpc.Call(utils.APIerSv1RemoveSupplierProfile, + if err := splSv1Rpc.Call(utils.APIerSv1RemoveRouteProfile, &utils.TenantIDWithCache{Tenant: "cgrates.org", ID: "TEST_PROFILE1"}, &resp); err != nil { t.Error(err) } else if resp != utils.OK { t.Error("Unexpected reply returned", resp) } - var reply *engine.SupplierProfile - if err := splSv1Rpc.Call(utils.APIerSv1GetSupplierProfile, + var reply *engine.RouteProfile + if err := splSv1Rpc.Call(utils.APIerSv1GetRouteProfile, &utils.TenantID{Tenant: "cgrates.org", ID: "TEST_PROFILE1"}, &reply); err == nil || err.Error() != utils.ErrNotFound.Error() { t.Error(err) } - if err := splSv1Rpc.Call(utils.APIerSv1RemoveSupplierProfile, + if err := splSv1Rpc.Call(utils.APIerSv1RemoveRouteProfile, &utils.TenantIDWithCache{Tenant: "cgrates.org", ID: "TEST_PROFILE1"}, &resp); err.Error() != utils.ErrNotFound.Error() { t.Errorf("Expected error: %v recived: %v", utils.ErrNotFound, err) } } -func testV1SplSupplierPing(t *testing.T) { +func testV1SplRoutePing(t *testing.T) { var resp string - if err := splSv1Rpc.Call(utils.SupplierSv1Ping, new(utils.CGREvent), &resp); err != nil { + if err := splSv1Rpc.Call(utils.RouteSv1Ping, new(utils.CGREvent), &resp); err != nil { t.Error(err) } else if resp != utils.Pong { t.Error("Unexpected reply returned", resp) } } -func testV1SplSGetSupplierForEvent(t *testing.T) { +func testV1SplSGetRouteForEvent(t *testing.T) { ev := &utils.CGREventWithArgDispatcher{ CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", - ID: "testV1SplSGetHighestCostSuppliers", + ID: "testV1SplSGetHighestCostRoutes", Event: map[string]interface{}{ utils.Account: "1000", utils.Destination: "1001", @@ -977,7 +977,7 @@ func testV1SplSGetSupplierForEvent(t *testing.T) { }, }, } - expected := engine.SupplierProfile{ + expected := engine.RouteProfile{ Tenant: "cgrates.org", ID: "SPL_LCR", FilterIDs: []string{"FLTR_TEST"}, @@ -986,28 +986,28 @@ func testV1SplSGetSupplierForEvent(t *testing.T) { }, Sorting: utils.MetaLC, SortingParameters: []string{}, - Suppliers: []*engine.Supplier{ - &engine.Supplier{ - ID: "supplier_1", - FilterIDs: nil, - AccountIDs: nil, - RatingPlanIDs: []string{"RP_TEST_1"}, - ResourceIDs: nil, - StatIDs: nil, - Weight: 10, - Blocker: false, - SupplierParameters: "", + Routes: []*engine.Route{ + &engine.Route{ + ID: "supplier_1", + FilterIDs: nil, + AccountIDs: nil, + RatingPlanIDs: []string{"RP_TEST_1"}, + ResourceIDs: nil, + StatIDs: nil, + Weight: 10, + Blocker: false, + RouteParameters: "", }, - &engine.Supplier{ - ID: "supplier_2", - FilterIDs: nil, - AccountIDs: nil, - RatingPlanIDs: []string{"RP_TEST_2"}, - ResourceIDs: nil, - StatIDs: nil, - Weight: 0, - Blocker: false, - SupplierParameters: "", + &engine.Route{ + ID: "supplier_2", + FilterIDs: nil, + AccountIDs: nil, + RatingPlanIDs: []string{"RP_TEST_2"}, + ResourceIDs: nil, + StatIDs: nil, + Weight: 0, + Blocker: false, + RouteParameters: "", }, }, Weight: 50, @@ -1015,16 +1015,16 @@ func testV1SplSGetSupplierForEvent(t *testing.T) { if *encoding == utils.MetaGOB { // in gob emtpty slice is encoded as nil expected.SortingParameters = nil } - var supProf []*engine.SupplierProfile - if err := splSv1Rpc.Call(utils.SupplierSv1GetSupplierProfilesForEvent, + var supProf []*engine.RouteProfile + if err := splSv1Rpc.Call(utils.RouteSv1GetRouteProfilesForEvent, ev, &supProf); err != nil { t.Fatal(err) } - sort.Slice(expected.Suppliers, func(i, j int) bool { - return expected.Suppliers[i].Weight < expected.Suppliers[j].Weight + sort.Slice(expected.Routes, func(i, j int) bool { + return expected.Routes[i].Weight < expected.Routes[j].Weight }) - sort.Slice(supProf[0].Suppliers, func(i, j int) bool { - return supProf[0].Suppliers[i].Weight < supProf[0].Suppliers[j].Weight + sort.Slice(supProf[0].Routes, func(i, j int) bool { + return supProf[0].Routes[i].Weight < supProf[0].Routes[j].Weight }) if !reflect.DeepEqual(expected, *supProf[0]) { t.Errorf("Expected: %s ,received: %s", utils.ToJSON(expected), utils.ToJSON(supProf)) @@ -1034,22 +1034,22 @@ func testV1SplSGetSupplierForEvent(t *testing.T) { // Scenario: We create two rating plans RP_MOBILE and RP_LOCAL // RP_LOCAL contains destination for both mobile and local // and RP_MOBILE contains destinations only for mobile -// Create a SupplierProfile with *least_cost strategy with 2 suppliers +// Create a RouteProfile with *least_cost strategy with 2 suppliers // supplier1 have attached RP_LOCAL and supplier2 have attach RP_MOBILE -func testV1SplsOneSupplierWithoutDestination(t *testing.T) { - var reply *engine.SupplierProfile - if err := splSv1Rpc.Call(utils.APIerSv1GetSupplierProfile, +func testV1SplsOneRouteWithoutDestination(t *testing.T) { + var reply *engine.RouteProfile + if err := splSv1Rpc.Call(utils.APIerSv1GetRouteProfile, &utils.TenantID{Tenant: "cgrates.org", ID: "SPL_DESTINATION"}, &reply); err == nil || err.Error() != utils.ErrNotFound.Error() { t.Error(err) } - splPrf = &SupplierWithCache{ - SupplierProfile: &engine.SupplierProfile{ + splPrf = &RouteWithCache{ + RouteProfile: &engine.RouteProfile{ Tenant: "cgrates.org", ID: "SPL_DESTINATION", FilterIDs: []string{"*string:~*req.Account:SpecialCase"}, Sorting: utils.MetaLC, - Suppliers: []*engine.Supplier{ + Routes: []*engine.Route{ { ID: "local", RatingPlanIDs: []string{"RP_LOCAL"}, @@ -1067,16 +1067,16 @@ func testV1SplsOneSupplierWithoutDestination(t *testing.T) { } var result string - if err := splSv1Rpc.Call(utils.APIerSv1SetSupplierProfile, splPrf, &result); err != nil { + if err := splSv1Rpc.Call(utils.APIerSv1SetRouteProfile, splPrf, &result); err != nil { t.Error(err) } else if result != utils.OK { t.Error("Unexpected reply returned", result) } - ev := &engine.ArgsGetSuppliers{ + ev := &engine.ArgsGetRoutes{ CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", - ID: "testV1SplsOneSupplierWithoutDestination", + ID: "testV1SplsOneRouteWithoutDestination", Event: map[string]interface{}{ utils.Account: "SpecialCase", utils.Destination: "+24680", @@ -1085,13 +1085,13 @@ func testV1SplsOneSupplierWithoutDestination(t *testing.T) { }, }, } - eSpls := engine.SortedSuppliers{ + eSpls := engine.SortedRoutes{ ProfileID: "SPL_DESTINATION", Sorting: utils.MetaLC, Count: 1, - SortedSuppliers: []*engine.SortedSupplier{ + SortedRoutes: []*engine.SortedRoute{ { - SupplierID: "local", + RouteID: "local", SortingData: map[string]interface{}{ utils.Cost: 0.0396, "RatingPlanID": "RP_LOCAL", @@ -1100,8 +1100,8 @@ func testV1SplsOneSupplierWithoutDestination(t *testing.T) { }, }, } - var suplsReply engine.SortedSuppliers - if err := splSv1Rpc.Call(utils.SupplierSv1GetSuppliers, + var suplsReply engine.SortedRoutes + if err := splSv1Rpc.Call(utils.RouteSv1GetRoutes, ev, &suplsReply); err != nil { t.Error(err) } else if !reflect.DeepEqual(eSpls, suplsReply) { diff --git a/apier/v1/tp_it_test.go b/apier/v1/tp_it_test.go index 28500262c..24d57dadf 100644 --- a/apier/v1/tp_it_test.go +++ b/apier/v1/tp_it_test.go @@ -124,7 +124,7 @@ func testTPExportTPToFolder(t *testing.T) { ExportPath: "/tmp/", ExportedFiles: []string{utils.RatingProfilesCsv, utils.RatingPlansCsv, utils.ActionsCsv, utils.AccountActionsCsv, utils.ChargersCsv, utils.TimingsCsv, utils.ActionPlansCsv, utils.ResourcesCsv, utils.StatsCsv, utils.ThresholdsCsv, - utils.DestinationsCsv, utils.RatesCsv, utils.DestinationRatesCsv, utils.FiltersCsv, utils.SuppliersCsv, utils.AttributesCsv}, + utils.DestinationsCsv, utils.RatesCsv, utils.DestinationRatesCsv, utils.FiltersCsv, utils.RoutesCsv, utils.AttributesCsv}, } sort.Strings(expectedTPStas.ExportedFiles) tpid := "TEST_TPID2" diff --git a/config/cfg_data.json b/config/cfg_data.json index 2ac7666a8..31fa0aaa3 100644 --- a/config/cfg_data.json +++ b/config/cfg_data.json @@ -32,7 +32,7 @@ "enabled": true, }, -"suppliers": { +"routes": { "enabled": true, }, diff --git a/config/config_it_test.go b/config/config_it_test.go index 417cb9f06..db62528b3 100644 --- a/config/config_it_test.go +++ b/config/config_it_test.go @@ -929,7 +929,7 @@ func testCGRConfigReloadConfigFromJSONSessionS(t *testing.T) { "sessions": map[string]interface{}{ "enabled": true, "resources_conns": []string{"*localhost"}, - "suppliers_conns": []string{"*localhost"}, + "routes_conns": []string{"*localhost"}, "attributes_conns": []string{"*localhost"}, "rals_conns": []string{"*internal"}, "cdrs_conns": []string{"*internal"}, diff --git a/data/conf/cgrates/cgrates.json b/data/conf/cgrates/cgrates.json index c124d046a..fd4e12e95 100755 --- a/data/conf/cgrates/cgrates.json +++ b/data/conf/cgrates/cgrates.json @@ -71,7 +71,7 @@ // "*threshold_profiles": {"remote":false, "replicate":false, "limit": -1, "ttl": "", "static_ttl": false}, // "*thresholds": {"remote":false, "replicate":false, "limit": -1, "ttl": "", "static_ttl": false}, // "*filters": {"remote":false, "replicate":false, "limit": -1, "ttl": "", "static_ttl": false}, -// "*supplier_profiles":{"remote":false, "replicate":false, "limit": -1, "ttl": "", "static_ttl": false}, +// "*route_profiles":{"remote":false, "replicate":false, "limit": -1, "ttl": "", "static_ttl": false}, // "*attribute_profiles":{"remote":false, "replicate":false, "limit": -1, "ttl": "", "static_ttl": false}, // "*charger_profiles": {"remote":false, "replicate":false, "limit": -1, "ttl": "", "static_ttl": false}, // "*dispatcher_profiles":{"remote":false, "replicate":false, "limit": -1, "ttl": "", "static_ttl": false}, @@ -182,7 +182,7 @@ // "*threshold_profiles": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false, "replicate": false}, // control threshold profiles caching // "*thresholds": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false, "replicate": false}, // control thresholds caching // "*filters": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false, "replicate": false}, // control filters caching -// "*supplier_profiles": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false, "replicate": false}, // control supplier profile caching +// "*route_profiles": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false, "replicate": false}, // control supplier profile caching // "*attribute_profiles": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false, "replicate": false}, // control attribute profile caching // "*charger_profiles": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false, "replicate": false}, // control charger profile caching // "*dispatcher_profiles": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false, "replicate": false}, // control dispatcher profile caching @@ -190,7 +190,7 @@ // "*resource_filter_indexes" : {"limit": -1, "ttl": "", "static_ttl": false, "replicate": false}, // control resource filter indexes caching // "*stat_filter_indexes" : {"limit": -1, "ttl": "", "static_ttl": false, "replicate": false}, // control stat filter indexes caching // "*threshold_filter_indexes" : {"limit": -1, "ttl": "", "static_ttl": false, "replicate": false}, // control threshold filter indexes caching -// "*supplier_filter_indexes" : {"limit": -1, "ttl": "", "static_ttl": false, "replicate": false}, // control supplier filter indexes caching +// "*route_filter_indexes" : {"limit": -1, "ttl": "", "static_ttl": false, "replicate": false}, // control supplier filter indexes caching // "*attribute_filter_indexes" : {"limit": -1, "ttl": "", "static_ttl": false, "replicate": false}, // control attribute filter indexes caching // "*charger_filter_indexes" : {"limit": -1, "ttl": "", "static_ttl": false, "replicate": false}, // control charger filter indexes caching // "*dispatcher_filter_indexes" : {"limit": -1, "ttl": "", "static_ttl": false, "replicate": false}, // control dispatcher filter indexes caching @@ -329,7 +329,7 @@ // "resources_conns": [], // connections to ResourceS for resources monitoring <""|*internal|$rpc_conns_id> // "thresholds_conns": [], // connections to ThresholdS for reporting session events <""|*internal|$rpc_conns_id> // "stats_conns": [], // connections to StatS for reporting session events <""|*internal|$rpc_conns_id> -// "suppliers_conns": [], // connections to SupplierS for querying suppliers for event <""|*internal|$rpc_conns_id> +// "routes_conns": [], // connections to SupplierS for querying suppliers for event <""|*internal|$rpc_conns_id> // "attributes_conns": [], // connections to AttributeS for altering event fields <""|*internal|$rpc_conns_id> // "replication_conns": [], // replicate sessions towards these session services // "debit_interval": "0s", // interval to perform debits on. @@ -554,7 +554,7 @@ // }, -// "suppliers": { // SupplierS config +// "routes": { // SupplierS config // "enabled": false, // starts SupplierS service: . // "indexed_selects":true, // enable profile matching exclusively on indexes // //"string_indexed_fields": [], // query indexes based on these fields for faster processing @@ -664,8 +664,8 @@ // ], // }, // { -// "type": "*suppliers", // data source type -// "file_name": "Suppliers.csv", // file name in the tp_in_dir +// "type": "*routes", // data source type +// "file_name": "Routes.csv", // file name in the tp_in_dir // "fields": [ // {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~0", "mandatory": true}, // {"tag": "ID", "path": "ID", "type": "*variable", "value": "~1", "mandatory": true}, @@ -673,15 +673,15 @@ // {"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~3"}, // {"tag": "Sorting", "path": "Sorting", "type": "*variable", "value": "~4"}, // {"tag": "SortingParamameters", "path": "SortingParamameters", "type": "*variable", "value": "~5"}, -// {"tag": "SupplierID", "path": "SupplierID", "type": "*variable", "value": "~6"}, -// {"tag": "SupplierFilterIDs", "path": "SupplierFilterIDs", "type": "*variable", "value": "~7"}, -// {"tag": "SupplierAccountIDs", "path": "SupplierAccountIDs", "type": "*variable", "value": "~8"}, -// {"tag": "SupplierRatingPlanIDs", "path": "SupplierRatingPlanIDs", "type": "*variable", "value": "~9"}, -// {"tag": "SupplierResourceIDs", "path": "SupplierResourceIDs", "type": "*variable", "value": "~10"}, -// {"tag": "SupplierStatIDs", "path": "SupplierStatIDs", "type": "*variable", "value": "~11"}, -// {"tag": "SupplierWeight", "path": "SupplierWeight", "type": "*variable", "value": "~12"}, -// {"tag": "SupplierBlocker", "path": "SupplierBlocker", "type": "*variable", "value": "~13"}, -// {"tag": "SupplierParameters", "path": "SupplierParameters", "type": "*variable", "value": "~14"}, +// {"tag": "RouteID", "path": "RouteID", "type": "*variable", "value": "~6"}, +// {"tag": "RouteFilterIDs", "path": "RouteFilterIDs", "type": "*variable", "value": "~7"}, +// {"tag": "RouteAccountIDs", "path": "RouteAccountIDs", "type": "*variable", "value": "~8"}, +// {"tag": "RouteRatingPlanIDs", "path": "RouteRatingPlanIDs", "type": "*variable", "value": "~9"}, +// {"tag": "RouteResourceIDs", "path": "RouteResourceIDs", "type": "*variable", "value": "~10"}, +// {"tag": "RouteStatIDs", "path": "RouteStatIDs", "type": "*variable", "value": "~11"}, +// {"tag": "RouteWeight", "path": "RouteWeight", "type": "*variable", "value": "~12"}, +// {"tag": "RouteBlocker", "path": "RouteBlocker", "type": "*variable", "value": "~13"}, +// {"tag": "RouteParameters", "path": "RouteParameters", "type": "*variable", "value": "~14"}, // {"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~15"}, // ], // }, diff --git a/data/conf/samples/acc_balance_keep_internal/cgrates.json b/data/conf/samples/acc_balance_keep_internal/cgrates.json index 5f05952c3..5fda682e6 100644 --- a/data/conf/samples/acc_balance_keep_internal/cgrates.json +++ b/data/conf/samples/acc_balance_keep_internal/cgrates.json @@ -91,7 +91,7 @@ }, -"suppliers": { +"route": { "enabled": true, "stats_conns": ["*internal"], }, diff --git a/data/conf/samples/acc_balance_keep_internal_gob/cgrates.json b/data/conf/samples/acc_balance_keep_internal_gob/cgrates.json index 062cd5c03..f53e8228b 100644 --- a/data/conf/samples/acc_balance_keep_internal_gob/cgrates.json +++ b/data/conf/samples/acc_balance_keep_internal_gob/cgrates.json @@ -97,7 +97,7 @@ }, -"suppliers": { +"route": { "enabled": true, "stats_conns": ["*internal"], }, diff --git a/data/conf/samples/acc_balance_keep_mongo/cgrates.json b/data/conf/samples/acc_balance_keep_mongo/cgrates.json index 1ae0620b5..bd0b4f7b8 100644 --- a/data/conf/samples/acc_balance_keep_mongo/cgrates.json +++ b/data/conf/samples/acc_balance_keep_mongo/cgrates.json @@ -92,7 +92,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "stats_conns": ["*internal"], }, diff --git a/data/conf/samples/acc_balance_keep_mongo_gob/cgrates.json b/data/conf/samples/acc_balance_keep_mongo_gob/cgrates.json index 9f09b6529..23da760f0 100644 --- a/data/conf/samples/acc_balance_keep_mongo_gob/cgrates.json +++ b/data/conf/samples/acc_balance_keep_mongo_gob/cgrates.json @@ -101,7 +101,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "stats_conns": ["*internal"], }, diff --git a/data/conf/samples/acc_balance_keep_mysql/cgrates.json b/data/conf/samples/acc_balance_keep_mysql/cgrates.json index d04f57f7e..e9f7f59d3 100644 --- a/data/conf/samples/acc_balance_keep_mysql/cgrates.json +++ b/data/conf/samples/acc_balance_keep_mysql/cgrates.json @@ -91,7 +91,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "stats_conns": ["*internal"], }, diff --git a/data/conf/samples/acc_balance_keep_mysql_gob/cgrates.json b/data/conf/samples/acc_balance_keep_mysql_gob/cgrates.json index adf11802f..4361a5728 100644 --- a/data/conf/samples/acc_balance_keep_mysql_gob/cgrates.json +++ b/data/conf/samples/acc_balance_keep_mysql_gob/cgrates.json @@ -98,7 +98,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "stats_conns": ["*internal"], }, diff --git a/data/conf/samples/apier_mongo/apier.json b/data/conf/samples/apier_mongo/apier.json index 10bdbc225..2ec231b8a 100644 --- a/data/conf/samples/apier_mongo/apier.json +++ b/data/conf/samples/apier_mongo/apier.json @@ -74,7 +74,7 @@ }, -"suppliers": { +"routes": { "enabled": true, }, diff --git a/data/conf/samples/apier_mysql/apier.json b/data/conf/samples/apier_mysql/apier.json index da8307ebb..e0c6d52ed 100644 --- a/data/conf/samples/apier_mysql/apier.json +++ b/data/conf/samples/apier_mysql/apier.json @@ -71,7 +71,7 @@ }, -"suppliers": { +"routes": { "enabled": true, }, diff --git a/data/conf/samples/cdrewithfilter_internal/cgrates.json b/data/conf/samples/cdrewithfilter_internal/cgrates.json index d94e72c2b..3c5111240 100755 --- a/data/conf/samples/cdrewithfilter_internal/cgrates.json +++ b/data/conf/samples/cdrewithfilter_internal/cgrates.json @@ -92,7 +92,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "stats_conns": ["*localhost"], }, @@ -100,7 +100,7 @@ "sessions": { "enabled": true, - "suppliers_conns": ["*internal"], + "routes_conns": ["*internal"], "resources_conns": ["*internal"], "attributes_conns": ["*internal"], "rals_conns": ["*internal"], diff --git a/data/conf/samples/cdrewithfilter_mongo/cgrates.json b/data/conf/samples/cdrewithfilter_mongo/cgrates.json index f6f9ca826..c931d63f0 100755 --- a/data/conf/samples/cdrewithfilter_mongo/cgrates.json +++ b/data/conf/samples/cdrewithfilter_mongo/cgrates.json @@ -96,7 +96,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "stats_conns": ["*localhost"], }, @@ -104,7 +104,7 @@ "sessions": { "enabled": true, - "suppliers_conns": ["*internal"], + "routes_conns": ["*internal"], "resources_conns": ["*internal"], "attributes_conns": ["*internal"], "rals_conns": ["*internal"], diff --git a/data/conf/samples/cdrewithfilter_mysql/cgrates.json b/data/conf/samples/cdrewithfilter_mysql/cgrates.json index 49e81f925..0f2cec7db 100755 --- a/data/conf/samples/cdrewithfilter_mysql/cgrates.json +++ b/data/conf/samples/cdrewithfilter_mysql/cgrates.json @@ -94,7 +94,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "stats_conns": ["*localhost"], }, @@ -102,7 +102,7 @@ "sessions": { "enabled": true, - "suppliers_conns": ["*internal"], + "routes_conns": ["*internal"], "resources_conns": ["*internal"], "attributes_conns": ["*internal"], "rals_conns": ["*internal"], diff --git a/data/conf/samples/cluelrn/cgrates.json b/data/conf/samples/cluelrn/cgrates.json index 56baad356..88d55b5a9 100644 --- a/data/conf/samples/cluelrn/cgrates.json +++ b/data/conf/samples/cluelrn/cgrates.json @@ -49,7 +49,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "attributes_conns": ["*localhost"], }, diff --git a/data/conf/samples/dbinternal/cgrates.json b/data/conf/samples/dbinternal/cgrates.json index b943304b6..775b0faf7 100755 --- a/data/conf/samples/dbinternal/cgrates.json +++ b/data/conf/samples/dbinternal/cgrates.json @@ -60,7 +60,7 @@ }, -"suppliers": { +"routes": { "enabled": true, }, diff --git a/data/conf/samples/dispatchers/all/cgrates.json b/data/conf/samples/dispatchers/all/cgrates.json index 9169fb61b..50aed8677 100644 --- a/data/conf/samples/dispatchers/all/cgrates.json +++ b/data/conf/samples/dispatchers/all/cgrates.json @@ -58,7 +58,7 @@ "enabled": true, }, -"suppliers": { +"routes": { "enabled": true, "rals_conns": ["*internal"] }, @@ -80,7 +80,7 @@ "sessions": { "enabled": true, "listen_bijson": ":6014", - "suppliers_conns": ["*internal"], + "routes_conns": ["*internal"], "resources_conns": ["*internal"], "attributes_conns": ["*internal"], "rals_conns": ["*internal"], diff --git a/data/conf/samples/dispatchers/all2/cgrates.json b/data/conf/samples/dispatchers/all2/cgrates.json index 194ac5d22..6a2e871e2 100644 --- a/data/conf/samples/dispatchers/all2/cgrates.json +++ b/data/conf/samples/dispatchers/all2/cgrates.json @@ -53,7 +53,7 @@ "enabled": true, }, -"suppliers": { +"routes": { "enabled": true, "rals_conns": ["*internal"], }, @@ -75,7 +75,7 @@ "sessions": { "enabled": true, "listen_bijson": ":7014", - "suppliers_conns": ["*internal"], + "routes_conns": ["*internal"], "resources_conns": ["*internal"], "attributes_conns": ["*internal"], "rals_conns": ["*internal"], diff --git a/data/conf/samples/dispatchers/all2_mongo/cgrates.json b/data/conf/samples/dispatchers/all2_mongo/cgrates.json index 2bfb1af34..34ca0e53b 100644 --- a/data/conf/samples/dispatchers/all2_mongo/cgrates.json +++ b/data/conf/samples/dispatchers/all2_mongo/cgrates.json @@ -57,7 +57,7 @@ "enabled": true, }, -"suppliers": { +"routes": { "enabled": true, "rals_conns": ["*internal"], }, @@ -79,7 +79,7 @@ "sessions": { "enabled": true, "listen_bijson": ":7014", - "suppliers_conns": ["*internal"], + "routes_conns": ["*internal"], "resources_conns": ["*internal"], "attributes_conns": ["*internal"], "rals_conns": ["*internal"], diff --git a/data/conf/samples/dispatchers/all2_mysql/cgrates.json b/data/conf/samples/dispatchers/all2_mysql/cgrates.json index 106effc1f..00fc2281b 100644 --- a/data/conf/samples/dispatchers/all2_mysql/cgrates.json +++ b/data/conf/samples/dispatchers/all2_mysql/cgrates.json @@ -54,7 +54,7 @@ "enabled": true, }, -"suppliers": { +"routes": { "enabled": true, "rals_conns": ["*internal"], }, @@ -76,7 +76,7 @@ "sessions": { "enabled": true, "listen_bijson": ":7014", - "suppliers_conns": ["*internal"], + "routes_conns": ["*internal"], "resources_conns": ["*internal"], "attributes_conns": ["*internal"], "rals_conns": ["*internal"], diff --git a/data/conf/samples/dispatchers/all_mongo/cgrates.json b/data/conf/samples/dispatchers/all_mongo/cgrates.json index 1347eddd2..9cd1b498a 100644 --- a/data/conf/samples/dispatchers/all_mongo/cgrates.json +++ b/data/conf/samples/dispatchers/all_mongo/cgrates.json @@ -61,7 +61,7 @@ "enabled": true, }, -"suppliers": { +"routes": { "enabled": true, "rals_conns": ["*internal"] }, @@ -83,7 +83,7 @@ "sessions": { "enabled": true, "listen_bijson": ":6014", - "suppliers_conns": ["*internal"], + "routes_conns": ["*internal"], "resources_conns": ["*internal"], "attributes_conns": ["*internal"], "rals_conns": ["*internal"], diff --git a/data/conf/samples/dispatchers/all_mysql/cgrates.json b/data/conf/samples/dispatchers/all_mysql/cgrates.json index 436ca363a..5a81c9f37 100644 --- a/data/conf/samples/dispatchers/all_mysql/cgrates.json +++ b/data/conf/samples/dispatchers/all_mysql/cgrates.json @@ -59,7 +59,7 @@ "enabled": true, }, -"suppliers": { +"routes": { "enabled": true, "rals_conns": ["*internal"], }, @@ -81,7 +81,7 @@ "sessions": { "enabled": true, "listen_bijson": ":6014", - "suppliers_conns": ["*internal"], + "routes_conns": ["*internal"], "resources_conns": ["*internal"], "attributes_conns": ["*internal"], "rals_conns": ["*internal"], diff --git a/data/conf/samples/dnsagent_internal/cgrates.json b/data/conf/samples/dnsagent_internal/cgrates.json index 4857efd1a..51be029bd 100644 --- a/data/conf/samples/dnsagent_internal/cgrates.json +++ b/data/conf/samples/dnsagent_internal/cgrates.json @@ -33,7 +33,7 @@ "rals_conns": ["*internal"], "cdrs_conns": ["*internal"], "chargers_conns": ["*internal"], - "suppliers_conns": ["*localhost"], + "routes_conns": ["*localhost"], }, @@ -58,7 +58,7 @@ }, -"suppliers": { +"routes": { "enabled": true, }, diff --git a/data/conf/samples/dnsagent_mongo/cgrates.json b/data/conf/samples/dnsagent_mongo/cgrates.json index bfee9d2f1..61d923e0c 100644 --- a/data/conf/samples/dnsagent_mongo/cgrates.json +++ b/data/conf/samples/dnsagent_mongo/cgrates.json @@ -38,7 +38,7 @@ "rals_conns": ["*internal"], "cdrs_conns": ["*internal"], "chargers_conns": ["*internal"], - "suppliers_conns": ["*localhost"], + "routes_conns": ["*localhost"], }, @@ -63,7 +63,7 @@ }, -"suppliers": { +"routes": { "enabled": true, }, diff --git a/data/conf/samples/dnsagent_mysql/cgrates.json b/data/conf/samples/dnsagent_mysql/cgrates.json index 2dd1ad64d..a2f7a705c 100644 --- a/data/conf/samples/dnsagent_mysql/cgrates.json +++ b/data/conf/samples/dnsagent_mysql/cgrates.json @@ -29,7 +29,7 @@ "rals_conns": ["*internal"], "cdrs_conns": ["*internal"], "chargers_conns": ["*internal"], - "suppliers_conns": ["*localhost"], + "routes_conns": ["*localhost"], }, @@ -54,7 +54,7 @@ }, -"suppliers": { +"routes": { "enabled": true, }, diff --git a/data/conf/samples/dnsagent_reload/cgrates.json b/data/conf/samples/dnsagent_reload/cgrates.json index 8ec0e714d..f8c510495 100644 --- a/data/conf/samples/dnsagent_reload/cgrates.json +++ b/data/conf/samples/dnsagent_reload/cgrates.json @@ -29,7 +29,7 @@ "rals_conns": ["*internal"], "cdrs_conns": ["*internal"], "chargers_conns": ["*internal"], - "suppliers_conns": ["*localhost"], + "routes_conns": ["*localhost"], }, @@ -54,7 +54,7 @@ }, - "suppliers": { + "routes": { "enabled": true, }, diff --git a/data/conf/samples/docker/cgrates.json b/data/conf/samples/docker/cgrates.json index b2a8a7336..cab6a517b 100644 --- a/data/conf/samples/docker/cgrates.json +++ b/data/conf/samples/docker/cgrates.json @@ -89,7 +89,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "prefix_indexed_fields":["Destination"], "stats_conns": ["*internal"], @@ -101,7 +101,7 @@ "sessions": { "enabled": true, "listen_bijson": "*env:DOCKER_IP:2014", - "suppliers_conns": ["*internal"], + "routes_conns": ["*internal"], "resources_conns": ["*internal"], "attributes_conns": ["*internal"], "rals_conns": ["*internal"], diff --git a/data/conf/samples/gocs/au_site/cgrates.json b/data/conf/samples/gocs/au_site/cgrates.json index 5ad6d3042..943188256 100644 --- a/data/conf/samples/gocs/au_site/cgrates.json +++ b/data/conf/samples/gocs/au_site/cgrates.json @@ -44,7 +44,7 @@ "*shared_groups":{"remote":true}, "*timings": {"remote":true}, "*filters": {"remote":true}, - "*supplier_profiles":{"remote":true}, + "*route_profiles":{"remote":true}, "*attribute_profiles":{"remote":true}, "*charger_profiles": {"remote":true}, "*dispatcher_profiles":{"remote":true}, diff --git a/data/conf/samples/gocs/us_site/cgrates.json b/data/conf/samples/gocs/us_site/cgrates.json index 10b810343..9495d33e8 100644 --- a/data/conf/samples/gocs/us_site/cgrates.json +++ b/data/conf/samples/gocs/us_site/cgrates.json @@ -50,7 +50,7 @@ "*threshold_profiles": {"replicate":false}, "*thresholds": {"replicate":false}, "*filters": {"replicate":false}, - "*supplier_profiles":{"replicate":false}, + "*route_profiles":{"replicate":false}, "*attribute_profiles":{"replicate":false}, "*charger_profiles": {"replicate":false}, "*dispatcher_profiles":{"replicate":false}, diff --git a/data/conf/samples/internal_broadcast_replication/cgrates.json b/data/conf/samples/internal_broadcast_replication/cgrates.json index 7d205bedd..d781ae0f7 100644 --- a/data/conf/samples/internal_broadcast_replication/cgrates.json +++ b/data/conf/samples/internal_broadcast_replication/cgrates.json @@ -85,7 +85,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "prefix_indexed_fields":["Destination"], "stats_conns": ["broadcast_conn"], @@ -96,7 +96,7 @@ "sessions": { "enabled": true, "listen_bijson": "127.0.0.1:3014", // address where to listen for bidirectional JSON-RPC requests - "suppliers_conns": ["broadcast_conn"], + "routes_conns": ["broadcast_conn"], "resources_conns": ["broadcast_conn"], "attributes_conns": ["broadcast_conn"], "rals_conns": ["broadcast_conn"], diff --git a/data/conf/samples/loader_mongo/cgrates.json b/data/conf/samples/loader_mongo/cgrates.json index ceffc6809..a63bb7dda 100644 --- a/data/conf/samples/loader_mongo/cgrates.json +++ b/data/conf/samples/loader_mongo/cgrates.json @@ -93,7 +93,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "stats_conns": ["*localhost"], "resources_conns": ["*localhost"], diff --git a/data/conf/samples/loader_mysql/cgrates.json b/data/conf/samples/loader_mysql/cgrates.json index af7242be9..db6f37376 100644 --- a/data/conf/samples/loader_mysql/cgrates.json +++ b/data/conf/samples/loader_mysql/cgrates.json @@ -95,7 +95,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "prefix_indexed_fields":["Destination"], "stats_conns": ["*internal"], @@ -106,7 +106,7 @@ "sessions": { "enabled": true, - "suppliers_conns": ["*internal"], + "routes_conns": ["*internal"], "resources_conns": ["*internal"], "attributes_conns": ["*internal"], "rals_conns": ["*internal"], diff --git a/data/conf/samples/loaders/tutmongo/cgrates.json b/data/conf/samples/loaders/tutmongo/cgrates.json index 1e7209131..e15e906c4 100644 --- a/data/conf/samples/loaders/tutmongo/cgrates.json +++ b/data/conf/samples/loaders/tutmongo/cgrates.json @@ -92,7 +92,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "stats_conns": ["*localhost"], "resources_conns": ["*localhost"], diff --git a/data/conf/samples/loaders/tutmysql/cgrates.json b/data/conf/samples/loaders/tutmysql/cgrates.json index d149d24bd..c74ce0a3b 100644 --- a/data/conf/samples/loaders/tutmysql/cgrates.json +++ b/data/conf/samples/loaders/tutmysql/cgrates.json @@ -130,7 +130,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "prefix_indexed_fields":["Destination"], "stats_conns": ["*internal"], @@ -140,7 +140,7 @@ "sessions": { "enabled": true, - "suppliers_conns": ["*internal"], + "routes_conns": ["*internal"], "resources_conns": ["*internal"], "attributes_conns": ["*internal"], "rals_conns": ["*internal"], diff --git a/data/conf/samples/mongoatlas/cgrates.json b/data/conf/samples/mongoatlas/cgrates.json index bd5ddfd99..40a8f825e 100755 --- a/data/conf/samples/mongoatlas/cgrates.json +++ b/data/conf/samples/mongoatlas/cgrates.json @@ -53,12 +53,12 @@ "*thresholds": {"limit": 10000, "ttl":"0s", "precache": true}, "*threshold_profiles": {"limit": 10000, "ttl":"0s", "precache": true}, "*filters": {"limit": 10000, "ttl":"0s", "precache": true}, - "*supplier_profiles": {"limit": 10000, "ttl":"0s", "precache": true}, + "*route_profiles": {"limit": 10000, "ttl":"0s", "precache": true}, "*attribute_profiles": {"limit": 10000, "ttl":"0s", "precache": true}, "*resource_filter_indexes" :{"limit": 10000, "ttl":"0s"}, "*stat_filter_indexes" : {"limit": 10000, "ttl":"0s"}, "*threshold_filter_indexes" : {"limit": 10000, "ttl":"0s"}, - "*supplier_filter_indexes" : {"limit": 10000, "ttl":"0s"}, + "*route_filter_indexes" : {"limit": 10000, "ttl":"0s"}, "*attribute_filter_indexes" : {"limit": 10000, "ttl":"0s"}, "*charger_filter_indexes" : {"limit": 10000, "ttl":"0s"} }, @@ -121,7 +121,7 @@ }, -"suppliers": { +"routes": { "enabled": true, }, diff --git a/data/conf/samples/mongoreplica/cgrates.json b/data/conf/samples/mongoreplica/cgrates.json index 87bf8c3be..ce1bbd3dc 100755 --- a/data/conf/samples/mongoreplica/cgrates.json +++ b/data/conf/samples/mongoreplica/cgrates.json @@ -91,7 +91,7 @@ }, -"suppliers": { +"routes": { "enabled": true, }, diff --git a/data/conf/samples/precache/tutmongo/cgrates.json b/data/conf/samples/precache/tutmongo/cgrates.json index 9170676b1..5f922d092 100644 --- a/data/conf/samples/precache/tutmongo/cgrates.json +++ b/data/conf/samples/precache/tutmongo/cgrates.json @@ -47,12 +47,12 @@ "*thresholds": {"limit": 10000, "ttl":"0s", "precache": true}, "*threshold_profiles": {"limit": 10000, "ttl":"0s", "precache": true}, "*filters": {"limit": 10000, "ttl":"0s", "precache": true}, - "*supplier_profiles": {"limit": 10000, "ttl":"0s", "precache": true}, + "*route_profiles": {"limit": 10000, "ttl":"0s", "precache": true}, "*attribute_profiles": {"limit": 10000, "ttl":"0s", "precache": true}, "*resource_filter_indexes" :{"limit": 10000, "ttl":"0s", "precache": true}, "*stat_filter_indexes" : {"limit": 10000, "ttl":"0s", "precache": true}, "*threshold_filter_indexes" : {"limit": 10000, "ttl":"0s", "precache": true}, - "*supplier_filter_indexes" : {"limit": 10000, "ttl":"0s", "precache": true}, + "*route_filter_indexes" : {"limit": 10000, "ttl":"0s", "precache": true}, "*attribute_filter_indexes" : {"limit": 10000, "ttl":"0s", "precache": true}, "*charger_filter_indexes" : {"limit": 10000, "ttl":"0s", "precache": true}, "*dispatcher_profiles" : {"limit": 10000, "ttl":"0s", "precache": true}, diff --git a/data/conf/samples/precache/tutmysql/cgrates.json b/data/conf/samples/precache/tutmysql/cgrates.json index fdb712f22..4373ab031 100644 --- a/data/conf/samples/precache/tutmysql/cgrates.json +++ b/data/conf/samples/precache/tutmysql/cgrates.json @@ -43,12 +43,12 @@ "*thresholds": {"limit": 10000, "ttl":"0s", "precache": true}, "*threshold_profiles": {"limit": 10000, "ttl":"0s", "precache": true}, "*filters": {"limit": 10000, "ttl":"0s", "precache": true}, - "*supplier_profiles": {"limit": 10000, "ttl":"0s", "precache": true}, + "*route_profiles": {"limit": 10000, "ttl":"0s", "precache": true}, "*attribute_profiles": {"limit": 10000, "ttl":"0s", "precache": true}, "*resource_filter_indexes" :{"limit": 10000, "ttl":"0s", "precache": true}, "*stat_filter_indexes" : {"limit": 10000, "ttl":"0s", "precache": true}, "*threshold_filter_indexes" : {"limit": 10000, "ttl":"0s", "precache": true}, - "*supplier_filter_indexes" : {"limit": 10000, "ttl":"0s", "precache": true}, + "*route_filter_indexes" : {"limit": 10000, "ttl":"0s", "precache": true}, "*attribute_filter_indexes" : {"limit": 10000, "ttl":"0s", "precache": true}, "*charger_filter_indexes" : {"limit": 10000, "ttl":"0s", "precache": true}, "*dispatcher_profiles" : {"limit": 10000, "ttl":"0s", "precache": true}, diff --git a/data/conf/samples/radagent_internal/cgrates.json b/data/conf/samples/radagent_internal/cgrates.json index 51be18b56..583af9fd8 100644 --- a/data/conf/samples/radagent_internal/cgrates.json +++ b/data/conf/samples/radagent_internal/cgrates.json @@ -45,7 +45,7 @@ "enabled": true, }, -"suppliers": { +"routes": { "enabled": true, }, diff --git a/data/conf/samples/radagent_internal_gob/cgrates.json b/data/conf/samples/radagent_internal_gob/cgrates.json index 2b7c3963d..9c37f224c 100644 --- a/data/conf/samples/radagent_internal_gob/cgrates.json +++ b/data/conf/samples/radagent_internal_gob/cgrates.json @@ -53,7 +53,7 @@ "enabled": true, }, -"suppliers": { +"routes": { "enabled": true, }, diff --git a/data/conf/samples/radagent_mongo/cgrates.json b/data/conf/samples/radagent_mongo/cgrates.json index 089135eac..c6b968ff5 100644 --- a/data/conf/samples/radagent_mongo/cgrates.json +++ b/data/conf/samples/radagent_mongo/cgrates.json @@ -48,7 +48,7 @@ "enabled": true, }, -"suppliers": { +"routes": { "enabled": true, }, diff --git a/data/conf/samples/radagent_mongo_gob/cgrates.json b/data/conf/samples/radagent_mongo_gob/cgrates.json index 89f8b5a3d..87c878090 100644 --- a/data/conf/samples/radagent_mongo_gob/cgrates.json +++ b/data/conf/samples/radagent_mongo_gob/cgrates.json @@ -56,7 +56,7 @@ "enabled": true, }, -"suppliers": { +"routes": { "enabled": true, }, diff --git a/data/conf/samples/radagent_mysql/cgrates.json b/data/conf/samples/radagent_mysql/cgrates.json index 5a607c5c7..ebc611298 100644 --- a/data/conf/samples/radagent_mysql/cgrates.json +++ b/data/conf/samples/radagent_mysql/cgrates.json @@ -44,7 +44,7 @@ "enabled": true, }, -"suppliers": { +"routes": { "enabled": true, }, diff --git a/data/conf/samples/radagent_mysql_gob/cgrates.json b/data/conf/samples/radagent_mysql_gob/cgrates.json index 25ddf5ae0..2ad3043b5 100644 --- a/data/conf/samples/radagent_mysql_gob/cgrates.json +++ b/data/conf/samples/radagent_mysql_gob/cgrates.json @@ -51,7 +51,7 @@ "enabled": true, }, -"suppliers": { +"routes": { "enabled": true, }, diff --git a/data/conf/samples/remote_replication/internal/cgrates.json b/data/conf/samples/remote_replication/internal/cgrates.json index 46b7d7b50..368e4f740 100644 --- a/data/conf/samples/remote_replication/internal/cgrates.json +++ b/data/conf/samples/remote_replication/internal/cgrates.json @@ -58,7 +58,7 @@ "*threshold_profiles": {"remote":true,"replicate":true}, "*thresholds": {"remote":true,"replicate":true}, "*filters": {"remote":true,"replicate":true}, - "*supplier_profiles":{"remote":true,"replicate":true}, + "*route_profiles":{"remote":true,"replicate":true}, "*attribute_profiles":{"remote":true,"replicate":true}, "*charger_profiles": {"remote":true,"replicate":true}, "*dispatcher_profiles":{"remote":true,"replicate":true}, diff --git a/data/conf/samples/remote_replication/internal_gob/cgrates.json b/data/conf/samples/remote_replication/internal_gob/cgrates.json index fc6681e61..1a5a4596a 100644 --- a/data/conf/samples/remote_replication/internal_gob/cgrates.json +++ b/data/conf/samples/remote_replication/internal_gob/cgrates.json @@ -50,7 +50,7 @@ "*threshold_profiles": {"remote":true,"replicate":true}, "*thresholds": {"remote":true,"replicate":true}, "*filters": {"remote":true,"replicate":true}, - "*supplier_profiles":{"remote":true,"replicate":true}, + "*route_profiles":{"remote":true,"replicate":true}, "*attribute_profiles":{"remote":true,"replicate":true}, "*charger_profiles": {"remote":true,"replicate":true}, "*dispatcher_profiles":{"remote":true,"replicate":true}, diff --git a/data/conf/samples/replication/internal/cgrates.json b/data/conf/samples/replication/internal/cgrates.json index 6be5223bb..d0c57d0ae 100644 --- a/data/conf/samples/replication/internal/cgrates.json +++ b/data/conf/samples/replication/internal/cgrates.json @@ -58,7 +58,7 @@ "*threshold_profiles": {"remote":false,"replicate":true}, "*thresholds": {"remote":false,"replicate":true}, "*filters": {"remote":false,"replicate":true}, - "*supplier_profiles":{"remote":false,"replicate":true}, + "*route_profiles":{"remote":false,"replicate":true}, "*attribute_profiles":{"remote":false,"replicate":true}, "*charger_profiles": {"remote":false,"replicate":true}, "*dispatcher_profiles":{"remote":false,"replicate":true}, diff --git a/data/conf/samples/replication/internal_gob/cgrates.json b/data/conf/samples/replication/internal_gob/cgrates.json index fc6681e61..1a5a4596a 100644 --- a/data/conf/samples/replication/internal_gob/cgrates.json +++ b/data/conf/samples/replication/internal_gob/cgrates.json @@ -50,7 +50,7 @@ "*threshold_profiles": {"remote":true,"replicate":true}, "*thresholds": {"remote":true,"replicate":true}, "*filters": {"remote":true,"replicate":true}, - "*supplier_profiles":{"remote":true,"replicate":true}, + "*route_profiles":{"remote":true,"replicate":true}, "*attribute_profiles":{"remote":true,"replicate":true}, "*charger_profiles": {"remote":true,"replicate":true}, "*dispatcher_profiles":{"remote":true,"replicate":true}, diff --git a/data/conf/samples/sessinternal/cgrates.json b/data/conf/samples/sessinternal/cgrates.json index 01db944b7..596c088b3 100644 --- a/data/conf/samples/sessinternal/cgrates.json +++ b/data/conf/samples/sessinternal/cgrates.json @@ -67,7 +67,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "prefix_indexed_fields":["Destination"], "stats_conns": ["*internal"], @@ -77,7 +77,7 @@ "sessions": { "enabled": true, - "suppliers_conns": ["*internal"], + "routes_conns": ["*internal"], "resources_conns": ["*internal"], "attributes_conns": ["*internal"], "rals_conns": ["*internal"], diff --git a/data/conf/samples/sessintjson/cgrates.json b/data/conf/samples/sessintjson/cgrates.json index 62c75d99b..28815e9a2 100644 --- a/data/conf/samples/sessintjson/cgrates.json +++ b/data/conf/samples/sessintjson/cgrates.json @@ -67,7 +67,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "prefix_indexed_fields":["Destination"], "stats_conns": ["*localhost"], @@ -77,7 +77,7 @@ "sessions": { "enabled": true, - "suppliers_conns": ["*localhost"], + "routes_conns": ["*localhost"], "resources_conns": ["*localhost"], "attributes_conns": ["*localhost"], "rals_conns": ["*localhost"], diff --git a/data/conf/samples/sessions_internal/cgrates.json b/data/conf/samples/sessions_internal/cgrates.json index 8ade0d271..3aaa18af5 100644 --- a/data/conf/samples/sessions_internal/cgrates.json +++ b/data/conf/samples/sessions_internal/cgrates.json @@ -73,7 +73,7 @@ }, -"suppliers": { +"routes": { "enabled": true, }, @@ -87,7 +87,7 @@ "resources_conns": ["*internal"], "thresholds_conns": ["*internal"], "stats_conns": ["*internal"], - "suppliers_conns": ["*internal"], + "routes_conns": ["*internal"], "attributes_conns": ["*internal"], "alterable_fields": ["Extra1"] }, diff --git a/data/conf/samples/sessions_mongo/cgrates.json b/data/conf/samples/sessions_mongo/cgrates.json index 980598061..2b713070b 100644 --- a/data/conf/samples/sessions_mongo/cgrates.json +++ b/data/conf/samples/sessions_mongo/cgrates.json @@ -78,7 +78,7 @@ }, -"suppliers": { +"routes": { "enabled": true, }, @@ -92,7 +92,7 @@ "resources_conns": ["*internal"], "thresholds_conns": ["*internal"], "stats_conns": ["*internal"], - "suppliers_conns": ["*internal"], + "routes_conns": ["*internal"], "attributes_conns": ["*internal"], "alterable_fields": ["Extra1"], }, diff --git a/data/conf/samples/sessions_mysql/cgrates.json b/data/conf/samples/sessions_mysql/cgrates.json index bf8a7da6b..95864e4b5 100644 --- a/data/conf/samples/sessions_mysql/cgrates.json +++ b/data/conf/samples/sessions_mysql/cgrates.json @@ -74,7 +74,7 @@ }, -"suppliers": { +"routes": { "enabled": true, }, @@ -88,7 +88,7 @@ "resources_conns": ["*internal"], "thresholds_conns": ["*internal"], "stats_conns": ["*internal"], - "suppliers_conns": ["*internal"], + "routes_conns": ["*internal"], "attributes_conns": ["*internal"], "alterable_fields": ["Extra1"] }, diff --git a/data/conf/samples/tutinternal/cgrates.json b/data/conf/samples/tutinternal/cgrates.json index 94164daa5..8c331fa6c 100644 --- a/data/conf/samples/tutinternal/cgrates.json +++ b/data/conf/samples/tutinternal/cgrates.json @@ -75,7 +75,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "prefix_indexed_fields":["Destination"], "stats_conns": ["*internal"], @@ -86,7 +86,7 @@ "sessions": { "enabled": true, - "suppliers_conns": ["*internal"], + "routes_conns": ["*internal"], "resources_conns": ["*internal"], "attributes_conns": ["*internal"], "rals_conns": ["*internal"], diff --git a/data/conf/samples/tutinternal_gob/cgrates.json b/data/conf/samples/tutinternal_gob/cgrates.json index eb3901600..254acfce6 100644 --- a/data/conf/samples/tutinternal_gob/cgrates.json +++ b/data/conf/samples/tutinternal_gob/cgrates.json @@ -81,7 +81,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "prefix_indexed_fields":["Destination"], "stats_conns": ["conn1"], @@ -91,7 +91,7 @@ "sessions": { "enabled": true, - "suppliers_conns": ["conn1"], + "routes_conns": ["conn1"], "resources_conns": ["conn1"], "attributes_conns": ["conn1"], "rals_conns": ["conn1"], diff --git a/data/conf/samples/tutinternal_new/cgrates.json b/data/conf/samples/tutinternal_new/cgrates.json index 2b79ade4c..94d53f5c5 100644 --- a/data/conf/samples/tutinternal_new/cgrates.json +++ b/data/conf/samples/tutinternal_new/cgrates.json @@ -94,7 +94,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "prefix_indexed_fields":["Destination"], "stats_conns": ["*internal"], @@ -104,7 +104,7 @@ "sessions": { "enabled": true, - "suppliers_conns": ["*internal"], + "routes_conns": ["*internal"], "resources_conns": ["*internal"], "attributes_conns": ["*internal"], "rals_conns": ["*internal"], diff --git a/data/conf/samples/tutmongo/cgrates.json b/data/conf/samples/tutmongo/cgrates.json index aebc146da..e630ef53f 100644 --- a/data/conf/samples/tutmongo/cgrates.json +++ b/data/conf/samples/tutmongo/cgrates.json @@ -93,7 +93,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "stats_conns": ["*localhost"], "resources_conns": ["*localhost"], diff --git a/data/conf/samples/tutmongo2/cgrates.json b/data/conf/samples/tutmongo2/cgrates.json index aa51c46e0..4b637d38e 100644 --- a/data/conf/samples/tutmongo2/cgrates.json +++ b/data/conf/samples/tutmongo2/cgrates.json @@ -81,7 +81,7 @@ "sessions": { "enabled": true, "resources_conns": ["*localhost"], - "suppliers_conns": ["*localhost"], + "routes_conns": ["*localhost"], "attributes_conns": ["*localhost"], "rals_conns": ["*internal"], "cdrs_conns": ["*internal"], @@ -122,7 +122,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "string_indexed_fields": ["LCRProfile"], "prefix_indexed_fields":["Destination"], diff --git a/data/conf/samples/tutmongo2_gob/cgrates.json b/data/conf/samples/tutmongo2_gob/cgrates.json index 2be00a011..c6a48dfe4 100644 --- a/data/conf/samples/tutmongo2_gob/cgrates.json +++ b/data/conf/samples/tutmongo2_gob/cgrates.json @@ -88,7 +88,7 @@ "sessions": { "enabled": true, "resources_conns": ["conn1"], - "suppliers_conns": ["conn1"], + "routes_conns": ["conn1"], "attributes_conns": ["conn1"], "rals_conns": ["*internal"], "cdrs_conns": ["*internal"], @@ -129,7 +129,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "string_indexed_fields": ["LCRProfile"], "prefix_indexed_fields":["Destination"], diff --git a/data/conf/samples/tutmongo_gob/cgrates.json b/data/conf/samples/tutmongo_gob/cgrates.json index 0ba6c2ca5..a6f6b7d2b 100644 --- a/data/conf/samples/tutmongo_gob/cgrates.json +++ b/data/conf/samples/tutmongo_gob/cgrates.json @@ -100,7 +100,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "stats_conns": ["conn1"], "resources_conns": ["conn1"], diff --git a/data/conf/samples/tutmongonew/cgrates.json b/data/conf/samples/tutmongonew/cgrates.json index 8b9792559..73f26d351 100644 --- a/data/conf/samples/tutmongonew/cgrates.json +++ b/data/conf/samples/tutmongonew/cgrates.json @@ -92,7 +92,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "stats_conns": ["*internal"], }, diff --git a/data/conf/samples/tutmysql/cgrates.json b/data/conf/samples/tutmysql/cgrates.json index 0da9d7540..472b5c6a9 100644 --- a/data/conf/samples/tutmysql/cgrates.json +++ b/data/conf/samples/tutmysql/cgrates.json @@ -95,7 +95,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "prefix_indexed_fields":["Destination"], "stats_conns": ["*internal"], @@ -106,7 +106,7 @@ "sessions": { "enabled": true, - "suppliers_conns": ["*internal"], + "routes_conns": ["*internal"], "resources_conns": ["*internal"], "attributes_conns": ["*internal"], "rals_conns": ["*internal"], diff --git a/data/conf/samples/tutmysql2/cgrates.json b/data/conf/samples/tutmysql2/cgrates.json index ab72dec77..fd5bb53b0 100644 --- a/data/conf/samples/tutmysql2/cgrates.json +++ b/data/conf/samples/tutmysql2/cgrates.json @@ -46,7 +46,7 @@ "sessions": { "enabled": true, "resources_conns": ["*localhost"], - "suppliers_conns": ["*localhost"], + "routes_conns": ["*localhost"], "attributes_conns": ["*localhost"], "rals_conns": ["*internal"], "cdrs_conns": ["*internal"], @@ -87,7 +87,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "string_indexed_fields": ["LCRProfile"], "prefix_indexed_fields":["Destination"], diff --git a/data/conf/samples/tutmysql2_gob/cgrates.json b/data/conf/samples/tutmysql2_gob/cgrates.json index 603422392..2e6a76dd2 100644 --- a/data/conf/samples/tutmysql2_gob/cgrates.json +++ b/data/conf/samples/tutmysql2_gob/cgrates.json @@ -55,7 +55,7 @@ "sessions": { "enabled": true, "resources_conns": ["conn1"], - "suppliers_conns": ["conn1"], + "routes_conns": ["conn1"], "attributes_conns": ["conn1"], "rals_conns": ["*internal"], "cdrs_conns": ["*internal"], @@ -96,7 +96,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "string_indexed_fields": ["LCRProfile"], "prefix_indexed_fields":["Destination"], diff --git a/data/conf/samples/tutmysql_internal/cgrates.json b/data/conf/samples/tutmysql_internal/cgrates.json index 77c05e97a..7550e6440 100644 --- a/data/conf/samples/tutmysql_internal/cgrates.json +++ b/data/conf/samples/tutmysql_internal/cgrates.json @@ -210,7 +210,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "prefix_indexed_fields":["Destination"], "stats_conns": ["*internal"], @@ -219,7 +219,7 @@ "sessions": { "enabled": true, - "suppliers_conns": ["*internal"], + "routes_conns": ["*internal"], "resources_conns": ["*internal"], "attributes_conns": ["*internal"], "rals_conns": ["*internal"], diff --git a/data/conf/samples/tutpostgres/cgrates.json b/data/conf/samples/tutpostgres/cgrates.json index 1363a9c4b..eea667341 100644 --- a/data/conf/samples/tutpostgres/cgrates.json +++ b/data/conf/samples/tutpostgres/cgrates.json @@ -73,7 +73,7 @@ }, -"suppliers": { +"routes": { "enabled": true, }, diff --git a/data/tariffplans/cluelrn/Suppliers.csv b/data/tariffplans/cluelrn/Routes.csv similarity index 100% rename from data/tariffplans/cluelrn/Suppliers.csv rename to data/tariffplans/cluelrn/Routes.csv diff --git a/data/tariffplans/dnsagent/Suppliers.csv b/data/tariffplans/dnsagent/Routes.csv similarity index 100% rename from data/tariffplans/dnsagent/Suppliers.csv rename to data/tariffplans/dnsagent/Routes.csv diff --git a/data/tariffplans/oldtutorial/Suppliers.csv b/data/tariffplans/oldtutorial/Routes.csv similarity index 100% rename from data/tariffplans/oldtutorial/Suppliers.csv rename to data/tariffplans/oldtutorial/Routes.csv diff --git a/data/tariffplans/precache/Suppliers.csv b/data/tariffplans/precache/Routes.csv similarity index 100% rename from data/tariffplans/precache/Suppliers.csv rename to data/tariffplans/precache/Routes.csv diff --git a/data/tariffplans/testit/Suppliers.csv b/data/tariffplans/testit/Routes.csv similarity index 100% rename from data/tariffplans/testit/Suppliers.csv rename to data/tariffplans/testit/Routes.csv diff --git a/data/tariffplans/testtp/Suppliers.csv b/data/tariffplans/testtp/Routes.csv similarity index 100% rename from data/tariffplans/testtp/Suppliers.csv rename to data/tariffplans/testtp/Routes.csv diff --git a/data/tariffplans/tutorial/Suppliers.csv b/data/tariffplans/tutorial/Routes.csv similarity index 100% rename from data/tariffplans/tutorial/Suppliers.csv rename to data/tariffplans/tutorial/Routes.csv diff --git a/data/tutorial_tests/asterisk_ari/cgrates/etc/cgrates/cgrates.json b/data/tutorial_tests/asterisk_ari/cgrates/etc/cgrates/cgrates.json index 5f3f4f5d3..2eee498e2 100644 --- a/data/tutorial_tests/asterisk_ari/cgrates/etc/cgrates/cgrates.json +++ b/data/tutorial_tests/asterisk_ari/cgrates/etc/cgrates/cgrates.json @@ -54,7 +54,7 @@ "rals_conns": ["*localhost"], "cdrs_conns": ["*localhost"], "resources_conns": ["*localhost"], - "suppliers_conns": ["*localhost"], + "routes_conns": ["*localhost"], "attributes_conns": ["*localhost"], "stats_conns": ["*localhost"], "thresholds_conns": ["*localhost"], @@ -99,7 +99,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "resources_conns": ["*internal"], "stats_conns": ["*internal"], diff --git a/data/tutorial_tests/fs_evsock/cgrates/etc/cgrates/cgrates.json b/data/tutorial_tests/fs_evsock/cgrates/etc/cgrates/cgrates.json index d2f27d23b..d3b9a83ff 100644 --- a/data/tutorial_tests/fs_evsock/cgrates/etc/cgrates/cgrates.json +++ b/data/tutorial_tests/fs_evsock/cgrates/etc/cgrates/cgrates.json @@ -53,7 +53,7 @@ "rals_conns": ["*localhost"], "cdrs_conns": ["*localhost"], "resources_conns": ["*localhost"], - "suppliers_conns": ["*localhost"], + "routes_conns": ["*localhost"], "attributes_conns": ["*localhost"], "stats_conns": ["*localhost"], "thresholds_conns": ["*localhost"], @@ -97,7 +97,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "resources_conns": ["*internal"], "stats_conns": ["*internal"], diff --git a/data/tutorial_tests/kamevapi/cgrates/etc/cgrates/cgrates.json b/data/tutorial_tests/kamevapi/cgrates/etc/cgrates/cgrates.json index 240ec2647..e7042fa9c 100644 --- a/data/tutorial_tests/kamevapi/cgrates/etc/cgrates/cgrates.json +++ b/data/tutorial_tests/kamevapi/cgrates/etc/cgrates/cgrates.json @@ -53,7 +53,7 @@ "rals_conns": ["*localhost"], "cdrs_conns": ["*localhost"], "resources_conns": ["*localhost"], - "suppliers_conns": ["*localhost"], + "routes_conns": ["*localhost"], "attributes_conns": ["*localhost"], "stats_conns": ["*localhost"], "thresholds_conns": ["*localhost"], @@ -97,7 +97,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "resources_conns": ["*internal"], "stats_conns": ["*internal"], diff --git a/data/tutorial_tests/osips/cgrates/etc/cgrates/cgrates.json b/data/tutorial_tests/osips/cgrates/etc/cgrates/cgrates.json index af139cbbe..9bf1d50ad 100644 --- a/data/tutorial_tests/osips/cgrates/etc/cgrates/cgrates.json +++ b/data/tutorial_tests/osips/cgrates/etc/cgrates/cgrates.json @@ -52,7 +52,7 @@ "rals_conns": ["*internal"], "cdrs_conns": ["*internal"], "resources_conns": ["*internal"], - "suppliers_conns": ["*internal"], + "routes_conns": ["*internal"], "attributes_conns": ["*internal"], "stats_conns": ["*internal"], "thresholds_conns": ["*internal"], @@ -89,7 +89,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "resources_conns": ["*internal"], "stats_conns": ["*internal"], diff --git a/data/tutorials/asterisk_ari/cgrates/etc/cgrates/cgrates.json b/data/tutorials/asterisk_ari/cgrates/etc/cgrates/cgrates.json index 839838750..76e83173c 100644 --- a/data/tutorials/asterisk_ari/cgrates/etc/cgrates/cgrates.json +++ b/data/tutorials/asterisk_ari/cgrates/etc/cgrates/cgrates.json @@ -53,7 +53,7 @@ "rals_conns": ["*localhost"], "cdrs_conns": ["*localhost"], "resources_conns": ["*localhost"], - "suppliers_conns": ["*localhost"], + "routes_conns": ["*localhost"], "attributes_conns": ["*localhost"], "stats_conns": ["*localhost"], "thresholds_conns": ["*localhost"], @@ -98,7 +98,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "resources_conns": ["*internal"], "stats_conns": ["*internal"], diff --git a/data/tutorials/fs_evsock/cgrates/etc/cgrates/cgrates.json b/data/tutorials/fs_evsock/cgrates/etc/cgrates/cgrates.json index d2f27d23b..d3b9a83ff 100644 --- a/data/tutorials/fs_evsock/cgrates/etc/cgrates/cgrates.json +++ b/data/tutorials/fs_evsock/cgrates/etc/cgrates/cgrates.json @@ -53,7 +53,7 @@ "rals_conns": ["*localhost"], "cdrs_conns": ["*localhost"], "resources_conns": ["*localhost"], - "suppliers_conns": ["*localhost"], + "routes_conns": ["*localhost"], "attributes_conns": ["*localhost"], "stats_conns": ["*localhost"], "thresholds_conns": ["*localhost"], @@ -97,7 +97,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "resources_conns": ["*internal"], "stats_conns": ["*internal"], diff --git a/data/tutorials/kamevapi/cgrates/etc/cgrates/cgrates.json b/data/tutorials/kamevapi/cgrates/etc/cgrates/cgrates.json index b20ea1060..fc5a1ea35 100644 --- a/data/tutorials/kamevapi/cgrates/etc/cgrates/cgrates.json +++ b/data/tutorials/kamevapi/cgrates/etc/cgrates/cgrates.json @@ -53,7 +53,7 @@ "rals_conns": ["*localhost"], "cdrs_conns": ["*localhost"], "resources_conns": ["*localhost"], - "suppliers_conns": ["*localhost"], + "routes_conns": ["*localhost"], "attributes_conns": ["*localhost"], "stats_conns": ["*localhost"], "thresholds_conns": ["*localhost"], @@ -97,7 +97,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "resources_conns": ["*internal"], "stats_conns": ["*internal"], diff --git a/data/tutorials/osips/cgrates/etc/cgrates/cgrates.json b/data/tutorials/osips/cgrates/etc/cgrates/cgrates.json index df93c70e9..4c3b6e6b9 100644 --- a/data/tutorials/osips/cgrates/etc/cgrates/cgrates.json +++ b/data/tutorials/osips/cgrates/etc/cgrates/cgrates.json @@ -51,7 +51,7 @@ "rals_conns": ["*internal"], "cdrs_conns": ["*internal"], "resources_conns": ["*internal"], - "suppliers_conns": ["*internal"], + "routes_conns": ["*internal"], "attributes_conns": ["*internal"], "stats_conns": ["*internal"], "thresholds_conns": ["*internal"], @@ -88,7 +88,7 @@ }, -"suppliers": { +"routes": { "enabled": true, "resources_conns": ["*internal"], "stats_conns": ["*internal"], diff --git a/dispatchers/caches_it_test.go b/dispatchers/caches_it_test.go index 5ccb6020d..4bc36fb79 100644 --- a/dispatchers/caches_it_test.go +++ b/dispatchers/caches_it_test.go @@ -142,7 +142,7 @@ func testDspChcLoadAfterFolder(t *testing.T) { expStats[utils.CacheReverseDestinations].Items = 4 expStats[utils.CacheStatQueueProfiles].Items = 2 expStats[utils.CacheStatQueues].Items = 2 - expStats[utils.CacheSupplierProfiles].Items = 3 + expStats[utils.CacheRouteProfiles].Items = 3 expStats[utils.CacheThresholdProfiles].Items = 2 expStats[utils.CacheThresholds].Items = 2 expStats[utils.CacheLoadIDs].Items = 20 @@ -173,7 +173,7 @@ func testDspChcPrecacheStatus(t *testing.T) { utils.CacheThresholdProfiles: utils.MetaReady, utils.CacheThresholds: utils.MetaReady, utils.CacheFilters: utils.MetaReady, - utils.CacheSupplierProfiles: utils.MetaReady, + utils.CacheRouteProfiles: utils.MetaReady, utils.CacheAttributeProfiles: utils.MetaReady, utils.CacheChargerProfiles: utils.MetaReady, utils.CacheDispatcherProfiles: utils.MetaReady, @@ -183,7 +183,7 @@ func testDspChcPrecacheStatus(t *testing.T) { utils.CacheResourceFilterIndexes: utils.MetaReady, utils.CacheStatFilterIndexes: utils.MetaReady, utils.CacheThresholdFilterIndexes: utils.MetaReady, - utils.CacheSupplierFilterIndexes: utils.MetaReady, + utils.CacheRouteFilterIndexes: utils.MetaReady, utils.CacheChargerFilterIndexes: utils.MetaReady, utils.CacheDispatcherFilterIndexes: utils.MetaReady, utils.CacheLoadIDs: utils.MetaReady, diff --git a/engine/filterindexer_it_test.go b/engine/filterindexer_it_test.go index c74dadf26..3eca14a04 100644 --- a/engine/filterindexer_it_test.go +++ b/engine/filterindexer_it_test.go @@ -750,7 +750,7 @@ func testITTestIndexingWithEmptyFltrID(t *testing.T) { } func testITTestIndexingWithEmptyFltrID2(t *testing.T) { - splProfile := &SupplierProfile{ + splProfile := &RouteProfile{ Tenant: "cgrates.org", ID: "SPL_Weight", FilterIDs: []string{}, @@ -759,21 +759,21 @@ func testITTestIndexingWithEmptyFltrID2(t *testing.T) { }, Sorting: "*weight", SortingParameters: []string{}, - Suppliers: []*Supplier{ + Routes: []*Route{ { - ID: "supplier1", - FilterIDs: []string{""}, - AccountIDs: []string{""}, - RatingPlanIDs: []string{""}, - ResourceIDs: []string{""}, - StatIDs: []string{""}, - Weight: 10, - SupplierParameters: "", + ID: "supplier1", + FilterIDs: []string{""}, + AccountIDs: []string{""}, + RatingPlanIDs: []string{""}, + ResourceIDs: []string{""}, + StatIDs: []string{""}, + Weight: 10, + RouteParameters: "", }, }, Weight: 20, } - splProfile2 := &SupplierProfile{ + splProfile2 := &RouteProfile{ Tenant: "cgrates.org", ID: "SPL_Weight2", FilterIDs: []string{}, @@ -782,25 +782,25 @@ func testITTestIndexingWithEmptyFltrID2(t *testing.T) { }, Sorting: "*weight", SortingParameters: []string{}, - Suppliers: []*Supplier{ + Routes: []*Route{ { - ID: "supplier1", - FilterIDs: []string{""}, - AccountIDs: []string{""}, - RatingPlanIDs: []string{""}, - ResourceIDs: []string{""}, - StatIDs: []string{""}, - Weight: 10, - SupplierParameters: "", + ID: "supplier1", + FilterIDs: []string{""}, + AccountIDs: []string{""}, + RatingPlanIDs: []string{""}, + ResourceIDs: []string{""}, + StatIDs: []string{""}, + Weight: 10, + RouteParameters: "", }, }, Weight: 20, } - if err := dataManager.SetSupplierProfile(splProfile, true); err != nil { + if err := dataManager.SetRouteProfile(splProfile, true); err != nil { t.Error(err) } - if err := dataManager.SetSupplierProfile(splProfile2, true); err != nil { + if err := dataManager.SetRouteProfile(splProfile2, true); err != nil { t.Error(err) } eIdxes := map[string]utils.StringMap{ @@ -809,7 +809,7 @@ func testITTestIndexingWithEmptyFltrID2(t *testing.T) { "SPL_Weight2": true, }, } - rfi := NewFilterIndexer(onStor, utils.SupplierProfilePrefix, splProfile.Tenant) + rfi := NewFilterIndexer(onStor, utils.RouteProfilePrefix, splProfile.Tenant) if rcvIdx, err := dataManager.GetFilterIndexes( utils.PrefixToIndexCache[rfi.itemType], rfi.dbKeySuffix, utils.EmptyString, nil); err != nil { @@ -823,7 +823,7 @@ func testITTestIndexingWithEmptyFltrID2(t *testing.T) { "SPL_Weight": true, "SPL_Weight2": true, } - if rcvMp, err := dataManager.MatchFilterIndex(utils.CacheSupplierFilterIndexes, + if rcvMp, err := dataManager.MatchFilterIndex(utils.CacheRouteFilterIndexes, splProfile.Tenant, utils.META_NONE, utils.META_ANY, utils.META_ANY); err != nil { t.Error(err) } else if !reflect.DeepEqual(eMp, rcvMp) { diff --git a/engine/loader_it_test.go b/engine/loader_it_test.go index 05cc8518d..45746f234 100644 --- a/engine/loader_it_test.go +++ b/engine/loader_it_test.go @@ -176,8 +176,8 @@ func testLoaderITRemoveLoad(t *testing.T) { if err = loader.LoadThresholds(); err != nil { t.Error("Failed loading thresholds: ", err.Error()) } - if err = loader.LoadSupplierProfiles(); err != nil { - t.Error("Failed loading Supplier profiles: ", err.Error()) + if err = loader.LoadRouteProfiles(); err != nil { + t.Error("Failed loading Route profiles: ", err.Error()) } if err = loader.LoadAttributeProfiles(); err != nil { t.Error("Failed loading Attribute profiles: ", err.Error()) @@ -253,8 +253,8 @@ func testLoaderITLoadFromCSV(t *testing.T) { if err = loader.LoadThresholds(); err != nil { t.Error("Failed loading thresholds: ", err.Error()) } - if err = loader.LoadSupplierProfiles(); err != nil { - t.Error("Failed loading Supplier profiles: ", err.Error()) + if err = loader.LoadRouteProfiles(); err != nil { + t.Error("Failed loading Route profiles: ", err.Error()) } if err = loader.LoadAttributeProfiles(); err != nil { t.Error("Failed loading Attribute profiles: ", err.Error()) @@ -419,12 +419,12 @@ func testLoaderITWriteToDatabase(t *testing.T) { } } - for tenatid, th := range loader.sppProfiles { - rcv, err := loader.dm.GetSupplierProfile(tenatid.Tenant, tenatid.ID, false, false, utils.NonTransactional) + for tenatid, th := range loader.routeProfiles { + rcv, err := loader.dm.GetRouteProfile(tenatid.Tenant, tenatid.ID, false, false, utils.NonTransactional) if err != nil { - t.Errorf("Failed GetSupplierProfile, tenant: %s, id: %s, error: %s ", th.Tenant, th.ID, err.Error()) + t.Errorf("Failed GetRouteProfile, tenant: %s, id: %s, error: %s ", th.Tenant, th.ID, err.Error()) } - sts, err := APItoSupplierProfile(th, "UTC") + sts, err := APItoRouteProfile(th, "UTC") if err != nil { t.Error(err) } diff --git a/engine/onstor_it_test.go b/engine/onstor_it_test.go index 3835bf38f..03933bef7 100644 --- a/engine/onstor_it_test.go +++ b/engine/onstor_it_test.go @@ -69,7 +69,7 @@ var ( testOnStorITThresholdProfile, testOnStorITThreshold, testOnStorITFilter, - testOnStorITSupplierProfile, + testOnStorITRouteProfile, testOnStorITAttributeProfile, testOnStorITFlush, testOnStorITIsDBEmpty, @@ -1749,8 +1749,8 @@ func testOnStorITFilter(t *testing.T) { } } -func testOnStorITSupplierProfile(t *testing.T) { - splProfile := &SupplierProfile{ +func testOnStorITRouteProfile(t *testing.T) { + splProfile := &RouteProfile{ Tenant: "cgrates.org", ID: "SPRF_1", FilterIDs: []string{"FLTR_ACNT_dan", "FLTR_DST_DE"}, @@ -1759,99 +1759,99 @@ func testOnStorITSupplierProfile(t *testing.T) { }, Sorting: "*lowest_cost", SortingParameters: []string{}, - Suppliers: []*Supplier{ + Routes: []*Route{ { - ID: "supplier1", - FilterIDs: []string{"FLTR_DST_DE"}, - AccountIDs: []string{"Account1"}, - RatingPlanIDs: []string{"RPL_1"}, - ResourceIDs: []string{"ResGR1"}, - StatIDs: []string{"Stat1"}, - Weight: 10, - SupplierParameters: "param1", + ID: "supplier1", + FilterIDs: []string{"FLTR_DST_DE"}, + AccountIDs: []string{"Account1"}, + RatingPlanIDs: []string{"RPL_1"}, + ResourceIDs: []string{"ResGR1"}, + StatIDs: []string{"Stat1"}, + Weight: 10, + RouteParameters: "param1", }, }, Weight: 20, } - if _, rcvErr := onStor.GetSupplierProfile("cgrates.org", "SPRF_1", + if _, rcvErr := onStor.GetRouteProfile("cgrates.org", "SPRF_1", true, false, utils.NonTransactional); rcvErr != nil && rcvErr != utils.ErrNotFound { t.Error(rcvErr) } - if err := onStor.SetSupplierProfile(splProfile, false); err != nil { + if err := onStor.SetRouteProfile(splProfile, false); err != nil { t.Error(err) } //get from cache - if rcv, err := onStor.GetSupplierProfile("cgrates.org", "SPRF_1", + if rcv, err := onStor.GetRouteProfile("cgrates.org", "SPRF_1", true, false, utils.NonTransactional); err != nil { t.Error(err) } else if !(reflect.DeepEqual(splProfile, rcv)) { t.Errorf("Expecting: %v, received: %v", splProfile, rcv) } //get from database - if rcv, err := onStor.GetSupplierProfile("cgrates.org", "SPRF_1", + if rcv, err := onStor.GetRouteProfile("cgrates.org", "SPRF_1", false, false, utils.NonTransactional); err != nil { t.Error(err) } else if !(reflect.DeepEqual(splProfile, rcv)) { t.Errorf("Expecting: %v, received: %v", splProfile, rcv) } - expectedT := []string{"spp_cgrates.org:SPRF_1"} - if itm, err := onStor.DataDB().GetKeysForPrefix(utils.SupplierProfilePrefix); err != nil { + expectedT := []string{"rpp_cgrates.org:SPRF_1"} + if itm, err := onStor.DataDB().GetKeysForPrefix(utils.RouteProfilePrefix); err != nil { t.Error(err) } else if !reflect.DeepEqual(expectedT, itm) { t.Errorf("Expected : %+v, but received %+v", expectedT, itm) } //update - splProfile.Suppliers = []*Supplier{ + splProfile.Routes = []*Route{ { - ID: "supplier1", - FilterIDs: []string{"FLTR_DST_DE"}, - AccountIDs: []string{"Account1"}, - RatingPlanIDs: []string{"RPL_1"}, - ResourceIDs: []string{"ResGR1"}, - StatIDs: []string{"Stat1"}, - Weight: 10, - SupplierParameters: "param1", + ID: "supplier1", + FilterIDs: []string{"FLTR_DST_DE"}, + AccountIDs: []string{"Account1"}, + RatingPlanIDs: []string{"RPL_1"}, + ResourceIDs: []string{"ResGR1"}, + StatIDs: []string{"Stat1"}, + Weight: 10, + RouteParameters: "param1", }, { - ID: "supplier2", - FilterIDs: []string{"FLTR_DST_DE"}, - AccountIDs: []string{"Account2"}, - RatingPlanIDs: []string{"RPL_2"}, - ResourceIDs: []string{"ResGR2"}, - StatIDs: []string{"Stat2"}, - Weight: 20, - SupplierParameters: "param2", + ID: "supplier2", + FilterIDs: []string{"FLTR_DST_DE"}, + AccountIDs: []string{"Account2"}, + RatingPlanIDs: []string{"RPL_2"}, + ResourceIDs: []string{"ResGR2"}, + StatIDs: []string{"Stat2"}, + Weight: 20, + RouteParameters: "param2", }, } - if err := onStor.SetSupplierProfile(splProfile, false); err != nil { + if err := onStor.SetRouteProfile(splProfile, false); err != nil { t.Error(err) } time.Sleep(sleepDelay) //get from cache - if rcv, err := onStor.GetSupplierProfile("cgrates.org", "SPRF_1", + if rcv, err := onStor.GetRouteProfile("cgrates.org", "SPRF_1", true, false, utils.NonTransactional); err != nil { t.Error(err) } else if !(reflect.DeepEqual(splProfile, rcv)) { t.Errorf("Expecting: %v, received: %v", splProfile, rcv) } //get from database - if rcv, err := onStor.GetSupplierProfile("cgrates.org", "SPRF_1", + if rcv, err := onStor.GetRouteProfile("cgrates.org", "SPRF_1", false, false, utils.NonTransactional); err != nil { t.Error(err) } else if !(reflect.DeepEqual(splProfile, rcv)) { t.Errorf("Expecting: %v, received: %v", splProfile, rcv) } - if err := onStor.RemoveSupplierProfile(splProfile.Tenant, splProfile.ID, + if err := onStor.RemoveRouteProfile(splProfile.Tenant, splProfile.ID, utils.NonTransactional, false); err != nil { t.Error(err) } //check cache if removed - if _, rcvErr := onStor.GetSupplierProfile("cgrates.org", "SPRF_1", + if _, rcvErr := onStor.GetRouteProfile("cgrates.org", "SPRF_1", true, false, utils.NonTransactional); rcvErr != nil && rcvErr != utils.ErrNotFound { t.Error(rcvErr) } //check database if removed - if _, rcvErr := onStor.GetSupplierProfile("cgrates.org", "SPRF_1", + if _, rcvErr := onStor.GetRouteProfile("cgrates.org", "SPRF_1", false, false, utils.NonTransactional); rcvErr != nil && rcvErr != utils.ErrNotFound { t.Error(rcvErr) } diff --git a/general_tests/tut_smgeneric_it_test.go b/general_tests/tut_smgeneric_it_test.go index 5ec6ac79e..391a93ab2 100644 --- a/general_tests/tut_smgeneric_it_test.go +++ b/general_tests/tut_smgeneric_it_test.go @@ -151,7 +151,7 @@ func testTutSMGCacheStats(t *testing.T) { expectedStats[utils.CacheThresholds].Items = 7 expectedStats[utils.CacheThresholdProfiles].Items = 7 expectedStats[utils.CacheFilters].Items = 15 - expectedStats[utils.CacheSupplierProfiles].Items = 3 + expectedStats[utils.CacheRouteProfiles].Items = 3 expectedStats[utils.CacheAttributeProfiles].Items = 2 expectedStats[utils.MetaDefault].Items = 1 expectedStats[utils.CacheActionTriggers].Items = 1 diff --git a/services/routes_it_test.go b/services/routes_it_test.go index 6a8c64b79..f1c752d5d 100644 --- a/services/routes_it_test.go +++ b/services/routes_it_test.go @@ -44,8 +44,8 @@ func TestSupplierSReload(t *testing.T) { filterSChan <- nil engineShutdown := make(chan bool, 1) chS := engine.NewCacheS(cfg, nil) - close(chS.GetPrecacheChannel(utils.CacheSupplierProfiles)) - close(chS.GetPrecacheChannel(utils.CacheSupplierFilterIndexes)) + close(chS.GetPrecacheChannel(utils.CacheRouteProfiles)) + close(chS.GetPrecacheChannel(utils.CacheRouteFilterIndexes)) close(chS.GetPrecacheChannel(utils.CacheStatQueueProfiles)) close(chS.GetPrecacheChannel(utils.CacheStatQueues)) close(chS.GetPrecacheChannel(utils.CacheStatFilterIndexes))