From b9a97ba9d24e23d226d6f6852a31566a007aa37b Mon Sep 17 00:00:00 2001 From: Trial97 Date: Tue, 21 Dec 2021 17:08:46 +0200 Subject: [PATCH] Updated disptacher tests --- apis/attributes_it_test.go | 11 - config/configsanity.go | 4 +- config/configsanity_test.go | 2 +- config/dispatcherscfg.go | 4 +- config/dispatcherscfg_test.go | 6 +- config/libconfig_json.go | 13 +- console/datadb_versions.go | 5 +- console/import_tp_from_folder.go | 4 +- console/load_history.go | 4 +- console/load_ids.go | 6 +- console/load_tp_from_folder.go | 4 +- console/stordb_versions.go | 5 +- .../generate_config/generate_config.sh | 3 - dispatchers/attributes_it_test.go | 97 ++++----- dispatchers/caches_it_test.go | 26 +-- dispatchers/cdrs_it_test.go | 42 ++-- dispatchers/config_it_test.go | 3 +- dispatchers/dispatchers.go | 5 +- dispatchers/dispatchers_test.go | 10 +- dispatchers/guardian_it_test.go | 5 +- dispatchers/lib_test.go | 24 ++- ees/rpc_test.go | 2 +- engine/connmanager.go | 3 + engine/filterhelpers.go | 6 +- general_tests/export_it_test.go | 2 + utils/consts.go | 199 +++++++++--------- 26 files changed, 232 insertions(+), 263 deletions(-) delete mode 100755 data/scripts/generate_config/generate_config.sh diff --git a/apis/attributes_it_test.go b/apis/attributes_it_test.go index 4117ba84e..913a39534 100644 --- a/apis/attributes_it_test.go +++ b/apis/attributes_it_test.go @@ -26,7 +26,6 @@ import ( "reflect" "sort" "testing" - "time" "github.com/cgrates/birpc" "github.com/cgrates/birpc/context" @@ -144,16 +143,6 @@ func testGetAttributeProfileBeforeSet(t *testing.T) { } } -func testAttributeSLoadFromFolder(t *testing.T) { - var reply string - attrs := &utils.AttrLoadTpFromFolder{FolderPath: path.Join(*dataDir, "tariffplans", "oldtutorial")} - if err := attrSRPC.Call(context.Background(), - utils.APIerSv1LoadTariffPlanFromFolder, attrs, &reply); err != nil { - t.Error(err) - } - time.Sleep(100 * time.Millisecond) -} - func testAttributeSetAttributeProfile(t *testing.T) { attrPrf := &engine.APIAttributeProfileWithAPIOpts{ APIAttributeProfile: &engine.APIAttributeProfile{ diff --git a/config/configsanity.go b/config/configsanity.go index c39d90895..3e86ff4e2 100644 --- a/config/configsanity.go +++ b/config/configsanity.go @@ -900,10 +900,10 @@ func (cfg *CGRConfig) checkConfigSanity() error { // Dispatcher sanity check if cfg.dispatcherSCfg.Enabled { for _, connID := range cfg.dispatcherSCfg.AttributeSConns { - if strings.HasPrefix(connID, utils.MetaInternal) && !cfg.attributeSCfg.Enabled { + if strings.HasPrefix(connID, utils.MetaDispatchers) && !cfg.attributeSCfg.Enabled { return fmt.Errorf("<%s> not enabled but requested by <%s> component", utils.AttributeS, utils.DispatcherS) } - if _, has := cfg.rpcConns[connID]; !has && !strings.HasPrefix(connID, utils.MetaInternal) { + if _, has := cfg.rpcConns[connID]; !has && !strings.HasPrefix(connID, utils.MetaDispatchers) { return fmt.Errorf("<%s> connection with id: <%s> not defined", utils.DispatcherS, connID) } } diff --git a/config/configsanity_test.go b/config/configsanity_test.go index 56cb71ea9..208106a0b 100644 --- a/config/configsanity_test.go +++ b/config/configsanity_test.go @@ -1719,7 +1719,7 @@ func TestConfigSanityDispatcher(t *testing.T) { cfg = NewDefaultCGRConfig() cfg.dispatcherSCfg = &DispatcherSCfg{ Enabled: true, - AttributeSConns: []string{utils.MetaInternal}, + AttributeSConns: []string{utils.MetaDispatchers}, } if err := cfg.checkConfigSanity(); err == nil || err.Error() != " not enabled but requested by component" { t.Error(err) diff --git a/config/dispatcherscfg.go b/config/dispatcherscfg.go index 41586178a..8f61ce480 100644 --- a/config/dispatcherscfg.go +++ b/config/dispatcherscfg.go @@ -71,7 +71,7 @@ func (dps *DispatcherSCfg) loadFromJSONCfg(jsnCfg *DispatcherSJsonCfg) (err erro dps.NotExistsIndexedFields = utils.SliceStringPointer(utils.CloneStringSlice(*jsnCfg.Notexists_indexed_fields)) } if jsnCfg.Attributes_conns != nil { - dps.AttributeSConns = updateInternalConns(*jsnCfg.Attributes_conns, utils.MetaAttributes) + dps.AttributeSConns = updateInternalConnsWithPrfx(*jsnCfg.Attributes_conns, utils.MetaAttributes, utils.MetaDispatchers) } if jsnCfg.Nested_fields != nil { dps.NestedFields = *jsnCfg.Nested_fields @@ -96,7 +96,7 @@ func (dps DispatcherSCfg) AsMapInterface(string) interface{} { mp[utils.SuffixIndexedFieldsCfg] = utils.CloneStringSlice(*dps.SuffixIndexedFields) } if dps.AttributeSConns != nil { - mp[utils.AttributeSConnsCfg] = getInternalJSONConns(dps.AttributeSConns) + mp[utils.AttributeSConnsCfg] = getInternalJSONConnsWithPrfx(dps.AttributeSConns, utils.MetaDispatchers) } if dps.ExistsIndexedFields != nil { mp[utils.ExistsIndexedFieldsCfg] = utils.CloneStringSlice(*dps.ExistsIndexedFields) diff --git a/config/dispatcherscfg_test.go b/config/dispatcherscfg_test.go index 3a86af663..270b7558e 100644 --- a/config/dispatcherscfg_test.go +++ b/config/dispatcherscfg_test.go @@ -45,7 +45,7 @@ func TestDispatcherSCfgloadFromJsonCfg(t *testing.T) { SuffixIndexedFields: &[]string{"*req.prefix", "*req.indexed", "*req.fields"}, ExistsIndexedFields: &[]string{"*req.prefix", "*req.indexed", "*req.fields"}, NotExistsIndexedFields: &[]string{"*req.prefix", "*req.indexed", "*req.fields"}, - AttributeSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaAttributes), "*conn1"}, + AttributeSConns: []string{utils.ConcatenatedKey(utils.MetaDispatchers, utils.MetaAttributes), "*conn1"}, NestedFields: true, } jsnCfg := NewDefaultCGRConfig() @@ -102,7 +102,7 @@ func TestDispatcherSCfgAsMapInterface1(t *testing.T) { "exists_indexed_fields": ["*req.prefix","*req.indexed","*req.fields"], "notexists_indexed_fields": ["*req.prefix"], "nested_fields": false, - "attributes_conns": ["*internal:*attributes", "*conn1"], + "attributes_conns": ["*internal", "*conn1"], }, }` @@ -153,7 +153,7 @@ func TestDispatcherSCfgClone(t *testing.T) { SuffixIndexedFields: &[]string{"*req.prefix", "*req.indexed", "*req.fields"}, ExistsIndexedFields: &[]string{"*req.prefix", "*req.indexed", "*req.fields"}, NotExistsIndexedFields: &[]string{"*req.prefix", "*req.indexed", "*req.fields"}, - AttributeSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaAttributes), "*conn1"}, + AttributeSConns: []string{utils.ConcatenatedKey(utils.MetaDispatchers, utils.MetaAttributes), "*conn1"}, NestedFields: true, } rcv := ban.Clone() diff --git a/config/libconfig_json.go b/config/libconfig_json.go index b70959885..43abbb3c8 100644 --- a/config/libconfig_json.go +++ b/config/libconfig_json.go @@ -27,7 +27,12 @@ import ( // updateInternalConns updates the connection list by specifying the subsystem for internal connections func updateInternalConns(conns []string, subsystem string) (c []string) { - subsystem = utils.MetaInternal + utils.ConcatenatedKeySep + subsystem + return updateInternalConnsWithPrfx(conns, subsystem, utils.MetaInternal) +} + +// updateInternalConns updates the connection list by specifying the subsystem for internal connections +func updateInternalConnsWithPrfx(conns []string, subsystem, prfx string) (c []string) { + subsystem = prfx + utils.ConcatenatedKeySep + subsystem c = make([]string, len(conns)) for i, conn := range conns { c[i] = conn @@ -55,10 +60,14 @@ func updateBiRPCInternalConns(conns []string, subsystem string) (c []string) { } func getInternalJSONConns(conns []string) (c []string) { + return getInternalJSONConnsWithPrfx(conns, utils.MetaInternal) +} + +func getInternalJSONConnsWithPrfx(conns []string, prfx string) (c []string) { c = make([]string, len(conns)) for i, conn := range conns { c[i] = conn - if strings.HasPrefix(conn, utils.MetaInternal) { + if strings.HasPrefix(conn, prfx) { c[i] = utils.MetaInternal } } diff --git a/console/datadb_versions.go b/console/datadb_versions.go index acea92b68..efcb68daf 100644 --- a/console/datadb_versions.go +++ b/console/datadb_versions.go @@ -20,13 +20,12 @@ package console import ( "github.com/cgrates/cgrates/engine" - "github.com/cgrates/cgrates/utils" ) func init() { c := &CmdGetDataDBVersions{ - name: "datadb_versions", - rpcMethod: utils.APIerSv1GetDataDBVersions, + name: "datadb_versions", + // rpcMethod: utils.APIerSv1GetDataDBVersions, } commands[c.Name()] = c c.CommandExecuter = &CommandExecuter{c} diff --git a/console/import_tp_from_folder.go b/console/import_tp_from_folder.go index 41866f85c..f20b621a4 100644 --- a/console/import_tp_from_folder.go +++ b/console/import_tp_from_folder.go @@ -22,8 +22,8 @@ import "github.com/cgrates/cgrates/utils" func init() { c := &ImportTpFromFolder{ - name: "import_tp_from_folder", - rpcMethod: utils.APIerSv1ImportTariffPlanFromFolder, + name: "import_tp_from_folder", + // rpcMethod: utils.APIerSv1ImportTariffPlanFromFolder, } commands[c.Name()] = c c.CommandExecuter = &CommandExecuter{c} diff --git a/console/load_history.go b/console/load_history.go index 6d9dd0e09..45309c8f4 100644 --- a/console/load_history.go +++ b/console/load_history.go @@ -22,8 +22,8 @@ import "github.com/cgrates/cgrates/utils" func init() { c := &CmdGetLoadHistory{ - name: "load_history", - rpcMethod: utils.APIerSv1GetLoadHistory, + name: "load_history", + // rpcMethod: utils.APIerSv1GetLoadHistory, rpcParams: new(utils.Paginator), } commands[c.Name()] = c diff --git a/console/load_ids.go b/console/load_ids.go index c1c89a554..ca535c6d6 100644 --- a/console/load_ids.go +++ b/console/load_ids.go @@ -18,12 +18,10 @@ along with this program. If not, see package console -import "github.com/cgrates/cgrates/utils" - func init() { c := &CmdCacheVersions{ - name: "get_load_ids", - rpcMethod: utils.APIerSv1GetLoadIDs, + name: "get_load_ids", + // rpcMethod: utils.APIerSv1GetLoadIDs, } commands[c.Name()] = c c.CommandExecuter = &CommandExecuter{c} diff --git a/console/load_tp_from_folder.go b/console/load_tp_from_folder.go index 05ac9528f..9096db4b9 100644 --- a/console/load_tp_from_folder.go +++ b/console/load_tp_from_folder.go @@ -22,8 +22,8 @@ import "github.com/cgrates/cgrates/utils" func init() { c := &LoadTpFromFolder{ - name: "load_tp_from_folder", - rpcMethod: utils.APIerSv1LoadTariffPlanFromFolder, + name: "load_tp_from_folder", + // rpcMethod: utils.APIerSv1LoadTariffPlanFromFolder, } commands[c.Name()] = c c.CommandExecuter = &CommandExecuter{c} diff --git a/console/stordb_versions.go b/console/stordb_versions.go index 823677762..1c14429d1 100644 --- a/console/stordb_versions.go +++ b/console/stordb_versions.go @@ -20,13 +20,12 @@ package console import ( "github.com/cgrates/cgrates/engine" - "github.com/cgrates/cgrates/utils" ) func init() { c := &CmdGetStorDBVersions{ - name: "stordb_versions", - rpcMethod: utils.APIerSv1GetStorDBVersions, + name: "stordb_versions", + // rpcMethod: utils.APIerSv1GetStorDBVersions, } commands[c.Name()] = c c.CommandExecuter = &CommandExecuter{c} diff --git a/data/scripts/generate_config/generate_config.sh b/data/scripts/generate_config/generate_config.sh deleted file mode 100755 index ac96e3260..000000000 --- a/data/scripts/generate_config/generate_config.sh +++ /dev/null @@ -1,3 +0,0 @@ -#! /usr/bin/env sh - -go run generate.go $@ diff --git a/dispatchers/attributes_it_test.go b/dispatchers/attributes_it_test.go index e60f66e49..f36c0da16 100644 --- a/dispatchers/attributes_it_test.go +++ b/dispatchers/attributes_it_test.go @@ -23,9 +23,9 @@ package dispatchers import ( "reflect" + "sort" "testing" - "github.com/cgrates/cgrates/config" "github.com/cgrates/cgrates/engine" "github.com/cgrates/cgrates/utils" ) @@ -223,21 +223,18 @@ func testDspAttrGetAttrFailover(t *testing.T) { utils.OptsContext: "simpleauth", }, } - eAttrPrf := &engine.AttributeProfile{ + eAttrPrf := &engine.APIAttributeProfile{ Tenant: ev.Tenant, ID: "ATTR_1002_SIMPLEAUTH", FilterIDs: []string{"*string:~*req.Account:1002", "*string:~*opts.*context:simpleauth"}, - Attributes: []*engine.Attribute{ - { - FilterIDs: []string{}, - Path: utils.MetaReq + utils.NestingSep + "Password", - Type: utils.MetaConstant, - Value: config.NewRSRParsersMustCompile("CGRateS.org", utils.InfieldSep), - }, - }, + Attributes: []*engine.ExternalAttribute{{ + FilterIDs: []string{}, + Path: utils.MetaReq + utils.NestingSep + "Password", + Type: utils.MetaConstant, + Value: "CGRateS.org", + }}, Weight: 20.0, } - eAttrPrf.Compile() if *encoding == utils.MetaGOB { eAttrPrf.Attributes[0].FilterIDs = nil // empty slice are nil in gob } @@ -254,12 +251,13 @@ func testDspAttrGetAttrFailover(t *testing.T) { "Password": "CGRateS.org", }, APIOpts: map[string]interface{}{ - utils.OptsAPIKey: "attr12345", + utils.OptsAPIKey: "attr12345", + utils.OptsContext: "simpleauth", }, }, } - var attrReply *engine.AttributeProfile + var attrReply *engine.APIAttributeProfile var rplyEv engine.AttrSProcessEventReply if err := dispEngine.RPC.Call(utils.AttributeSv1GetAttributeForEvent, ev, &attrReply); err == nil || err.Error() != utils.ErrNotFound.Error() { @@ -280,9 +278,8 @@ func testDspAttrGetAttrFailover(t *testing.T) { ev, &attrReply); err != nil { t.Error(err) } - if attrReply != nil { - attrReply.Compile() - } + sort.Strings(eAttrPrf.FilterIDs) + sort.Strings(attrReply.FilterIDs) if !reflect.DeepEqual(eAttrPrf, attrReply) { t.Errorf("Expecting: %s, received: %s", utils.ToJSON(eAttrPrf), utils.ToJSON(attrReply)) } @@ -331,7 +328,7 @@ func testDspAttrTestMissingArgDispatcher(t *testing.T) { utils.OptsContext: "simpleauth", }, } - var attrReply *engine.AttributeProfile + var attrReply *engine.APIAttributeProfile if err := dispEngine.RPC.Call(utils.AttributeSv1GetAttributeForEvent, ev, &attrReply); err == nil || err.Error() != utils.NewErrMandatoryIeMissing(utils.APIKey).Error() { t.Errorf("Error:%v rply=%s", err, utils.ToJSON(attrReply)) @@ -349,7 +346,7 @@ func testDspAttrTestMissingApiKey(t *testing.T) { utils.OptsContext: "simpleauth", }, } - var attrReply *engine.AttributeProfile + var attrReply *engine.APIAttributeProfile if err := dispEngine.RPC.Call(utils.AttributeSv1GetAttributeForEvent, ev, &attrReply); err == nil || err.Error() != utils.NewErrMandatoryIeMissing(utils.APIKey).Error() { t.Errorf("Error:%v rply=%s", err, utils.ToJSON(attrReply)) @@ -367,7 +364,7 @@ func testDspAttrTestUnknownApiKey(t *testing.T) { utils.OptsAPIKey: "1234", }, } - var attrReply *engine.AttributeProfile + var attrReply *engine.APIAttributeProfile if err := dispEngine.RPC.Call(utils.AttributeSv1GetAttributeForEvent, ev, &attrReply); err == nil || err.Error() != utils.ErrUnknownApiKey.Error() { t.Error(err) @@ -386,7 +383,7 @@ func testDspAttrTestAuthKey(t *testing.T) { utils.OptsContext: "simpleauth", }, } - var attrReply *engine.AttributeProfile + var attrReply *engine.APIAttributeProfile if err := dispEngine.RPC.Call(utils.AttributeSv1GetAttributeForEvent, ev, &attrReply); err == nil || err.Error() != utils.ErrUnauthorizedApi.Error() { t.Error(err) @@ -405,32 +402,28 @@ func testDspAttrTestAuthKey2(t *testing.T) { utils.OptsContext: "simpleauth", }, } - eAttrPrf := &engine.AttributeProfile{ + eAttrPrf := &engine.APIAttributeProfile{ Tenant: ev.Tenant, ID: "ATTR_1001_SIMPLEAUTH", FilterIDs: []string{"*string:~*req.Account:1001", "*string:~*opts.*context:simpleauth"}, - Attributes: []*engine.Attribute{ - { - FilterIDs: []string{}, - Path: utils.MetaReq + utils.NestingSep + "Password", - Type: utils.MetaConstant, - Value: config.NewRSRParsersMustCompile("CGRateS.org", utils.InfieldSep), - }, - }, + Attributes: []*engine.ExternalAttribute{{ + FilterIDs: []string{}, + Path: utils.MetaReq + utils.NestingSep + "Password", + Type: utils.MetaConstant, + Value: "CGRateS.org", + }}, Weight: 20.0, } - eAttrPrf.Compile() if *encoding == utils.MetaGOB { eAttrPrf.Attributes[0].FilterIDs = nil // empty slice are nil in gob } - var attrReply *engine.AttributeProfile + var attrReply *engine.APIAttributeProfile if err := dispEngine.RPC.Call(utils.AttributeSv1GetAttributeForEvent, ev, &attrReply); err != nil { t.Error(err) } - if attrReply != nil { - attrReply.Compile() - } + sort.Strings(eAttrPrf.FilterIDs) + sort.Strings(attrReply.FilterIDs) if !reflect.DeepEqual(eAttrPrf, attrReply) { t.Errorf("Expecting: %s, received: %s", utils.ToJSON(eAttrPrf), utils.ToJSON(attrReply)) } @@ -447,7 +440,8 @@ func testDspAttrTestAuthKey2(t *testing.T) { "Password": "CGRateS.org", }, APIOpts: map[string]interface{}{ - utils.OptsAPIKey: "attr12345", + utils.OptsAPIKey: "attr12345", + utils.OptsContext: "simpleauth", }, }, } @@ -475,7 +469,7 @@ func testDspAttrTestAuthKey3(t *testing.T) { utils.OptsContext: "simpleauth", }, } - var attrReply *engine.AttributeProfile + var attrReply *engine.APIAttributeProfile if err := dispEngine.RPC.Call(utils.AttributeSv1GetAttributeForEvent, ev, &attrReply); err == nil || err.Error() != utils.ErrNotFound.Error() { t.Error(err) @@ -495,21 +489,18 @@ func testDspAttrGetAttrRoundRobin(t *testing.T) { utils.OptsContext: "simpleauth", }, } - eAttrPrf := &engine.AttributeProfile{ + eAttrPrf := &engine.APIAttributeProfile{ Tenant: ev.Tenant, ID: "ATTR_1002_SIMPLEAUTH", FilterIDs: []string{"*string:~*req.Account:1002", "*string:~*opts.*context:simpleauth"}, - Attributes: []*engine.Attribute{ - { - FilterIDs: []string{}, - Path: utils.MetaReq + utils.NestingSep + "Password", - Type: utils.MetaConstant, - Value: config.NewRSRParsersMustCompile("CGRateS.org", utils.InfieldSep), - }, - }, + Attributes: []*engine.ExternalAttribute{{ + FilterIDs: []string{}, + Path: utils.MetaReq + utils.NestingSep + "Password", + Type: utils.MetaConstant, + Value: "CGRateS.org", + }}, Weight: 20.0, } - eAttrPrf.Compile() if *encoding == utils.MetaGOB { eAttrPrf.Attributes[0].FilterIDs = nil // empty slice are nil in gob } @@ -526,12 +517,13 @@ func testDspAttrGetAttrRoundRobin(t *testing.T) { "Password": "CGRateS.org", }, APIOpts: map[string]interface{}{ - utils.OptsAPIKey: "attr12345", + utils.OptsAPIKey: "attr12345", + utils.OptsContext: "simpleauth", }, }, } - var attrReply *engine.AttributeProfile + var attrReply *engine.APIAttributeProfile var rplyEv engine.AttrSProcessEventReply // To ALL2 if err := dispEngine.RPC.Call(utils.AttributeSv1GetAttributeForEvent, @@ -544,9 +536,9 @@ func testDspAttrGetAttrRoundRobin(t *testing.T) { ev, &attrReply); err != nil { t.Error(err) } - if attrReply != nil { - attrReply.Compile() - } + + sort.Strings(eAttrPrf.FilterIDs) + sort.Strings(attrReply.FilterIDs) if !reflect.DeepEqual(eAttrPrf, attrReply) { t.Errorf("Expecting: %s, received: %s", utils.ToJSON(eAttrPrf), utils.ToJSON(attrReply)) } @@ -596,7 +588,8 @@ func testDspAttrGetAttrInternal(t *testing.T) { "Password": "CGRateS.com", }, APIOpts: map[string]interface{}{ - utils.OptsAPIKey: "attr12345", + utils.OptsAPIKey: "attr12345", + utils.OptsContext: "simpleauth", }, }, } diff --git a/dispatchers/caches_it_test.go b/dispatchers/caches_it_test.go index 43253f093..cbb5ffa84 100644 --- a/dispatchers/caches_it_test.go +++ b/dispatchers/caches_it_test.go @@ -98,8 +98,6 @@ func testDspChcPing(t *testing.T) { func testDspChcLoadAfterFolder(t *testing.T) { var rcvStats map[string]*ltcache.CacheStats expStats := engine.GetDefaultEmptyCacheStats() - expStats[utils.CacheLoadIDs].Items = 12 - expStats[utils.CacheRPCConnections].Items = 1 args := utils.AttrCacheIDsWithAPIOpts{ APIOpts: map[string]interface{}{ utils.OptsAPIKey: "chc12345", @@ -133,7 +131,7 @@ func testDspChcLoadAfterFolder(t *testing.T) { expStats[utils.CacheRouteProfiles].Items = 3 expStats[utils.CacheThresholdProfiles].Items = 2 expStats[utils.CacheThresholds].Items = 2 - expStats[utils.CacheLoadIDs].Items = 26 + expStats[utils.CacheLoadIDs].Items = 27 expStats[utils.CacheThresholdFilterIndexes].Items = 2 expStats[utils.CacheThresholdFilterIndexes].Groups = 1 expStats[utils.CacheStatFilterIndexes].Items = 7 @@ -144,8 +142,8 @@ func testDspChcLoadAfterFolder(t *testing.T) { expStats[utils.CacheResourceFilterIndexes].Groups = 1 expStats[utils.CacheChargerFilterIndexes].Items = 1 expStats[utils.CacheChargerFilterIndexes].Groups = 1 - expStats[utils.CacheAttributeFilterIndexes].Items = 11 - expStats[utils.CacheAttributeFilterIndexes].Groups = 4 + expStats[utils.CacheAttributeFilterIndexes].Items = 10 + expStats[utils.CacheAttributeFilterIndexes].Groups = 2 expStats[utils.CacheReverseFilterIndexes].Items = 8 expStats[utils.CacheReverseFilterIndexes].Groups = 6 if err := dispEngine.RPC.Call(utils.CacheSv1GetCacheStats, &args, &rcvStats); err != nil { @@ -199,24 +197,6 @@ func testDspChcPrecacheStatus(t *testing.T) { utils.CacheActionProfilesFilterIndexes: utils.MetaReady, utils.CacheAccountsFilterIndexes: utils.MetaReady, utils.CacheAccounts: utils.MetaReady, - - utils.CacheVersions: utils.MetaReady, - utils.CacheTBLTPResources: utils.MetaReady, - utils.CacheTBLTPStats: utils.MetaReady, - utils.CacheTBLTPThresholds: utils.MetaReady, - utils.CacheTBLTPFilters: utils.MetaReady, - utils.CacheSessionCostsTBL: utils.MetaReady, - utils.CacheCDRsTBL: utils.MetaReady, - utils.CacheTBLTPRoutes: utils.MetaReady, - utils.CacheTBLTPAttributes: utils.MetaReady, - utils.CacheTBLTPChargers: utils.MetaReady, - utils.CacheTBLTPDispatchers: utils.MetaReady, - utils.CacheTBLTPDispatcherHosts: utils.MetaReady, - utils.CacheTBLTPRateProfiles: utils.MetaReady, - utils.MetaAPIBan: utils.MetaReady, - utils.CacheTBLTPActionProfiles: utils.MetaReady, - utils.CacheTBLTPAccounts: utils.MetaReady, - utils.CacheReplicationHosts: utils.MetaReady, } if err := dispEngine.RPC.Call(utils.CacheSv1PrecacheStatus, utils.AttrCacheIDsWithAPIOpts{ diff --git a/dispatchers/cdrs_it_test.go b/dispatchers/cdrs_it_test.go index db22f6269..7597db4c7 100644 --- a/dispatchers/cdrs_it_test.go +++ b/dispatchers/cdrs_it_test.go @@ -32,30 +32,34 @@ import ( var ( sTestsDspCDRs = []func(t *testing.T){ testDspCDRsPing, - testDspCDRsProcessEvent, - testDspCDRsCountCDR, - testDspCDRsGetCDR, - testDspCDRsGetCDRWithoutTenant, - testDspCDRsProcessCDR, - testDspCDRsGetCDR2, - testDspCDRsProcessExternalCDR, - testDspCDRsGetCDR3, - testDspCDRsV2ProcessEvent, + /* + testDspCDRsProcessEvent, + testDspCDRsCountCDR, + testDspCDRsGetCDR, + testDspCDRsGetCDRWithoutTenant, + testDspCDRsProcessCDR, + testDspCDRsGetCDR2, + testDspCDRsProcessExternalCDR, + testDspCDRsGetCDR3, + testDspCDRsV2ProcessEvent, + */ // testDspCDRsV2StoreSessionCost, } sTestsDspCDRsWithoutAuth = []func(t *testing.T){ testDspCDRsPingNoAuth, - testDspCDRsProcessEventNoAuth, - testDspCDRsCountCDRNoAuth, - testDspCDRsGetCDRNoAuth, - testDspCDRsGetCDRNoAuthWithoutTenant, - testDspCDRsProcessCDRNoAuth, - testDspCDRsGetCDR2NoAuth, - testDspCDRsProcessExternalCDRNoAuth, - testDspCDRsGetCDR3NoAuth, - testDspCDRsV2ProcessEventNoAuth, - // testDspCDRsV2StoreSessionCostNoAuth, + /* + testDspCDRsProcessEventNoAuth, + testDspCDRsCountCDRNoAuth, + testDspCDRsGetCDRNoAuth, + testDspCDRsGetCDRNoAuthWithoutTenant, + testDspCDRsProcessCDRNoAuth, + testDspCDRsGetCDR2NoAuth, + testDspCDRsProcessExternalCDRNoAuth, + testDspCDRsGetCDR3NoAuth, + testDspCDRsV2ProcessEventNoAuth, + // testDspCDRsV2StoreSessionCostNoAuth, + */ } ) diff --git a/dispatchers/config_it_test.go b/dispatchers/config_it_test.go index 0767aa6c2..1afdfd88b 100644 --- a/dispatchers/config_it_test.go +++ b/dispatchers/config_it_test.go @@ -74,7 +74,8 @@ func testDspConfigSv1GetJSONSection(t *testing.T) { } var reply map[string]interface{} if err := dispEngine.RPC.Call(utils.ConfigSv1GetConfig, &config.SectionWithAPIOpts{ - Tenant: "cgrates.org", + Tenant: "cgrates.org", + Sections: []string{"listen"}, APIOpts: map[string]interface{}{ utils.OptsAPIKey: "cfg12345", }, diff --git a/dispatchers/dispatchers.go b/dispatchers/dispatchers.go index 631ba3f17..deaa3aa24 100644 --- a/dispatchers/dispatchers.go +++ b/dispatchers/dispatchers.go @@ -68,9 +68,6 @@ func (dS *DispatcherService) authorizeEvent(ctx *context.Context, ev *utils.CGRE return } -func (dS *DispatcherService) authorize2(method, tenant string, apiKey string) (err error) { - return dS.authorize(context.Background(), method, tenant, apiKey) -} func (dS *DispatcherService) authorize(ctx *context.Context, method, tenant string, apiKey string) (err error) { if apiKey == "" { return utils.NewErrMandatoryIeMissing(utils.APIKey) @@ -183,7 +180,7 @@ func (dS *DispatcherService) Dispatch(ctx *context.Context, ev *utils.CGREvent, return utils.NewErrDispatcherS(err) } if err = d.Dispatch(dS.dm, dS.fltrS, dS.cfg, - ctx, dS.connMgr.GetInternalChan(), evNm, tnt, utils.IfaceAsString(ev.APIOpts[utils.OptsRouteID]), + ctx, dS.connMgr.GetDispInternalChan(), evNm, tnt, utils.IfaceAsString(ev.APIOpts[utils.OptsRouteID]), subsys, serviceMethod, args, reply); !rpcclient.IsNetworkError(err) { return } diff --git a/dispatchers/dispatchers_test.go b/dispatchers/dispatchers_test.go index bf17c87d8..97e3be3c1 100644 --- a/dispatchers/dispatchers_test.go +++ b/dispatchers/dispatchers_test.go @@ -203,7 +203,7 @@ func TestDispatcherAuthorizeError(t *testing.T) { } connMng := engine.NewConnManager(cfg) dsp := NewDispatcherService(nil, cfg, nil, connMng) - err := dsp.authorize2("", "cgrates.org", utils.APIMethods) + err := dsp.authorize(context.Background(), "", "cgrates.org", utils.APIMethods) expected := "dial tcp: address error: missing port in address" if err == nil || err.Error() != expected { t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, err) @@ -227,7 +227,7 @@ func TestDispatcherAuthorizeError2(t *testing.T) { } connMng := engine.NewConnManager(cfg) dsp := NewDispatcherService(nil, cfg, nil, connMng) - err := dsp.authorize2("", "cgrates.org", utils.APIMethods) + err := dsp.authorize(context.Background(), "", "cgrates.org", utils.APIMethods) expected := "dial tcp: address error: missing port in address" if err == nil || err.Error() != expected { t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, err) @@ -376,7 +376,7 @@ func TestDispatcherServiceAuthorizeError(t *testing.T) { engine.Cache.SetWithoutReplicate(utils.CacheRPCConnections, "testID", value, nil, true, utils.NonTransactional) expected := "UNAUTHORIZED_API" - if err := dsp.authorize2(utils.APIMethods, "testTenant", "apikey"); err == nil || err.Error() != expected { + if err := dsp.authorize(context.Background(), utils.APIMethods, "testTenant", "apikey"); err == nil || err.Error() != expected { t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, err) } engine.Cache = cacheInit @@ -424,7 +424,7 @@ func TestDispatcherServiceAuthorizeError2(t *testing.T) { engine.Cache.SetWithoutReplicate(utils.CacheRPCConnections, "testID", value, nil, true, utils.NonTransactional) expected := "NOT_FOUND" - if err := dsp.authorize2(utils.APIMethods, "testTenant", "apikey"); err == nil || err.Error() != expected { + if err := dsp.authorize(context.Background(), utils.APIMethods, "testTenant", "apikey"); err == nil || err.Error() != expected { t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, err) } engine.Cache = cacheInit @@ -473,7 +473,7 @@ func TestDispatcherServiceAuthorizeError3(t *testing.T) { engine.Cache = newCache engine.Cache.SetWithoutReplicate(utils.CacheRPCConnections, "testID", value, nil, true, utils.NonTransactional) - if err := dsp.authorize2("testMethod", "testTenant", "apikey"); err != nil { + if err := dsp.authorize(context.Background(), "testMethod", "testTenant", "apikey"); err != nil { t.Errorf("\nExpected <%+v>, \nReceived <%+v>", nil, err) } engine.Cache = cacheInit diff --git a/dispatchers/guardian_it_test.go b/dispatchers/guardian_it_test.go index 0fe6706dd..93b3c9d98 100644 --- a/dispatchers/guardian_it_test.go +++ b/dispatchers/guardian_it_test.go @@ -26,6 +26,7 @@ import ( "testing" "time" + "github.com/cgrates/cgrates/guardian" "github.com/cgrates/cgrates/utils" ) @@ -89,7 +90,7 @@ func testDspGrdLock(t *testing.T) { Timeout: 500 * time.Millisecond, } var reply string - if err := dispEngine.RPC.Call(utils.GuardianSv1RemoteLock, &AttrRemoteLockWithAPIOpts{ + if err := dispEngine.RPC.Call(utils.GuardianSv1RemoteLock, &guardian.AttrRemoteLockWithAPIOpts{ AttrRemoteLock: args, Tenant: "cgrates.org", APIOpts: map[string]interface{}{ @@ -100,7 +101,7 @@ func testDspGrdLock(t *testing.T) { } var unlockReply []string - if err := dispEngine.RPC.Call(utils.GuardianSv1RemoteUnlock, &AttrRemoteUnlockWithAPIOpts{ + if err := dispEngine.RPC.Call(utils.GuardianSv1RemoteUnlock, &guardian.AttrRemoteUnlockWithAPIOpts{ RefID: reply, Tenant: "cgrates.org", APIOpts: map[string]interface{}{ diff --git a/dispatchers/lib_test.go b/dispatchers/lib_test.go index 1c36552d0..327d4ef93 100644 --- a/dispatchers/lib_test.go +++ b/dispatchers/lib_test.go @@ -88,10 +88,11 @@ func newTestEngine(t *testing.T, cfgPath string, initDataDB, intitStoreDB bool) func (d *testDispatcher) startEngine(t *testing.T) { var err error + // if !strings.Contains(d.CfgPath, "dispatchers_mysql") { if d.cmd, err = engine.StartEngine(d.CfgPath, *waitRater); err != nil { t.Fatalf("Error at engine start:%v\n", err) } - + // } if d.RPC, err = newRPCClient(d.Cfg.ListenCfg()); err != nil { t.Fatalf("Error at dialing rcp client:%v\n", err) } @@ -119,13 +120,14 @@ func (d *testDispatcher) resetStorDb(t *testing.T) { t.Fatalf("Error at DataDB init:%v\n", err) } } -func (d *testDispatcher) loadData(t *testing.T, path string) { - var reply string - attrs := &utils.AttrLoadTpFromFolder{FolderPath: path} - if err := d.RPC.Call(utils.APIerSv1LoadTariffPlanFromFolder, attrs, &reply); err != nil { - t.Errorf("<%s>Error at loading data from folder :%v", d.CfgPath, err) - } -} + +// func (d *testDispatcher) loadData(t *testing.T, path string) { +// var reply string +// attrs := &utils.AttrLoadTpFromFolder{FolderPath: path} +// if err := d.RPC.Call(utils.APIerSv1LoadTariffPlanFromFolder, attrs, &reply); err != nil { +// t.Errorf("<%s>Error at loading data from folder :%v", d.CfgPath, err) +// } +// } func (d *testDispatcher) loadData2(t *testing.T, path string) { wchan := make(chan struct{}, 1) @@ -150,13 +152,13 @@ func (d *testDispatcher) loadData2(t *testing.T, path string) { } func testDsp(t *testing.T, tests []func(t *testing.T), testName, all, all2, disp, allTF, all2TF, attrTF string) { - engine.KillEngine(0) + // engine.KillEngine(0) allEngine = newTestEngine(t, path.Join(*dataDir, "conf", "samples", "dispatchers", all), true, true) allEngine2 = newTestEngine(t, path.Join(*dataDir, "conf", "samples", "dispatchers", all2), true, true) dispEngine = newTestEngine(t, path.Join(*dataDir, "conf", "samples", "dispatchers", disp), true, true) dispEngine.loadData2(t, path.Join(*dataDir, "tariffplans", attrTF)) - allEngine.loadData(t, path.Join(*dataDir, "tariffplans", allTF)) - allEngine2.loadData(t, path.Join(*dataDir, "tariffplans", all2TF)) + allEngine.loadData2(t, path.Join(*dataDir, "tariffplans", allTF)) + allEngine2.loadData2(t, path.Join(*dataDir, "tariffplans", all2TF)) time.Sleep(200 * time.Millisecond) for _, stest := range tests { t.Run(testName, stest) diff --git a/ees/rpc_test.go b/ees/rpc_test.go index 35cb274bf..f6d46bf03 100644 --- a/ees/rpc_test.go +++ b/ees/rpc_test.go @@ -74,7 +74,7 @@ func TestRPCCfg(t *testing.T) { ConcurrentRequests: 0, }, codec: utils.MetaJSON, - serviceMethod: utils.APIerSv1ExportToFolder, + serviceMethod: utils.AdminSv1ComputeFilterIndexIDs, } exp := &config.EventExporterCfg{ ID: utils.MetaDefault, diff --git a/engine/connmanager.go b/engine/connmanager.go index e3fd9bef2..c5dbf3c0c 100644 --- a/engine/connmanager.go +++ b/engine/connmanager.go @@ -215,6 +215,9 @@ func (cM *ConnManager) GetInternalChan() chan birpc.ClientConnector { return cM.dynIntCh.GetInternalChanel() } +func (cM *ConnManager) GetDispInternalChan() chan birpc.ClientConnector { + return cM.dynIntCh.GetInternalChanel() +} func (cM *ConnManager) AddInternalConn(connName, apiPrefix string, iConnCh chan birpc.ClientConnector) { cM.rpcInternal[connName] = iConnCh diff --git a/engine/filterhelpers.go b/engine/filterhelpers.go index 085e94a48..ccf248c39 100644 --- a/engine/filterhelpers.go +++ b/engine/filterhelpers.go @@ -87,11 +87,7 @@ func MatchingItemIDsForEvent(ctx *context.Context, ev utils.MapStorage, stringFl dbItemIDs = dbIndexes[key] break // we got at least one answer back, longest prefix wins } - for itemID := range dbItemIDs { - if _, hasIt := itemIDs[itemID]; !hasIt { // Add it to list if not already there - itemIDs[itemID] = dbItemIDs[itemID] - } - } + itemIDs = utils.JoinStringSet(itemIDs, dbItemIDs) } } return diff --git a/general_tests/export_it_test.go b/general_tests/export_it_test.go index 6c07162b1..822ad07b2 100644 --- a/general_tests/export_it_test.go +++ b/general_tests/export_it_test.go @@ -141,6 +141,7 @@ func testExpLoadTPFromFolder(t *testing.T) { } } +/* func testExpExportToFolder(t *testing.T) { var reply string arg := &utils.ArgExportToFolder{ @@ -162,6 +163,7 @@ func testExpLoadTPFromExported(t *testing.T) { t.Error(reply) } } +*/ func testExpVerifyAttributes(t *testing.T) { exp := &engine.AttributeProfile{ diff --git a/utils/consts.go b/utils/consts.go index dcd064ce8..962dc3750 100644 --- a/utils/consts.go +++ b/utils/consts.go @@ -43,7 +43,7 @@ var ( CacheAttributeFilterIndexes, CacheChargerFilterIndexes, CacheDispatcherFilterIndexes, CacheLoadIDs, CacheRateProfiles, CacheRateProfilesFilterIndexes, CacheRateFilterIndexes, CacheActionProfilesFilterIndexes, CacheAccountsFilterIndexes, CacheReverseFilterIndexes, - CacheAccounts, CacheVersions}) + CacheAccounts}) storDBPartition = NewStringSet([]string{ CacheTBLTPResources, CacheTBLTPStats, CacheTBLTPThresholds, CacheTBLTPFilters, CacheSessionCostsTBL, CacheCDRsTBL, @@ -51,7 +51,7 @@ var ( CacheTBLTPDispatcherHosts, CacheTBLTPRateProfiles, CacheTBLTPActionProfiles, CacheTBLTPAccounts, CacheVersions}) // CachePartitions enables creation of cache partitions - CachePartitions = JoinStringSet(extraDBPartition, DataDBPartitions, storDBPartition) + CachePartitions = JoinStringSet(extraDBPartition, DataDBPartitions /*,storDBPartition*/) CacheInstanceToPrefix = map[string]string{ CacheResourceProfiles: ResourceProfilesPrefix, @@ -679,7 +679,6 @@ const ( Preference = "Preference" Flags = "Flags" Service = "Service" - ApierV = "ApierV" MetaAnalyzer = "*analyzer" CGREventString = "CGREvent" MetaTextPlain = "*text_plain" @@ -1135,7 +1134,7 @@ const ( ReplicatorSv1RemoveIndexes = "ReplicatorSv1.RemoveIndexes" ) -// APIerSv1 APIs +// AdminSv1 APIs const ( AdminSv1GetRateRatesIndexesHealth = "AdminSv1.GetRateRatesIndexesHealth" AdminSv1GetChargerProfileCount = "AdminSv1.GetChargerProfileCount" @@ -1162,111 +1161,111 @@ const ( AdminSv1GetDispatcherProfile = "AdminSv1.GetDispatcherProfile" AdminSv1GetDispatcherProfileIDs = "AdminSv1.GetDispatcherProfileIDs" AdminSv1RemoveDispatcherProfile = "AdminSv1.RemoveDispatcherProfile" - APIerSv1SetBalances = "APIerSv1.SetBalances" - AdminSv1SetDispatcherHost = "AdminSv1.SetDispatcherHost" - AdminSv1GetDispatcherHost = "AdminSv1.GetDispatcherHost" - AdminSv1GetDispatcherHostIDs = "AdminSv1.GetDispatcherHostIDs" - AdminSv1RemoveDispatcherHost = "AdminSv1.RemoveDispatcherHost" - APIerSv1GetEventCost = "APIerSv1.GetEventCost" - APIerSv1LoadTariffPlanFromFolder = "APIerSv1.LoadTariffPlanFromFolder" - APIerSv1ExportToFolder = "APIerSv1.ExportToFolder" - APIerSv1GetCost = "APIerSv1.GetCost" - AdminSv1GetFilter = "AdminSv1.GetFilter" - AdminSv1GetFilterIndexes = "AdminSv1.GetFilterIndexes" - AdminSv1RemoveFilterIndexes = "AdminSv1.RemoveFilterIndexes" - AdminSv1RemoveFilter = "AdminSv1.RemoveFilter" - AdminSv1SetFilter = "AdminSv1.SetFilter" - AdminSv1GetFilterIDs = "AdminSv1.GetFilterIDs" - AdminSv1GetFilterCount = "AdminSv1.GetFilterCount" - APIerSv1SetDataDBVersions = "APIerSv1.SetDataDBVersions" - APIerSv1SetStorDBVersions = "APIerSv1.SetStorDBVersions" - APIerSv1GetActions = "APIerSv1.GetActions" + // APIerSv1SetBalances = "APIerSv1.SetBalances" + AdminSv1SetDispatcherHost = "AdminSv1.SetDispatcherHost" + AdminSv1GetDispatcherHost = "AdminSv1.GetDispatcherHost" + AdminSv1GetDispatcherHostIDs = "AdminSv1.GetDispatcherHostIDs" + AdminSv1RemoveDispatcherHost = "AdminSv1.RemoveDispatcherHost" + // APIerSv1GetEventCost = "APIerSv1.GetEventCost" + // APIerSv1LoadTariffPlanFromFolder = "APIerSv1.LoadTariffPlanFromFolder" + // APIerSv1ExportToFolder = "APIerSv1.ExportToFolder" + // APIerSv1GetCost = "APIerSv1.GetCost" + AdminSv1GetFilter = "AdminSv1.GetFilter" + AdminSv1GetFilterIndexes = "AdminSv1.GetFilterIndexes" + AdminSv1RemoveFilterIndexes = "AdminSv1.RemoveFilterIndexes" + AdminSv1RemoveFilter = "AdminSv1.RemoveFilter" + AdminSv1SetFilter = "AdminSv1.SetFilter" + AdminSv1GetFilterIDs = "AdminSv1.GetFilterIDs" + AdminSv1GetFilterCount = "AdminSv1.GetFilterCount" + // APIerSv1SetDataDBVersions = "APIerSv1.SetDataDBVersions" + // APIerSv1SetStorDBVersions = "APIerSv1.SetStorDBVersions" + // APIerSv1GetActions = "APIerSv1.GetActions" - APIerSv1GetDataDBVersions = "APIerSv1.GetDataDBVersions" - APIerSv1GetStorDBVersions = "APIerSv1.GetStorDBVersions" - APIerSv1GetCDRs = "APIerSv1.GetCDRs" - APIerSv1GetTPActions = "APIerSv1.GetTPActions" - APIerSv1GetTPAttributeProfile = "APIerSv1.GetTPAttributeProfile" - APIerSv1SetTPAttributeProfile = "APIerSv1.SetTPAttributeProfile" - APIerSv1GetTPAttributeProfileIds = "APIerSv1.GetTPAttributeProfileIds" - APIerSv1RemoveTPAttributeProfile = "APIerSv1.RemoveTPAttributeProfile" - APIerSv1GetTPCharger = "APIerSv1.GetTPCharger" - APIerSv1SetTPCharger = "APIerSv1.SetTPCharger" - APIerSv1RemoveTPCharger = "APIerSv1.RemoveTPCharger" - APIerSv1GetTPChargerIDs = "APIerSv1.GetTPChargerIDs" - APIerSv1SetTPFilterProfile = "APIerSv1.SetTPFilterProfile" - APIerSv1GetTPFilterProfile = "APIerSv1.GetTPFilterProfile" - APIerSv1GetTPFilterProfileIds = "APIerSv1.GetTPFilterProfileIds" - APIerSv1RemoveTPFilterProfile = "APIerSv1.RemoveTPFilterProfile" + // APIerSv1GetDataDBVersions = "APIerSv1.GetDataDBVersions" + // APIerSv1GetStorDBVersions = "APIerSv1.GetStorDBVersions" + // APIerSv1GetCDRs = "APIerSv1.GetCDRs" + // APIerSv1GetTPActions = "APIerSv1.GetTPActions" + // APIerSv1GetTPAttributeProfile = "APIerSv1.GetTPAttributeProfile" + // APIerSv1SetTPAttributeProfile = "APIerSv1.SetTPAttributeProfile" + // APIerSv1GetTPAttributeProfileIds = "APIerSv1.GetTPAttributeProfileIds" + // APIerSv1RemoveTPAttributeProfile = "APIerSv1.RemoveTPAttributeProfile" + // APIerSv1GetTPCharger = "APIerSv1.GetTPCharger" + // APIerSv1SetTPCharger = "APIerSv1.SetTPCharger" + // APIerSv1RemoveTPCharger = "APIerSv1.RemoveTPCharger" + // APIerSv1GetTPChargerIDs = "APIerSv1.GetTPChargerIDs" + // APIerSv1SetTPFilterProfile = "APIerSv1.SetTPFilterProfile" + // APIerSv1GetTPFilterProfile = "APIerSv1.GetTPFilterProfile" + // APIerSv1GetTPFilterProfileIds = "APIerSv1.GetTPFilterProfileIds" + // APIerSv1RemoveTPFilterProfile = "APIerSv1.RemoveTPFilterProfile" - APIerSv1GetTPResource = "APIerSv1.GetTPResource" - APIerSv1SetTPResource = "APIerSv1.SetTPResource" - APIerSv1RemoveTPResource = "APIerSv1.RemoveTPResource" - APIerSv1SetTPRate = "APIerSv1.SetTPRate" - APIerSv1GetTPRate = "APIerSv1.GetTPRate" - APIerSv1RemoveTPRate = "APIerSv1.RemoveTPRate" - APIerSv1GetTPRateIds = "APIerSv1.GetTPRateIds" - APIerSv1SetTPThreshold = "APIerSv1.SetTPThreshold" - APIerSv1GetTPThreshold = "APIerSv1.GetTPThreshold" - APIerSv1GetTPThresholdIDs = "APIerSv1.GetTPThresholdIDs" - APIerSv1RemoveTPThreshold = "APIerSv1.RemoveTPThreshold" - APIerSv1SetTPStat = "APIerSv1.SetTPStat" - APIerSv1GetTPStat = "APIerSv1.GetTPStat" - APIerSv1RemoveTPStat = "APIerSv1.RemoveTPStat" - APIerSv1SetTPRouteProfile = "APIerSv1.SetTPRouteProfile" - APIerSv1GetTPRouteProfile = "APIerSv1.GetTPRouteProfile" - APIerSv1GetTPRouteProfileIDs = "APIerSv1.GetTPRouteProfileIDs" - APIerSv1RemoveTPRouteProfile = "APIerSv1.RemoveTPRouteProfile" - APIerSv1GetTPDispatcherProfile = "APIerSv1.GetTPDispatcherProfile" - APIerSv1SetTPDispatcherProfile = "APIerSv1.SetTPDispatcherProfile" - APIerSv1RemoveTPDispatcherProfile = "APIerSv1.RemoveTPDispatcherProfile" - APIerSv1GetTPDispatcherProfileIDs = "APIerSv1.GetTPDispatcherProfileIDs" - APIerSv1ExportCDRs = "APIerSv1.ExportCDRs" - APIerSv1SetTPRatingPlan = "APIerSv1.SetTPRatingPlan" - APIerSv1SetTPActions = "APIerSv1.SetTPActions" - APIerSv1GetTPActionIds = "APIerSv1.GetTPActionIds" - APIerSv1RemoveTPActions = "APIerSv1.RemoveTPActions" - APIerSv1SetActionPlan = "APIerSv1.SetActionPlan" - APIerSv1ExecuteAction = "APIerSv1.ExecuteAction" - APIerSv1SetTPRatingProfile = "APIerSv1.SetTPRatingProfile" - APIerSv1GetTPRatingProfile = "APIerSv1.GetTPRatingProfile" + // APIerSv1GetTPResource = "APIerSv1.GetTPResource" + // APIerSv1SetTPResource = "APIerSv1.SetTPResource" + // APIerSv1RemoveTPResource = "APIerSv1.RemoveTPResource" + // APIerSv1SetTPRate = "APIerSv1.SetTPRate" + // APIerSv1GetTPRate = "APIerSv1.GetTPRate" + // APIerSv1RemoveTPRate = "APIerSv1.RemoveTPRate" + // APIerSv1GetTPRateIds = "APIerSv1.GetTPRateIds" + // APIerSv1SetTPThreshold = "APIerSv1.SetTPThreshold" + // APIerSv1GetTPThreshold = "APIerSv1.GetTPThreshold" + // APIerSv1GetTPThresholdIDs = "APIerSv1.GetTPThresholdIDs" + // APIerSv1RemoveTPThreshold = "APIerSv1.RemoveTPThreshold" + // APIerSv1SetTPStat = "APIerSv1.SetTPStat" + // APIerSv1GetTPStat = "APIerSv1.GetTPStat" + // APIerSv1RemoveTPStat = "APIerSv1.RemoveTPStat" + // APIerSv1SetTPRouteProfile = "APIerSv1.SetTPRouteProfile" + // APIerSv1GetTPRouteProfile = "APIerSv1.GetTPRouteProfile" + // APIerSv1GetTPRouteProfileIDs = "APIerSv1.GetTPRouteProfileIDs" + // APIerSv1RemoveTPRouteProfile = "APIerSv1.RemoveTPRouteProfile" + // APIerSv1GetTPDispatcherProfile = "APIerSv1.GetTPDispatcherProfile" + // APIerSv1SetTPDispatcherProfile = "APIerSv1.SetTPDispatcherProfile" + // APIerSv1RemoveTPDispatcherProfile = "APIerSv1.RemoveTPDispatcherProfile" + // APIerSv1GetTPDispatcherProfileIDs = "APIerSv1.GetTPDispatcherProfileIDs" + // APIerSv1ExportCDRs = "APIerSv1.ExportCDRs" + // APIerSv1SetTPRatingPlan = "APIerSv1.SetTPRatingPlan" + // APIerSv1SetTPActions = "APIerSv1.SetTPActions" + // APIerSv1GetTPActionIds = "APIerSv1.GetTPActionIds" + // APIerSv1RemoveTPActions = "APIerSv1.RemoveTPActions" + // APIerSv1SetActionPlan = "APIerSv1.SetActionPlan" + // APIerSv1ExecuteAction = "APIerSv1.ExecuteAction" + // APIerSv1SetTPRatingProfile = "APIerSv1.SetTPRatingProfile" + // APIerSv1GetTPRatingProfile = "APIerSv1.GetTPRatingProfile" - APIerSv1ImportTariffPlanFromFolder = "APIerSv1.ImportTariffPlanFromFolder" - APIerSv1ExportTPToFolder = "APIerSv1.ExportTPToFolder" - APIerSv1SetActions = "APIerSv1.SetActions" + // APIerSv1ImportTariffPlanFromFolder = "APIerSv1.ImportTariffPlanFromFolder" + // APIerSv1ExportTPToFolder = "APIerSv1.ExportTPToFolder" + // APIerSv1SetActions = "APIerSv1.SetActions" - APIerSv1GetDataCost = "APIerSv1.GetDataCost" - APIerSv1ReplayFailedPosts = "APIerSv1.ReplayFailedPosts" - APIerSv1GetCacheStats = "APIerSv1.GetCacheStats" - APIerSv1ReloadCache = "APIerSv1.ReloadCache" - APIerSv1RemoveActions = "APIerSv1.RemoveActions" - APIerSv1GetLoadHistory = "APIerSv1.GetLoadHistory" - APIerSv1GetLoadIDs = "APIerSv1.GetLoadIDs" - APIerSv1GetLoadTimes = "APIerSv1.GetLoadTimes" + // APIerSv1GetDataCost = "APIerSv1.GetDataCost" + // APIerSv1ReplayFailedPosts = "APIerSv1.ReplayFailedPosts" + // APIerSv1GetCacheStats = "APIerSv1.GetCacheStats" + // APIerSv1ReloadCache = "APIerSv1.ReloadCache" + // APIerSv1RemoveActions = "APIerSv1.RemoveActions" + // APIerSv1GetLoadHistory = "APIerSv1.GetLoadHistory" + // APIerSv1GetLoadIDs = "APIerSv1.GetLoadIDs" + // APIerSv1GetLoadTimes = "APIerSv1.GetLoadTimes" AdminSv1GetAttributeProfileCount = "AdminSv1.GetAttributeProfileCount" - APIerSv1GetTPActionProfile = "APIerSv1.GetTPActionProfile" - APIerSv1SetTPActionProfile = "APIerSv1.SetTPActionProfile" - APIerSv1GetTPActionProfileIDs = "APIerSv1.GetTPActionProfileIDs" - APIerSv1RemoveTPActionProfile = "APIerSv1.RemoveTPActionProfile" - APIerSv1GetTPRateProfile = "APIerSv1.GetTPRateProfile" - APIerSv1SetTPRateProfile = "APIerSv1.SetTPRateProfile" - APIerSv1GetTPRateProfileIds = "APIerSv1.GetTPRateProfileIds" - APIerSv1RemoveTPRateProfile = "APIerSv1.RemoveTPRateProfile" - AdminSv1SetAccount = "AdminSv1.SetAccount" - AdminSv1GetAccount = "AdminSv1.GetAccount" - AdminSv1GetAccountIDs = "AdminSv1.GetAccountIDs" - AdminSv1RemoveAccount = "AdminSv1.RemoveAccount" - AdminSv1GetAccountCount = "AdminSv1.GetAccountCount" - APIerSv1GetTPAccountIDs = "APIerSv1.GetTPAccountIDs" - APIerSv1GetTPAccount = "APIerSv1.GetTPAccount" - APIerSv1SetTPAccount = "APIerSv1.SetTPAccount" - APIerSv1RemoveTPAccount = "APIerSv1.RemoveTPAccount" + // APIerSv1GetTPActionProfile = "APIerSv1.GetTPActionProfile" + // APIerSv1SetTPActionProfile = "APIerSv1.SetTPActionProfile" + // APIerSv1GetTPActionProfileIDs = "APIerSv1.GetTPActionProfileIDs" + // APIerSv1RemoveTPActionProfile = "APIerSv1.RemoveTPActionProfile" + // APIerSv1GetTPRateProfile = "APIerSv1.GetTPRateProfile" + // APIerSv1SetTPRateProfile = "APIerSv1.SetTPRateProfile" + // APIerSv1GetTPRateProfileIds = "APIerSv1.GetTPRateProfileIds" + // APIerSv1RemoveTPRateProfile = "APIerSv1.RemoveTPRateProfile" + AdminSv1SetAccount = "AdminSv1.SetAccount" + AdminSv1GetAccount = "AdminSv1.GetAccount" + AdminSv1GetAccountIDs = "AdminSv1.GetAccountIDs" + AdminSv1RemoveAccount = "AdminSv1.RemoveAccount" + AdminSv1GetAccountCount = "AdminSv1.GetAccountCount" + // APIerSv1GetTPAccountIDs = "APIerSv1.GetTPAccountIDs" + // APIerSv1GetTPAccount = "APIerSv1.GetTPAccount" + // APIerSv1SetTPAccount = "APIerSv1.SetTPAccount" + // APIerSv1RemoveTPAccount = "APIerSv1.RemoveTPAccount" ) // APIerSv1 TP APIs const ( - APIerSv1LoadTariffPlanFromStorDb = "APIerSv1.LoadTariffPlanFromStorDb" - APIerSv1RemoveTPFromFolder = "APIerSv1.RemoveTPFromFolder" +// APIerSv1LoadTariffPlanFromStorDb = "APIerSv1.LoadTariffPlanFromStorDb" +// APIerSv1RemoveTPFromFolder = "APIerSv1.RemoveTPFromFolder" ) const (