diff --git a/analyzers/analyzers.go b/analyzers/analyzers.go
old mode 100755
new mode 100644
diff --git a/apier/v1/analyzer.go b/apier/v1/analyzer.go
old mode 100755
new mode 100644
diff --git a/apier/v1/chargers_it_test.go b/apier/v1/chargers_it_test.go
old mode 100755
new mode 100644
diff --git a/apier/v1/dispatcher.go b/apier/v1/dispatcher.go
old mode 100755
new mode 100644
diff --git a/apier/v1/precache_it_test.go b/apier/v1/precache_it_test.go
index b89b33fb1..700c5ab98 100644
--- a/apier/v1/precache_it_test.go
+++ b/apier/v1/precache_it_test.go
@@ -211,7 +211,6 @@ func testPrecacheGetCacheStatsAfterRestart(t *testing.T) {
Items: 10,
Groups: 1,
},
-<<<<<<< HEAD
utils.CacheThresholdProfiles: {Items: 7},
utils.CacheThresholds: {Items: 7},
utils.CacheTimings: {},
@@ -249,48 +248,6 @@ func testPrecacheGetCacheStatsAfterRestart(t *testing.T) {
utils.CacheTBLTPDispatcherHosts: {},
utils.MetaAPIBan: {},
utils.CacheReplicationHosts: {},
-=======
- utils.CacheThresholdProfiles: {Items: 7},
- utils.CacheThresholds: {Items: 7},
- utils.CacheTimings: {},
- utils.CacheDiameterMessages: {},
- utils.CacheClosedSessions: {},
- utils.CacheLoadIDs: {},
- utils.CacheRPCConnections: {},
- utils.CacheCDRIDs: {},
- utils.CacheRatingProfilesTmp: {},
- utils.CacheUCH: {},
- utils.CacheReverseFilterIndexes: {},
- utils.CacheAccounts: {},
- utils.CacheVersions: {},
- utils.CacheTBLTPTimings: {},
- utils.CacheTBLTPDestinations: {},
- utils.CacheTBLTPRates: {},
- utils.CacheTBLTPDestinationRates: {},
- utils.CacheTBLTPRatingPlans: {},
- utils.CacheTBLTPRatingProfiles: {},
- utils.CacheTBLTPSharedGroups: {},
- utils.CacheTBLTPActions: {},
- utils.CacheTBLTPActionPlans: {},
- utils.CacheTBLTPActionTriggers: {},
- utils.CacheTBLTPAccountActions: {},
- utils.CacheTBLTPResources: {},
- utils.CacheTBLTPStats: {},
- utils.CacheTBLTPThresholds: {},
- utils.CacheTBLTPFilters: {},
- utils.CacheSessionCostsTBL: {},
- utils.CacheCDRsTBL: {},
- utils.CacheTBLTPRoutes: {},
- utils.CacheTBLTPAttributes: {},
- utils.CacheTBLTPChargers: {},
- utils.CacheTBLTPDispatchers: {},
- utils.CacheTBLTPDispatcherHosts: {},
- utils.MetaAPIBan: {},
- utils.CacheTBLTPAccountProfiles: {},
- utils.CacheAccountProfiles: {},
- utils.CacheAccountProfilesFilterIndexes: {},
- utils.CacheReplicationHosts: {},
->>>>>>> Removing ActionS
}
if *apiBan {
(*expectedStats)[utils.MetaAPIBan] = <cache.CacheStats{Items: 254}
diff --git a/apier/v1/sessions_thresholds_it_test.go b/apier/v1/sessions_thresholds_it_test.go
old mode 100755
new mode 100644
diff --git a/apier/v1/tpchargers.go b/apier/v1/tpchargers.go
old mode 100755
new mode 100644
diff --git a/apier/v1/tprateprofiles_it_test.go b/apier/v1/tprateprofiles_it_test.go
new file mode 100644
index 000000000..741ecb096
--- /dev/null
+++ b/apier/v1/tprateprofiles_it_test.go
@@ -0,0 +1,232 @@
+// +build offline
+
+/*
+Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments
+Copyright (C) ITsysCOM GmbH
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see
+*/
+
+package v1
+
+import (
+ "net/rpc"
+ "net/rpc/jsonrpc"
+ "path"
+ "reflect"
+ "sort"
+ "testing"
+
+ "github.com/cgrates/cgrates/config"
+ "github.com/cgrates/cgrates/engine"
+ "github.com/cgrates/cgrates/utils"
+)
+
+var (
+ tpRatePrfCfgPath string
+ tpRatePrfCfg *config.CGRConfig
+ tpRatePrfRPC *rpc.Client
+ tpRatePrf *utils.TPRateProfile
+ tpRatePrfDelay int
+ tpRatePrfConfigDIR string //run tests for specific configuration
+)
+
+var sTestsTPRatePrf = []func(t *testing.T){
+ testTPRatePrfInitCfg,
+ testTPRatePrfResetStorDb,
+ testTPRatePrfStartEngine,
+ testTPRatePrfRPCConn,
+ testTPRatePrfGetTPRatePrfBeforeSet,
+ testTPRatePrfSetTPRatePrf,
+ testTPRatePrfGetTPRatePrfAfterSet,
+ testTPRatePrfGetTPRatePrfIDs,
+ testTPRatePrfUpdateTPRatePrf,
+ testTPRatePrfGetTPRatePrfAfterUpdate,
+ testTPRatePrfRemTPRatePrf,
+ testTPRatePrfKillEngine,
+}
+
+//Test start here
+func TestTPRatePrfIT(t *testing.T) {
+ switch *dbType {
+ case utils.MetaInternal:
+ tpRatePrfConfigDIR = "tutinternal"
+ case utils.MetaMySQL:
+ tpRatePrfConfigDIR = "tutmysql"
+ case utils.MetaMongo:
+ tpRatePrfConfigDIR = "tutmongo"
+ case utils.MetaPostgres:
+ t.SkipNow()
+ default:
+ t.Fatal("Unknown Database type")
+ }
+ for _, stest := range sTestsTPRatePrf {
+ t.Run(tpRatePrfConfigDIR, stest)
+ }
+}
+
+func testTPRatePrfInitCfg(t *testing.T) {
+ var err error
+ tpRatePrfCfgPath = path.Join(*dataDir, "conf", "samples", tpRatePrfConfigDIR)
+ tpRatePrfCfg, err = config.NewCGRConfigFromPath(tpRatePrfCfgPath)
+ if err != nil {
+ t.Error(err)
+ }
+ tpRatePrfDelay = 1000
+}
+
+// Wipe out the cdr database
+func testTPRatePrfResetStorDb(t *testing.T) {
+ if err := engine.InitStorDb(tpRatePrfCfg); err != nil {
+ t.Fatal(err)
+ }
+}
+
+// Start CGR Engine
+func testTPRatePrfStartEngine(t *testing.T) {
+ if _, err := engine.StopStartEngine(tpRatePrfCfgPath, tpRatePrfDelay); err != nil {
+ t.Fatal(err)
+ }
+}
+
+// Connect rpc client to rater
+func testTPRatePrfRPCConn(t *testing.T) {
+ var err error
+ tpRatePrfRPC, err = jsonrpc.Dial(utils.TCP, tpRatePrfCfg.ListenCfg().RPCJSONListen) // We connect over JSON so we can also troubleshoot if needed
+ if err != nil {
+ t.Fatal(err)
+ }
+}
+
+func testTPRatePrfGetTPRatePrfBeforeSet(t *testing.T) {
+ var reply *utils.TPRateProfile
+ if err := tpRatePrfRPC.Call(utils.APIerSv1GetTPRateProfile,
+ &utils.TPTntID{TPid: "TP1", Tenant: "cgrates.org", ID: "Attr1"}, &reply); err == nil || err.Error() != utils.ErrNotFound.Error() {
+ t.Error(err)
+ }
+}
+
+func testTPRatePrfSetTPRatePrf(t *testing.T) {
+ tpRatePrf = &utils.TPRateProfile{
+ TPid: "TP1",
+ Tenant: "cgrates.org",
+ ID: "RT_SPECIAL_1002",
+ Weights: ";10",
+ Rates: map[string]*utils.TPRate{
+ "RT_ALWAYS": {
+ ID: "RT_ALWAYS",
+ FilterIDs: []string{"* * * * *"},
+ Weights: ";0",
+ Blocker: false,
+ IntervalRates: []*utils.TPIntervalRate{
+ {
+ IntervalStart: "0s",
+ RecurrentFee: 0.01,
+ Unit: "1m",
+ Increment: "1s",
+ },
+ },
+ },
+ },
+ }
+ var result string
+ if err := tpRatePrfRPC.Call(utils.APIerSv1SetTPRateProfile, tpRatePrf, &result); err != nil {
+ t.Error(err)
+ } else if result != utils.OK {
+ t.Error("Unexpected reply returned", result)
+ }
+}
+
+func testTPRatePrfGetTPRatePrfAfterSet(t *testing.T) {
+ var reply *utils.TPRateProfile
+ if err := tpRatePrfRPC.Call(utils.APIerSv1GetTPRateProfile,
+ &utils.TPTntID{TPid: "TP1", Tenant: "cgrates.org", ID: "RT_SPECIAL_1002"}, &reply); err != nil {
+ t.Fatal(err)
+ }
+ sort.Strings(reply.FilterIDs)
+ if !reflect.DeepEqual(tpRatePrf, reply) {
+ t.Errorf("Expecting : %+v, received: %+v", utils.ToJSON(tpRatePrf), utils.ToJSON(reply))
+ }
+}
+
+func testTPRatePrfGetTPRatePrfIDs(t *testing.T) {
+ var result []string
+ expectedTPID := []string{"cgrates.org:RT_SPECIAL_1002"}
+ if err := tpRatePrfRPC.Call(utils.APIerSv1GetTPRateProfileIds,
+ &AttrGetTPRateProfileIds{TPid: "TP1"}, &result); err != nil {
+ t.Error(err)
+ } else if !reflect.DeepEqual(expectedTPID, result) {
+ t.Errorf("Expecting: %+v, received: %+v", expectedTPID, result)
+ }
+}
+
+func testTPRatePrfUpdateTPRatePrf(t *testing.T) {
+ tpRatePrf.Rates = map[string]*utils.TPRate{
+ "RT_ALWAYS": {
+ ID: "RT_ALWAYS",
+ FilterIDs: []string{"* * * * *"},
+ Weights: ";0",
+ Blocker: false,
+ IntervalRates: []*utils.TPIntervalRate{
+ {
+ IntervalStart: "0s",
+ RecurrentFee: 0.01,
+ Unit: "1m",
+ Increment: "1s",
+ },
+ },
+ },
+ }
+ var result string
+ if err := tpRatePrfRPC.Call(utils.APIerSv1SetTPRateProfile, tpRatePrf, &result); err != nil {
+ t.Error(err)
+ } else if result != utils.OK {
+ t.Error("Unexpected reply returned", result)
+ }
+}
+
+func testTPRatePrfGetTPRatePrfAfterUpdate(t *testing.T) {
+ var reply *utils.TPRateProfile
+ revTPRatePrf := &utils.TPRateProfile{
+ TPid: "TP1",
+ Tenant: "cgrates.org",
+ ID: "RT_SPECIAL_1002",
+ Weights: ";10",
+ }
+
+ if err := tpRatePrfRPC.Call(utils.APIerSv1GetTPRateProfile,
+ &utils.TPTntID{TPid: "TP1", Tenant: "cgrates.org", ID: "RT_SPECIAL_1002"}, &reply); err != nil {
+ t.Fatal(err)
+ }
+ if !reflect.DeepEqual(tpRatePrf, reply) && !reflect.DeepEqual(revTPRatePrf, reply) {
+ t.Errorf("Expecting : %+v, \n received: %+v", utils.ToJSON(tpRatePrf), utils.ToJSON(reply))
+ }
+}
+
+func testTPRatePrfRemTPRatePrf(t *testing.T) {
+ var resp string
+ if err := tpRatePrfRPC.Call(utils.APIerSv1RemoveTPRateProfile,
+ &utils.TPTntID{TPid: "TP1", Tenant: "cgrates.org", ID: "RT_SPECIAL_1002"},
+ &resp); err != nil {
+ t.Error(err)
+ } else if resp != utils.OK {
+ t.Error("Unexpected reply returned", resp)
+ }
+}
+
+func testTPRatePrfKillEngine(t *testing.T) {
+ if err := engine.KillEngine(tpRatePrfDelay); err != nil {
+ t.Error(err)
+ }
+}
diff --git a/cmd/cgr-loader/cgr-loader.go b/cmd/cgr-loader/cgr-loader.go
old mode 100755
new mode 100644
diff --git a/cmd/cgr-migrator/cgr-migrator.go b/cmd/cgr-migrator/cgr-migrator.go
old mode 100755
new mode 100644
diff --git a/config/actionscfg.go b/config/actionscfg.go
deleted file mode 100644
index 8537bedb6..000000000
--- a/config/actionscfg.go
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
-Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments
-Copyright (C) ITsysCOM GmbH
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program. If not, see
-*/
-
-package config
-
-import "github.com/cgrates/cgrates/utils"
-
-// ActionSCfg is the configuration of ActionS
-type ActionSCfg struct {
- Enabled bool
- CDRsConns []string
- EEsConns []string
- ThresholdSConns []string
- StatSConns []string
- AccountSConns []string
- Tenants *[]string
- IndexedSelects bool
- StringIndexedFields *[]string
- PrefixIndexedFields *[]string
- SuffixIndexedFields *[]string
- NestedFields bool
-}
-
-func (acS *ActionSCfg) loadFromJSONCfg(jsnCfg *ActionSJsonCfg) (err error) {
- if jsnCfg == nil {
- return
- }
- if jsnCfg.Cdrs_conns != nil {
- acS.CDRsConns = make([]string, len(*jsnCfg.Cdrs_conns))
- for idx, connID := range *jsnCfg.Cdrs_conns {
- // if we have the connection internal we change the name so we can have internal rpc for each subsystem
- acS.CDRsConns[idx] = connID
- if connID == utils.MetaInternal {
- acS.CDRsConns[idx] = utils.ConcatenatedKey(utils.MetaInternal, utils.MetaCDRs)
- }
- }
- }
- if jsnCfg.Ees_conns != nil {
- acS.EEsConns = make([]string, len(*jsnCfg.Ees_conns))
- for idx, connID := range *jsnCfg.Ees_conns {
- // if we have the connection internal we change the name so we can have internal rpc for each subsystem
- acS.EEsConns[idx] = connID
- if connID == utils.MetaInternal {
- acS.EEsConns[idx] = utils.ConcatenatedKey(utils.MetaInternal, utils.MetaEEs)
- }
- }
- }
- if jsnCfg.Thresholds_conns != nil {
- acS.ThresholdSConns = make([]string, len(*jsnCfg.Thresholds_conns))
- for idx, connID := range *jsnCfg.Thresholds_conns {
- // if we have the connection internal we change the name so we can have internal rpc for each subsystem
- acS.ThresholdSConns[idx] = connID
- if connID == utils.MetaInternal {
- acS.ThresholdSConns[idx] = utils.ConcatenatedKey(utils.MetaInternal, utils.MetaThresholds)
- }
- }
- }
- if jsnCfg.Stats_conns != nil {
- acS.StatSConns = make([]string, len(*jsnCfg.Stats_conns))
- for idx, connID := range *jsnCfg.Stats_conns {
- // if we have the connection internal we change the name so we can have internal rpc for each subsystem
- acS.StatSConns[idx] = connID
- if connID == utils.MetaInternal {
- acS.StatSConns[idx] = utils.ConcatenatedKey(utils.MetaInternal, utils.MetaStats)
- }
- }
- }
- if jsnCfg.Accounts_conns != nil {
- acS.AccountSConns = make([]string, len(*jsnCfg.Accounts_conns))
- for idx, connID := range *jsnCfg.Accounts_conns {
- // if we have the connection internal we change the name so we can have internal rpc for each subsystem
- acS.AccountSConns[idx] = connID
- if connID == utils.MetaInternal {
- acS.AccountSConns[idx] = utils.ConcatenatedKey(utils.MetaInternal, utils.MetaAccounts)
- }
- }
- }
- if jsnCfg.Enabled != nil {
- acS.Enabled = *jsnCfg.Enabled
- }
- if jsnCfg.Tenants != nil {
- tnt := make([]string, len(*jsnCfg.Tenants))
- for i, fID := range *jsnCfg.Tenants {
- tnt[i] = fID
- }
- acS.Tenants = &tnt
- }
- if jsnCfg.Indexed_selects != nil {
- acS.IndexedSelects = *jsnCfg.Indexed_selects
- }
- if jsnCfg.String_indexed_fields != nil {
- sif := make([]string, len(*jsnCfg.String_indexed_fields))
- for i, fID := range *jsnCfg.String_indexed_fields {
- sif[i] = fID
- }
- acS.StringIndexedFields = &sif
- }
- if jsnCfg.Prefix_indexed_fields != nil {
- pif := make([]string, len(*jsnCfg.Prefix_indexed_fields))
- for i, fID := range *jsnCfg.Prefix_indexed_fields {
- pif[i] = fID
- }
- acS.PrefixIndexedFields = &pif
- }
- if jsnCfg.Suffix_indexed_fields != nil {
- sif := make([]string, len(*jsnCfg.Suffix_indexed_fields))
- for i, fID := range *jsnCfg.Suffix_indexed_fields {
- sif[i] = fID
- }
- acS.SuffixIndexedFields = &sif
- }
- if jsnCfg.Nested_fields != nil {
- acS.NestedFields = *jsnCfg.Nested_fields
- }
- return
-}
-
-// AsMapInterface returns the config as a map[string]interface{}
-func (acS *ActionSCfg) AsMapInterface() (initialMP map[string]interface{}) {
- initialMP = map[string]interface{}{
- utils.EnabledCfg: acS.Enabled,
- utils.IndexedSelectsCfg: acS.IndexedSelects,
- utils.NestedFieldsCfg: acS.NestedFields,
- }
- if acS.CDRsConns != nil {
- CDRsConns := make([]string, len(acS.CDRsConns))
- for i, item := range acS.CDRsConns {
- CDRsConns[i] = item
- if item == utils.ConcatenatedKey(utils.MetaInternal, utils.MetaCDRs) {
- CDRsConns[i] = utils.MetaInternal
- }
- }
- initialMP[utils.CDRsConnsCfg] = CDRsConns
- }
- if acS.ThresholdSConns != nil {
- threshSConns := make([]string, len(acS.ThresholdSConns))
- for i, item := range acS.ThresholdSConns {
- threshSConns[i] = item
- if item == utils.ConcatenatedKey(utils.MetaInternal, utils.MetaThresholds) {
- threshSConns[i] = utils.MetaInternal
- }
- }
- initialMP[utils.ThresholdSConnsCfg] = threshSConns
- }
- if acS.StatSConns != nil {
- statSConns := make([]string, len(acS.StatSConns))
- for i, item := range acS.StatSConns {
- statSConns[i] = item
- if item == utils.ConcatenatedKey(utils.MetaInternal, utils.MetaStats) {
- statSConns[i] = utils.MetaInternal
- }
- }
- initialMP[utils.StatSConnsCfg] = statSConns
- }
- if acS.AccountSConns != nil {
- accountSConns := make([]string, len(acS.AccountSConns))
- for i, item := range acS.AccountSConns {
- accountSConns[i] = item
- if item == utils.ConcatenatedKey(utils.MetaInternal, utils.MetaAccounts) {
- accountSConns[i] = utils.MetaInternal
- }
- }
- initialMP[utils.AccountSConnsCfg] = accountSConns
- }
- if acS.EEsConns != nil {
- eesConns := make([]string, len(acS.EEsConns))
- for i, item := range acS.EEsConns {
- eesConns[i] = item
- if item == utils.ConcatenatedKey(utils.MetaInternal, utils.MetaEEs) {
- eesConns[i] = utils.MetaInternal
- }
- }
- initialMP[utils.EEsConnsCfg] = eesConns
- }
- if acS.Tenants != nil {
- Tenants := make([]string, len(*acS.Tenants))
- for i, item := range *acS.Tenants {
- Tenants[i] = item
- }
- initialMP[utils.Tenants] = Tenants
- }
- if acS.StringIndexedFields != nil {
- stringIndexedFields := make([]string, len(*acS.StringIndexedFields))
- for i, item := range *acS.StringIndexedFields {
- stringIndexedFields[i] = item
- }
- initialMP[utils.StringIndexedFieldsCfg] = stringIndexedFields
- }
- if acS.PrefixIndexedFields != nil {
- prefixIndexedFields := make([]string, len(*acS.PrefixIndexedFields))
- for i, item := range *acS.PrefixIndexedFields {
- prefixIndexedFields[i] = item
- }
- initialMP[utils.PrefixIndexedFieldsCfg] = prefixIndexedFields
- }
- if acS.SuffixIndexedFields != nil {
- suffixIndexedFields := make([]string, len(*acS.SuffixIndexedFields))
- for i, item := range *acS.SuffixIndexedFields {
- suffixIndexedFields[i] = item
- }
- initialMP[utils.SuffixIndexedFieldsCfg] = suffixIndexedFields
- }
- return
-}
-
-// Clone returns a deep copy of ActionSCfg
-func (acS ActionSCfg) Clone() (cln *ActionSCfg) {
- cln = &ActionSCfg{
- Enabled: acS.Enabled,
- IndexedSelects: acS.IndexedSelects,
- NestedFields: acS.NestedFields,
- }
- if acS.CDRsConns != nil {
- cln.CDRsConns = make([]string, len(acS.CDRsConns))
- for i, con := range acS.CDRsConns {
- cln.CDRsConns[i] = con
- }
- }
- if acS.ThresholdSConns != nil {
- cln.ThresholdSConns = make([]string, len(acS.ThresholdSConns))
- for i, con := range acS.ThresholdSConns {
- cln.ThresholdSConns[i] = con
- }
- }
- if acS.StatSConns != nil {
- cln.StatSConns = make([]string, len(acS.StatSConns))
- for i, con := range acS.StatSConns {
- cln.StatSConns[i] = con
- }
- }
- if acS.AccountSConns != nil {
- cln.AccountSConns = make([]string, len(acS.AccountSConns))
- for i, con := range acS.AccountSConns {
- cln.AccountSConns[i] = con
- }
- }
- if acS.EEsConns != nil {
- cln.EEsConns = make([]string, len(acS.EEsConns))
- for i, k := range acS.EEsConns {
- cln.EEsConns[i] = k
- }
- }
- if acS.Tenants != nil {
- tnt := make([]string, len(*acS.Tenants))
- for i, dx := range *acS.Tenants {
- tnt[i] = dx
- }
- cln.Tenants = &tnt
- }
- if acS.StringIndexedFields != nil {
- idx := make([]string, len(*acS.StringIndexedFields))
- for i, dx := range *acS.StringIndexedFields {
- idx[i] = dx
- }
- cln.StringIndexedFields = &idx
- }
- if acS.PrefixIndexedFields != nil {
- idx := make([]string, len(*acS.PrefixIndexedFields))
- for i, dx := range *acS.PrefixIndexedFields {
- idx[i] = dx
- }
- cln.PrefixIndexedFields = &idx
- }
- if acS.SuffixIndexedFields != nil {
- idx := make([]string, len(*acS.SuffixIndexedFields))
- for i, dx := range *acS.SuffixIndexedFields {
- idx[i] = dx
- }
- cln.SuffixIndexedFields = &idx
- }
- return
-}
diff --git a/config/actionscfg_test.go b/config/actionscfg_test.go
deleted file mode 100644
index ab8e6126e..000000000
--- a/config/actionscfg_test.go
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
-Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments
-Copyright (C) ITsysCOM GmbH
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program. If not, see
-*/
-
-package config
-
-import (
- "reflect"
- "testing"
-
- "github.com/cgrates/cgrates/utils"
-)
-
-func TestActionSCfgLoadFromJSONCfg(t *testing.T) {
- jsonCfg := &ActionSJsonCfg{
- Enabled: utils.BoolPointer(true),
- Ees_conns: &[]string{utils.MetaInternal},
- Cdrs_conns: &[]string{utils.MetaInternal},
- Thresholds_conns: &[]string{utils.MetaInternal},
- Stats_conns: &[]string{utils.MetaInternal},
- Accounts_conns: &[]string{utils.MetaInternal},
- Indexed_selects: utils.BoolPointer(false),
- Tenants: &[]string{"itsyscom.com"},
- String_indexed_fields: &[]string{"*req.index1"},
- Prefix_indexed_fields: &[]string{"*req.index1", "*req.index2"},
- Suffix_indexed_fields: &[]string{"*req.index1"},
- Nested_fields: utils.BoolPointer(true),
- }
- expected := &ActionSCfg{
- Enabled: true,
- EEsConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaEEs)},
- CDRsConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaCDRs)},
- ThresholdSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaThresholds)},
- StatSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaStats)},
- AccountSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaAccounts)},
- IndexedSelects: false,
- Tenants: &[]string{"itsyscom.com"},
- StringIndexedFields: &[]string{"*req.index1"},
- PrefixIndexedFields: &[]string{"*req.index1", "*req.index2"},
- SuffixIndexedFields: &[]string{"*req.index1"},
- NestedFields: true,
- }
- jsnCfg := NewDefaultCGRConfig()
- if err = jsnCfg.actionSCfg.loadFromJSONCfg(jsonCfg); err != nil {
- t.Error(err)
- } else if !reflect.DeepEqual(expected, jsnCfg.actionSCfg) {
- t.Errorf("\nExpecting <%+v>,\n Received <%+v>", utils.ToJSON(expected), utils.ToJSON(jsnCfg.actionSCfg))
- }
-}
-
-func TestActionSCfgAsMapInterface(t *testing.T) {
- cfgJSONStr := `{
-"actions": {
- "enabled": true,
- "cdrs_conns": ["*internal"],
- "ees_conns": ["*internal"],
- "thresholds_conns": ["*internal"],
- "stats_conns": ["*internal"],
- "accounts_conns": ["*internal"],
- "tenants": ["itsyscom.com"],
- "indexed_selects": false,
- "string_indexed_fields": ["*req.index1"],
- "prefix_indexed_fields": ["*req.index1","*req.index2"],
- "suffix_indexed_fields": ["*req.index1"],
- "nested_fields": true,
- },
-}`
-
- eMap := map[string]interface{}{
- utils.EnabledCfg: true,
- utils.EEsConnsCfg: []string{utils.MetaInternal},
- utils.ThresholdSConnsCfg: []string{utils.MetaInternal},
- utils.StatSConnsCfg: []string{utils.MetaInternal},
- utils.CDRsConnsCfg: []string{utils.MetaInternal},
- utils.AccountSConnsCfg: []string{utils.MetaInternal},
- utils.Tenants: []string{"itsyscom.com"},
- utils.IndexedSelectsCfg: false,
- utils.StringIndexedFieldsCfg: []string{"*req.index1"},
- utils.PrefixIndexedFieldsCfg: []string{"*req.index1", "*req.index2"},
- utils.SuffixIndexedFieldsCfg: []string{"*req.index1"},
- utils.NestedFieldsCfg: true,
- }
- if cgrCfg, err := NewCGRConfigFromJSONStringWithDefaults(cfgJSONStr); err != nil {
- t.Error(err)
- } else if rcv := cgrCfg.actionSCfg.AsMapInterface(); !reflect.DeepEqual(eMap, rcv) {
- t.Errorf("Expected: %+v\n Received: %+v", utils.ToJSON(eMap), utils.ToJSON(rcv))
- }
-}
-
-func TestActionSCfgClone(t *testing.T) {
- ban := &ActionSCfg{
- Enabled: true,
- EEsConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaEEs)},
- CDRsConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaCDRs)},
- ThresholdSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaThresholds)},
- StatSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaStats)},
- AccountSConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaAccounts)},
- Tenants: &[]string{"itsyscom.com"},
- IndexedSelects: false,
- StringIndexedFields: &[]string{"*req.index1"},
- PrefixIndexedFields: &[]string{"*req.index1", "*req.index2"},
- SuffixIndexedFields: &[]string{"*req.index1"},
- NestedFields: true,
- }
- rcv := ban.Clone()
- if !reflect.DeepEqual(ban, rcv) {
- t.Errorf("\nExpected: %+v\nReceived: %+v", utils.ToJSON(ban), utils.ToJSON(rcv))
- }
- if (*rcv.Tenants)[0] = utils.EmptyString; (*ban.Tenants)[0] != "itsyscom.com" {
- t.Errorf("Expected clone to not modify the cloned")
- }
- if (*rcv.StringIndexedFields)[0] = utils.EmptyString; (*ban.StringIndexedFields)[0] != "*req.index1" {
- t.Errorf("Expected clone to not modify the cloned")
- }
- if (*rcv.PrefixIndexedFields)[0] = utils.EmptyString; (*ban.PrefixIndexedFields)[0] != "*req.index1" {
- t.Errorf("Expected clone to not modify the cloned")
- }
- if (*rcv.SuffixIndexedFields)[0] = utils.EmptyString; (*ban.SuffixIndexedFields)[0] != "*req.index1" {
- t.Errorf("Expected clone to not modify the cloned")
- }
- if rcv.EEsConns[0] = utils.EmptyString; ban.EEsConns[0] != utils.ConcatenatedKey(utils.MetaInternal, utils.MetaEEs) {
- t.Errorf("Expected clone to not modify the cloned")
- }
- if rcv.CDRsConns[0] = utils.EmptyString; ban.CDRsConns[0] != utils.ConcatenatedKey(utils.MetaInternal, utils.MetaCDRs) {
- t.Errorf("Expected clone to not modify the cloned")
- }
- if rcv.ThresholdSConns[0] = utils.EmptyString; ban.ThresholdSConns[0] != utils.ConcatenatedKey(utils.MetaInternal, utils.MetaThresholds) {
- t.Errorf("Expected clone to not modify the cloned")
- }
- if rcv.StatSConns[0] = utils.EmptyString; ban.StatSConns[0] != utils.ConcatenatedKey(utils.MetaInternal, utils.MetaStats) {
- t.Errorf("Expected clone to not modify the cloned")
- }
- if rcv.AccountSConns[0] = utils.EmptyString; ban.AccountSConns[0] != utils.ConcatenatedKey(utils.MetaInternal, utils.MetaAccounts) {
- t.Errorf("Expected clone to not modify the cloned")
- }
-}
diff --git a/config/config.go b/config/config.go
index 1bc9d506b..c390aa48c 100644
--- a/config/config.go
+++ b/config/config.go
@@ -198,7 +198,6 @@ func newCGRConfig(config []byte) (cfg *CGRConfig, err error) {
cfg.eesCfg = new(EEsCfg)
cfg.eesCfg.Cache = make(map[string]*CacheParamCfg)
cfg.rateSCfg = new(RateSCfg)
- cfg.actionSCfg = new(ActionSCfg)
cfg.sipAgentCfg = new(SIPAgentCfg)
cfg.configSCfg = new(ConfigSCfg)
cfg.apiBanCfg = new(APIBanCfg)
@@ -334,7 +333,6 @@ type CGRConfig struct {
ersCfg *ERsCfg // EventReader config
eesCfg *EEsCfg // EventExporter config
rateSCfg *RateSCfg // RateS config
- actionSCfg *ActionSCfg // ActionS config
sipAgentCfg *SIPAgentCfg // SIPAgent config
configSCfg *ConfigSCfg // ConfigS config
apiBanCfg *APIBanCfg // APIBan config
@@ -410,7 +408,7 @@ func (cfg *CGRConfig) loadFromJSONCfg(jsnCfg *CgrJsonCfg) (err error) {
cfg.loadLoaderCgrCfg, cfg.loadMigratorCgrCfg, cfg.loadTLSCgrCfg,
cfg.loadAnalyzerCgrCfg, cfg.loadApierCfg, cfg.loadErsCfg, cfg.loadEesCfg,
cfg.loadRateSCfg, cfg.loadSIPAgentCfg, cfg.loadRegistrarCCfg,
- cfg.loadConfigSCfg, cfg.loadAPIBanCgrCfg, cfg.loadCoreSCfg, cfg.loadActionSCfg,
+ cfg.loadConfigSCfg, cfg.loadAPIBanCgrCfg, cfg.loadCoreSCfg,
cfg.loadAccountSCfg} {
if err = loadFunc(jsnCfg); err != nil {
return
@@ -857,15 +855,6 @@ func (cfg *CGRConfig) loadConfigSCfg(jsnCfg *CgrJsonCfg) (err error) {
return cfg.configSCfg.loadFromJSONCfg(jsnConfigSCfg)
}
-// loadActionSCfg loads the ActionS section of the configuration
-func (cfg *CGRConfig) loadActionSCfg(jsnCfg *CgrJsonCfg) (err error) {
- var jsnActionCfg *ActionSJsonCfg
- if jsnActionCfg, err = jsnCfg.ActionSCfgJson(); err != nil {
- return
- }
- return cfg.actionSCfg.loadFromJSONCfg(jsnActionCfg)
-}
-
// loadAccountSCfg loads the AccountS section of the configuration
func (cfg *CGRConfig) loadAccountSCfg(jsnCfg *CgrJsonCfg) (err error) {
var jsnActionCfg *AccountSJsonCfg
@@ -1139,13 +1128,6 @@ func (cfg *CGRConfig) RateSCfg() *RateSCfg {
return cfg.rateSCfg
}
-// ActionSCfg reads the ActionS configuration
-func (cfg *CGRConfig) ActionSCfg() *ActionSCfg {
- cfg.lks[ActionSJson].RLock()
- defer cfg.lks[ActionSJson].RUnlock()
- return cfg.actionSCfg
-}
-
// AccountSCfg reads the AccountS configuration
func (cfg *CGRConfig) AccountSCfg() *AccountSCfg {
cfg.lks[AccountSCfgJson].RLock()
@@ -1307,7 +1289,6 @@ func (cfg *CGRConfig) getLoadFunctions() map[string]func(*CgrJsonCfg) error {
ConfigSJson: cfg.loadConfigSCfg,
APIBanCfgJson: cfg.loadAPIBanCgrCfg,
CoreSCfgJson: cfg.loadCoreSCfg,
- ActionSJson: cfg.loadActionSCfg,
AccountSCfgJson: cfg.loadAccountSCfg,
}
}
@@ -1471,7 +1452,7 @@ func (cfg *CGRConfig) reloadSections(sections ...string) {
RALS_JSN, CDRS_JSN, SessionSJson, ATTRIBUTE_JSN,
ChargerSCfgJson, RESOURCES_JSON, STATS_JSON, THRESHOLDS_JSON,
RouteSJson, LoaderJson, DispatcherSJson, RateSJson, ApierS, AccountSCfgJson,
- ActionSJson})
+ })
subsystemsThatNeedStorDB := utils.NewStringSet([]string{STORDB_JSN, RALS_JSN, CDRS_JSN, ApierS})
needsDataDB := false
needsStorDB := false
@@ -1564,8 +1545,6 @@ func (cfg *CGRConfig) reloadSections(sections ...string) {
cfg.rldChans[RegistrarCJson] <- struct{}{}
case AccountSCfgJson:
cfg.rldChans[AccountSCfgJson] <- struct{}{}
- case ActionSJson:
- cfg.rldChans[ActionSJson] <- struct{}{}
}
}
}
@@ -1616,7 +1595,6 @@ func (cfg *CGRConfig) AsMapInterface(separator string) (mp map[string]interface{
TemplatesJson: cfg.templates.AsMapInterface(separator),
ConfigSJson: cfg.configSCfg.AsMapInterface(),
CoreSCfgJson: cfg.coreSCfg.AsMapInterface(),
- ActionSJson: cfg.actionSCfg.AsMapInterface(),
AccountSCfgJson: cfg.accountSCfg.AsMapInterface(),
}
}
@@ -1780,8 +1758,6 @@ func (cfg *CGRConfig) V1GetConfig(args *SectionWithAPIOpts, reply *map[string]in
mp = cfg.RateSCfg().AsMapInterface()
case CoreSCfgJson:
mp = cfg.CoreSCfg().AsMapInterface()
- case ActionSJson:
- mp = cfg.ActionSCfg().AsMapInterface()
case AccountSCfgJson:
mp = cfg.AccountSCfg().AsMapInterface()
default:
@@ -2049,7 +2025,6 @@ func (cfg *CGRConfig) Clone() (cln *CGRConfig) {
configSCfg: cfg.configSCfg.Clone(),
apiBanCfg: cfg.apiBanCfg.Clone(),
coreSCfg: cfg.coreSCfg.Clone(),
- actionSCfg: cfg.actionSCfg.Clone(),
accountSCfg: cfg.accountSCfg.Clone(),
cacheDP: make(map[string]utils.MapStorage),
diff --git a/config/config_defaults.go b/config/config_defaults.go
index 4d84f0d69..af40a84ba 100644
--- a/config/config_defaults.go
+++ b/config/config_defaults.go
@@ -107,7 +107,6 @@ const CGRATES_CFG_JSON = `
"*charger_profiles": {"remote":false, "replicate":false},
"*dispatcher_profiles":{"remote":false, "replicate":false},
"*dispatcher_hosts":{"remote":false, "replicate":false},
- "*action_profiles":{"remote":false, "replicate":false},
"*load_ids":{"remote":false, "replicate":false},
"*indexes":{"remote":false, "replicate":false},
},
@@ -166,7 +165,6 @@ const CGRATES_CFG_JSON = `
"*versions": {"remote":false, "replicate":false},
"*tp_dispatcher_profiles":{"remote":false, "replicate":false},
"*tp_dispatcher_hosts":{"remote":false, "replicate":false},
- "*tp_action_profiles":{"remote":false, "replicate":false},
},
},
@@ -255,7 +253,6 @@ const CGRATES_CFG_JSON = `
"*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
"*dispatcher_hosts": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false, "replicate": false}, // control dispatcher hosts caching
- "*action_profiles": {"limit": -1, "ttl": "", "static_ttl": false, "precache": false, "replicate": false}, // control action profile caching
"*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
@@ -263,7 +260,6 @@ const CGRATES_CFG_JSON = `
"*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
- "*action_profile_filter_indexes" : {"limit": -1, "ttl": "", "static_ttl": false, "replicate": false}, // control action profile filter indexes caching
"*reverse_filter_indexes" : {"limit": -1, "ttl": "", "static_ttl": false, "replicate": false}, // control reverse filter indexes caching used only for set and remove filters
"*dispatcher_routes": {"limit": -1, "ttl": "", "static_ttl": false, "replicate": false}, // control dispatcher routes caching
"*dispatcher_loads": {"limit": -1, "ttl": "", "static_ttl": false, "replicate": false}, // control dispatcher load( in case of *ratio ConnParams is present)
@@ -307,7 +303,6 @@ const CGRATES_CFG_JSON = `
"*tp_chargers":{"limit": -1, "ttl": "", "static_ttl": false, "replicate": false},
"*tp_dispatcher_profiles":{"limit": -1, "ttl": "", "static_ttl": false, "replicate": false},
"*tp_dispatcher_hosts":{"limit": -1, "ttl": "", "static_ttl": false, "replicate": false},
- "*tp_action_profiles":{"limit": -1, "ttl": "", "static_ttl": false, "replicate": false},
},
"replication_conns": [],
},
@@ -793,28 +788,6 @@ const CGRATES_CFG_JSON = `
{"tag": "TLS", "path": "TLS", "type": "*variable", "value": "~*req.4"},
],
},
- {
- "type": "*action_profiles", // data source type
- "file_name": "ActionProfiles.csv", // file name in the tp_in_dir
- "fields": [
- {"tag": "Tenant", "path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true},
- {"tag": "ID", "path": "ID", "type": "*variable", "value": "~*req.1", "mandatory": true},
- {"tag": "FilterIDs", "path": "FilterIDs", "type": "*variable", "value": "~*req.2"},
- {"tag": "ActivationInterval", "path": "ActivationInterval", "type": "*variable", "value": "~*req.3"},
- {"tag": "Weight", "path": "Weight", "type": "*variable", "value": "~*req.4"},
- {"tag": "Schedule", "path": "Schedule", "type": "*variable", "value": "~*req.5"},
- {"tag": "TargetType", "path": "TargetType", "type": "*variable", "value": "~*req.6"},
- {"tag": "TargetIDs", "path": "TargetIDs", "type": "*variable", "value": "~*req.7"},
- {"tag": "ActionID", "path": "ActionID", "type": "*variable", "value": "~*req.8"},
- {"tag": "ActionFilterIDs", "path": "ActionFilterIDs", "type": "*variable", "value": "~*req.9"},
- {"tag": "ActionBlocker", "path": "ActionBlocker", "type": "*variable", "value": "~*req.10"},
- {"tag": "ActionTTL", "path": "ActionTTL", "type": "*variable", "value": "~*req.11"},
- {"tag": "ActionType", "path": "ActionType", "type": "*variable", "value": "~*req.12"},
- {"tag": "ActionOpts", "path": "ActionOpts", "type": "*variable", "value": "~*req.13"},
- {"tag": "ActionPath", "path": "ActionPath", "type": "*variable", "value": "~*req.14"},
- {"tag": "ActionValue", "path": "ActionValue", "type": "*variable", "value": "~*req.15"},
- ],
- },
],
},
],
@@ -1075,20 +1048,6 @@ const CGRATES_CFG_JSON = `
},
-"actions": { // ActionS config
- "enabled": false, // starts attribute service:
- "cdrs_conns": [], // connections to CDRs for CDR posting <""|*internal|$rpc_conns_id>
- "ees_conns": [], // connections to Ees for exporting event <""|*internal|$rpc_conns_id>
- "thresholds_conns": [], // connections to ThresholdS for *reset_threshold action <""|*internal|$rpc_conns_id>
- "stats_conns": [], // connections to StatS for *reset_stat_queue action: <""|*internal|$rpc_conns_id>
- "accounts_conns": [], // connections to AccountS for *topup/*topup_reset action: <""|*internal|$rpc_conns_id>
- "tenants":[], // List of tenants to operate on
- "indexed_selects": true, // enable profile matching exclusively on indexes
- //"string_indexed_fields": [], // query indexes based on these fields for faster processing
- "prefix_indexed_fields": [], // query indexes based on these fields for faster processing
- "suffix_indexed_fields": [], // query indexes based on these fields for faster processing
- "nested_fields": false, // determines which field is checked when matching indexed filters(true: all; false: only the one on the first level)
-},
"accounts": { // AccountS config
diff --git a/config/config_json.go b/config/config_json.go
index a869c6d14..7c2857a6f 100644
--- a/config/config_json.go
+++ b/config/config_json.go
@@ -60,7 +60,6 @@ const (
ERsJson = "ers"
EEsJson = "ees"
RateSJson = "rates"
- ActionSJson = "actions"
RPCConnsJsonName = "rpc_conns"
SIPAgentJson = "sip_agent"
TemplatesJson = "templates"
@@ -76,7 +75,7 @@ var (
KamailioAgentJSN, DA_JSN, RA_JSN, HttpAgentJson, DNSAgentJson, ATTRIBUTE_JSN, ChargerSCfgJson, RESOURCES_JSON, STATS_JSON,
THRESHOLDS_JSON, RouteSJson, LoaderJson, MAILER_JSN, SURETAX_JSON, CgrLoaderCfgJson, CgrMigratorCfgJson, DispatcherSJson,
AnalyzerCfgJson, ApierS, EEsJson, RateSJson, SIPAgentJson, RegistrarCJson, TemplatesJson, ConfigSJson, APIBanCfgJson, CoreSCfgJson,
- ActionSJson, AccountSCfgJson}
+ AccountSCfgJson}
)
// Loads the json config out of io.Reader, eg other sources than file, maybe over http
@@ -587,18 +586,6 @@ func (jsnCfg CgrJsonCfg) CoreSCfgJson() (*CoreSJsonCfg, error) {
return cfg, nil
}
-func (jsnCfg CgrJsonCfg) ActionSCfgJson() (*ActionSJsonCfg, error) {
- rawCfg, hasKey := jsnCfg[ActionSJson]
- if !hasKey {
- return nil, nil
- }
- cfg := new(ActionSJsonCfg)
- if err := json.Unmarshal(*rawCfg, cfg); err != nil {
- return nil, err
- }
- return cfg, nil
-}
-
func (jsnCfg CgrJsonCfg) AccountSCfgJson() (*AccountSJsonCfg, error) {
rawCfg, hasKey := jsnCfg[AccountSCfgJson]
if !hasKey {
diff --git a/config/config_json_test.go b/config/config_json_test.go
index 2b53bf96d..d6d5c4cc2 100644
--- a/config/config_json_test.go
+++ b/config/config_json_test.go
@@ -2144,29 +2144,3 @@ func TestDfTemplateSJsonCfg(t *testing.T) {
t.Errorf("Expected: %+v \n,received: %+v", utils.ToJSON(eCfg), utils.ToJSON(cfg))
}
}
-
-func TestDfActionSJsonCfg(t *testing.T) {
- eCfg := &ActionSJsonCfg{
- Enabled: utils.BoolPointer(false),
- Cdrs_conns: &[]string{},
- Ees_conns: &[]string{},
- Thresholds_conns: &[]string{},
- Stats_conns: &[]string{},
- Accounts_conns: &[]string{},
- Tenants: &[]string{},
- Indexed_selects: utils.BoolPointer(true),
- String_indexed_fields: nil,
- Prefix_indexed_fields: &[]string{},
- Suffix_indexed_fields: &[]string{},
- Nested_fields: utils.BoolPointer(false),
- }
- dfCgrJSONCfg, err := NewCgrJsonCfgFromBytes([]byte(CGRATES_CFG_JSON))
- if err != nil {
- t.Error(err)
- }
- if cfg, err := dfCgrJSONCfg.ActionSCfgJson(); err != nil {
- t.Error(err)
- } else if !reflect.DeepEqual(eCfg, cfg) {
- t.Errorf("\n Expected <%+v>,\nReceived:<%+v>", utils.ToJSON(eCfg), utils.ToJSON(cfg))
- }
-}
diff --git a/config/config_test.go b/config/config_test.go
index ecb53dc60..cd83fb5ea 100644
--- a/config/config_test.go
+++ b/config/config_test.go
@@ -5882,69 +5882,6 @@ func TestCGRConfigClone(t *testing.T) {
}
}
-func TestActionSConfig(t *testing.T) {
- expected := &ActionSCfg{
- Enabled: false,
- EEsConns: []string{},
- CDRsConns: []string{},
- ThresholdSConns: []string{},
- StatSConns: []string{},
- AccountSConns: []string{},
- IndexedSelects: true,
- Tenants: &[]string{},
- StringIndexedFields: nil,
- PrefixIndexedFields: &[]string{},
- SuffixIndexedFields: &[]string{},
- NestedFields: false,
- }
- cgrConfig := NewDefaultCGRConfig()
- newConfig := cgrConfig.ActionSCfg()
- if !reflect.DeepEqual(expected, newConfig) {
- t.Errorf("Expected %+v \n, received %+v", utils.ToJSON(expected), utils.ToJSON(newConfig))
- }
-}
-
-func TestV1GetConfigSectionActionSJson(t *testing.T) {
- var reply map[string]interface{}
- expected := map[string]interface{}{
- ActionSJson: map[string]interface{}{
- utils.EnabledCfg: false,
- utils.EEsConnsCfg: []string{},
- utils.CDRsConnsCfg: []string{},
- utils.ThresholdSConnsCfg: []string{},
- utils.StatSConnsCfg: []string{},
- utils.AccountSConnsCfg: []string{},
- utils.Tenants: []string{},
- utils.IndexedSelectsCfg: true,
- utils.PrefixIndexedFieldsCfg: []string{},
- utils.SuffixIndexedFieldsCfg: []string{},
- utils.NestedFieldsCfg: false,
- },
- }
- cfgCgr := NewDefaultCGRConfig()
- if err := cfgCgr.V1GetConfig(&SectionWithAPIOpts{Section: ActionSJson}, &reply); err != nil {
- t.Error(err)
- } else if !reflect.DeepEqual(reply, expected) {
- t.Errorf("Expected %+v \n, received %+v", utils.ToJSON(expected), utils.ToJSON(reply))
- }
-}
-
-func TestLoadActionSCfgError(t *testing.T) {
- cfgJSONStr := `{
- "actions": {
- "string_indexed_fields": "*req.index",
- }
- }`
- expected := "json: cannot unmarshal string into Go struct field ActionSJsonCfg.String_indexed_fields of type []string"
- cgrConfig := NewDefaultCGRConfig()
-
- if cgrCfgJSON, err := NewCgrJsonCfgFromBytes([]byte(cfgJSONStr)); err != nil {
- t.Error(err)
- } else if err := cgrConfig.loadActionSCfg(cgrCfgJSON); err == nil || err.Error() != expected {
- t.Errorf("Expected %+v, received %+v", expected, err)
- }
-}
-
func TestLoadAccountSCfgError(t *testing.T) {
cfgJSONStr := `{
"accounts": {
diff --git a/config/libconfig_json.go b/config/libconfig_json.go
index 2b9910885..a8306c653 100644
--- a/config/libconfig_json.go
+++ b/config/libconfig_json.go
@@ -670,22 +670,6 @@ type CoreSJsonCfg struct {
Shutdown_timeout *string
}
-// Action service config section
-type ActionSJsonCfg struct {
- Enabled *bool
- Cdrs_conns *[]string
- Ees_conns *[]string
- Thresholds_conns *[]string
- Stats_conns *[]string
- Accounts_conns *[]string
- Tenants *[]string
- Indexed_selects *bool
- String_indexed_fields *[]string
- Prefix_indexed_fields *[]string
- Suffix_indexed_fields *[]string
- Nested_fields *bool // applies when indexed fields is not defined
-}
-
// Account service config section
type AccountSJsonCfg struct {
Enabled *bool
diff --git a/console/filter_indexes.go b/console/filter_indexes.go
old mode 100755
new mode 100644
diff --git a/console/loader_load.go b/console/loader_load.go
old mode 100755
new mode 100644
diff --git a/console/loader_remove.go b/console/loader_remove.go
old mode 100755
new mode 100644
diff --git a/console/ratingprofile.go b/console/ratingprofile.go
old mode 100755
new mode 100644
diff --git a/console/thresholds_for_event.go b/console/thresholds_for_event.go
old mode 100755
new mode 100644
diff --git a/data/conf/samples/dispatchers/all/cgrates.json b/data/conf/samples/dispatchers/all/cgrates.json
index 5deaeda75..02cfa4a13 100644
--- a/data/conf/samples/dispatchers/all/cgrates.json
+++ b/data/conf/samples/dispatchers/all/cgrates.json
@@ -77,9 +77,6 @@
},
-"actions": {
- "enabled": true,
-},
"accounts": {
diff --git a/data/conf/samples/dispatchers/all2/cgrates.json b/data/conf/samples/dispatchers/all2/cgrates.json
index 4af540d6d..fe8245501 100644
--- a/data/conf/samples/dispatchers/all2/cgrates.json
+++ b/data/conf/samples/dispatchers/all2/cgrates.json
@@ -72,9 +72,6 @@
},
-"actions": {
- "enabled": true,
-},
"accounts": {
diff --git a/data/conf/samples/dispatchers/all2_mongo/cgrates.json b/data/conf/samples/dispatchers/all2_mongo/cgrates.json
index 32adb4199..92e4582fe 100644
--- a/data/conf/samples/dispatchers/all2_mongo/cgrates.json
+++ b/data/conf/samples/dispatchers/all2_mongo/cgrates.json
@@ -76,9 +76,6 @@
},
-"actions": {
- "enabled": true,
-},
"accounts": {
diff --git a/data/conf/samples/dispatchers/all2_mysql/cgrates.json b/data/conf/samples/dispatchers/all2_mysql/cgrates.json
index e98944993..de4a6a9bb 100644
--- a/data/conf/samples/dispatchers/all2_mysql/cgrates.json
+++ b/data/conf/samples/dispatchers/all2_mysql/cgrates.json
@@ -73,9 +73,6 @@
},
-"actions": {
- "enabled": true,
-},
"accounts": {
diff --git a/data/conf/samples/dispatchers/all_mongo/cgrates.json b/data/conf/samples/dispatchers/all_mongo/cgrates.json
index 1cd4bce13..23672246e 100644
--- a/data/conf/samples/dispatchers/all_mongo/cgrates.json
+++ b/data/conf/samples/dispatchers/all_mongo/cgrates.json
@@ -80,9 +80,6 @@
},
-"actions": {
- "enabled": true,
-},
"accounts": {
diff --git a/data/conf/samples/dispatchers/all_mysql/cgrates.json b/data/conf/samples/dispatchers/all_mysql/cgrates.json
index dff4f6f38..9b5ee99aa 100644
--- a/data/conf/samples/dispatchers/all_mysql/cgrates.json
+++ b/data/conf/samples/dispatchers/all_mysql/cgrates.json
@@ -78,9 +78,6 @@
},
-"actions": {
- "enabled": true,
-},
"accounts": {
diff --git a/data/conf/samples/filtered_replication/engine1_mongo/cgrates.json b/data/conf/samples/filtered_replication/engine1_mongo/cgrates.json
index adc663554..864d82b91 100644
--- a/data/conf/samples/filtered_replication/engine1_mongo/cgrates.json
+++ b/data/conf/samples/filtered_replication/engine1_mongo/cgrates.json
@@ -52,7 +52,6 @@
"*dispatcher_hosts":{"remote":true,"replicate":false},
"*load_ids":{"remote":true,"replicate":false},
"*indexes":{"remote":true, "replicate":false},
- "*action_profiles":{"remote":true,"replicate":false},
},
},
diff --git a/data/conf/samples/filtered_replication/engine1_redis/cgrates.json b/data/conf/samples/filtered_replication/engine1_redis/cgrates.json
index deebb3b39..e7ca4a1f8 100644
--- a/data/conf/samples/filtered_replication/engine1_redis/cgrates.json
+++ b/data/conf/samples/filtered_replication/engine1_redis/cgrates.json
@@ -51,7 +51,7 @@
"*dispatcher_hosts":{"remote":true,"replicate":false},
"*load_ids":{"remote":true,"replicate":false},
"*indexes":{"remote":true, "replicate":false},
- "*action_profiles":{"remote":true,"replicate":false},
+ "*files":{"remote":true,"replicate":false},
},
},
diff --git a/data/conf/samples/filtered_replication/engine2_mongo/cgrates.json b/data/conf/samples/filtered_replication/engine2_mongo/cgrates.json
index 48e75b22c..898e26a89 100644
--- a/data/conf/samples/filtered_replication/engine2_mongo/cgrates.json
+++ b/data/conf/samples/filtered_replication/engine2_mongo/cgrates.json
@@ -52,7 +52,6 @@
"*dispatcher_hosts":{"remote":true,"replicate":false},
"*load_ids":{"remote":true,"replicate":false},
"*indexes":{"remote":true, "replicate":false},
- "*action_profiles":{"remote":true,"replicate":false},
},
},
diff --git a/data/conf/samples/filtered_replication/engine2_redis/cgrates.json b/data/conf/samples/filtered_replication/engine2_redis/cgrates.json
index 560a3827e..e7811f40f 100644
--- a/data/conf/samples/filtered_replication/engine2_redis/cgrates.json
+++ b/data/conf/samples/filtered_replication/engine2_redis/cgrates.json
@@ -52,7 +52,6 @@
"*dispatcher_hosts":{"remote":true,"replicate":false},
"*load_ids":{"remote":true,"replicate":false},
"*indexes":{"remote":true, "replicate":false},
- "*action_profiles":{"remote":true,"replicate":false},
},
},
diff --git a/data/conf/samples/filtered_replication/internal/cgrates.json b/data/conf/samples/filtered_replication/internal/cgrates.json
index 8b13eeac1..86653c708 100644
--- a/data/conf/samples/filtered_replication/internal/cgrates.json
+++ b/data/conf/samples/filtered_replication/internal/cgrates.json
@@ -53,7 +53,6 @@
"*dispatcher_hosts":{"remote":false,"replicate":true},
"*indexes" :{"remote":false,"replicate":true},
"*load_ids":{"remote":false,"replicate":true},
- "*action_profiles":{"remote":false,"replicate":true},
},
},
diff --git a/data/conf/samples/full_remote/internal/cgrates.json b/data/conf/samples/full_remote/internal/cgrates.json
index c72b845cb..ddf825fa7 100644
--- a/data/conf/samples/full_remote/internal/cgrates.json
+++ b/data/conf/samples/full_remote/internal/cgrates.json
@@ -43,7 +43,6 @@
"*charger_profiles": {"limit":0 },
"*dispatcher_profiles": {"limit":0 },
"*dispatcher_hosts": {"limit":0 },
- "*action_profiles": {"limit":0 },
"*resource_filter_indexes" : {"limit":0},
"*stat_filter_indexes" : {"limit":0},
"*threshold_filter_indexes" : {"limit":0},
@@ -51,7 +50,6 @@
"*attribute_filter_indexes" : {"limit":0},
"*charger_filter_indexes" : {"limit":0},
"*dispatcher_filter_indexes" : {"limit":0},
- "*action_profile_filter_indexes" : {"limit":0},
"*reverse_filter_indexes" : {"limit":0},
"*dispatcher_routes": {"limit":0},
"*dispatcher_loads": {"limit":0},
@@ -85,7 +83,6 @@
"*route_profiles":{"remote":true,"replicate":false},
"*attribute_profiles":{"remote":true,"replicate":false},
"*charger_profiles": {"remote":true,"replicate":false},
- "*action_profiles":{"remote":true,"replicate":false},
"*dispatcher_profiles":{"remote":true,"replicate":false},
"*dispatcher_hosts":{"remote":true,"replicate":false},
"*load_ids":{"remote":true,"replicate":false},
diff --git a/data/conf/samples/registrarc/registrarc_rpc_mongo/cgrates.json b/data/conf/samples/registrarc/registrarc_rpc_mongo/cgrates.json
index 140cebb48..d7f78dab1 100644
--- a/data/conf/samples/registrarc/registrarc_rpc_mongo/cgrates.json
+++ b/data/conf/samples/registrarc/registrarc_rpc_mongo/cgrates.json
@@ -127,10 +127,6 @@
},
-"actions": {
- "enabled": true,
- "accounts_conns": ["*localhost"]
-},
"accounts": {
diff --git a/data/conf/samples/registrarc/registrarc_rpc_mysql/cgrates.json b/data/conf/samples/registrarc/registrarc_rpc_mysql/cgrates.json
index 5e44367dd..423180adb 100644
--- a/data/conf/samples/registrarc/registrarc_rpc_mysql/cgrates.json
+++ b/data/conf/samples/registrarc/registrarc_rpc_mysql/cgrates.json
@@ -124,10 +124,6 @@
},
-"actions": {
- "enabled": true,
- "accounts_conns": ["*localhost"]
-},
"accounts": {
diff --git a/data/conf/samples/tutinternal/cgrates.json b/data/conf/samples/tutinternal/cgrates.json
index fdbec58d4..e96318af1 100644
--- a/data/conf/samples/tutinternal/cgrates.json
+++ b/data/conf/samples/tutinternal/cgrates.json
@@ -110,10 +110,6 @@
},
-"actions": {
- "enabled": true,
- "accounts_conns": ["*localhost"]
-},
"accounts": {
diff --git a/data/conf/samples/tutmongo/cgrates.json b/data/conf/samples/tutmongo/cgrates.json
index 914cc46ff..25c17889f 100644
--- a/data/conf/samples/tutmongo/cgrates.json
+++ b/data/conf/samples/tutmongo/cgrates.json
@@ -125,12 +125,6 @@
},
-"actions": {
- "enabled": true,
- "accounts_conns": ["*localhost"]
-},
-
-
"accounts": {
"enabled": true
},
diff --git a/data/conf/samples/tutmongojson/cgrates.json b/data/conf/samples/tutmongojson/cgrates.json
index 699bf98ef..e47709162 100644
--- a/data/conf/samples/tutmongojson/cgrates.json
+++ b/data/conf/samples/tutmongojson/cgrates.json
@@ -121,10 +121,6 @@
},
- "actions": {
- "enabled": true
- },
-
"accounts": {
"enabled": true
diff --git a/data/conf/samples/tutmysql/cgrates.json b/data/conf/samples/tutmysql/cgrates.json
index 422b140e1..48f4f51de 100644
--- a/data/conf/samples/tutmysql/cgrates.json
+++ b/data/conf/samples/tutmysql/cgrates.json
@@ -117,12 +117,6 @@
},
-"actions": {
- "enabled": true,
- "accounts_conns": ["*localhost"]
-},
-
-
"accounts": {
"enabled": true
},
diff --git a/data/storage/mysql/create_tariffplan_tables.sql b/data/storage/mysql/create_tariffplan_tables.sql
index be33255b8..3f107e045 100644
--- a/data/storage/mysql/create_tariffplan_tables.sql
+++ b/data/storage/mysql/create_tariffplan_tables.sql
@@ -469,38 +469,6 @@ CREATE TABLE tp_dispatcher_hosts (
`id`,`address`)
);
---
--- Table structure for table `tp_action_profiles`
---
-
-
-DROP TABLE IF EXISTS tp_action_profiles;
-CREATE TABLE tp_action_profiles (
- `pk` int(11) NOT NULL AUTO_INCREMENT,
- `tpid` varchar(64) NOT NULL,
- `tenant` varchar(64) NOT NULL,
- `id` varchar(64) NOT NULL,
- `filter_ids` varchar(64) NOT NULL,
- `activation_interval` varchar(64) NOT NULL,
- `weight` decimal(8,2) NOT NULL,
- `schedule` varchar(64) NOT NULL,
- `target_type` varchar(64) NOT NULL,
- `target_ids` varchar(64) NOT NULL,
- `action_id` varchar(64) NOT NULL,
- `action_filter_ids` varchar(64) NOT NULL,
- `action_blocker` BOOLEAN NOT NULL,
- `action_ttl` varchar(64) NOT NULL,
- `action_type` varchar(64) NOT NULL,
- `action_opts` varchar(256) NOT NULL,
- `action_path` varchar(64) NOT NULL,
- `action_value` varchar(64) NOT NULL,
- `created_at` TIMESTAMP,
- PRIMARY KEY (`pk`),
- KEY `tpid` (`tpid`),
- UNIQUE KEY `unique_tp_action_profiles` (`tpid`,`tenant`,
- `id`,`filter_ids`,`action_id` )
-);
-
--
-- Table structure for table `versions`
--
diff --git a/data/storage/postgres/create_tariffplan_tables.sql b/data/storage/postgres/create_tariffplan_tables.sql
index fb504fdb1..7b8f36257 100644
--- a/data/storage/postgres/create_tariffplan_tables.sql
+++ b/data/storage/postgres/create_tariffplan_tables.sql
@@ -456,37 +456,6 @@ CREATE INDEX tp_routes_unique ON tp_routes ("tpid", "tenant", "id",
"address");
---
--- Table structure for table `tp_action_profiles`
---
-
-
-DROP TABLE IF EXISTS tp_action_profiles;
-CREATE TABLE tp_action_profiles (
- "pk" SERIAL PRIMARY KEY,
- "tpid" varchar(64) NOT NULL,
- "tenant" varchar(64) NOT NULL,
- "id" varchar(64) NOT NULL,
- "filter_ids" varchar(64) NOT NULL,
- "activation_interval" varchar(64) NOT NULL,
- "weight" decimal(8,2) NOT NULL,
- "schedule" varchar(64) NOT NULL,
- "target_type" varchar(64) NOT NULL,
- "target_ids" varchar(64) NOT NULL,
- "action_id" varchar(64) NOT NULL,
- "action_filter_ids" varchar(64) NOT NULL,
- "action_blocker" BOOLEAN NOT NULL,
- "action_ttl" varchar(64) NOT NULL,
- "action_type" varchar(64) NOT NULL,
- "action_opts" varchar(256) NOT NULL,
- "action_path" varchar(64) NOT NULL,
- "action_value" varchar(64) NOT NULL,
- "created_at" TIMESTAMP WITH TIME ZONE
- );
- CREATE INDEX tp_action_profiles_ids ON tp_action_profiles (tpid);
- CREATE INDEX tp_action_profiles_unique ON tp_action_profiles ("tpid", "tenant", "id",
- "filter_ids", "action_id");
-
--
-- Table structure for table `versions`
diff --git a/data/tariffplans/dispatchers/Attributes.csv b/data/tariffplans/dispatchers/Attributes.csv
index 1ba3aee50..bbabcc02a 100644
--- a/data/tariffplans/dispatchers/Attributes.csv
+++ b/data/tariffplans/dispatchers/Attributes.csv
@@ -20,7 +20,7 @@ cgrates.org,ATTR_API_PSE_AUTH,*auth,*string:~*req.ApiKey:pse12345,,,*req.APIMeth
cgrates.org,ATTR_API_CFG_AUTH,*auth,*string:~*req.ApiKey:cfg12345,,,*req.APIMethods,*constant,ConfigSv1.GetConfig&ConfigSv1.ReloadConfig,false,20
cgrates.org,ATTR_API_APIER_AUTH,*auth,*string:~*req.ApiKey:apier12345,,,*req.APIMethods,*constant,APIerSv1.GetAttributeProfile&APIerSv1.SetAttributeProfile,false,20
cgrates.org,ATTR_API_RALS_AUTH,*auth,*string:~*req.ApiKey:rals12345,,,*req.APIMethods,*constant,RALsV1.Ping&RALsV1.GetRatingPlansCost,false,20
-cgrates.org,ATTR_API_REPLICATOR_AUTH,*auth,*string:~*req.ApiKey:repl12345,,,*req.APIMethods,*constant,ReplicatorSv1.Ping&ReplicatorSv1.GetAccount&ReplicatorSv1.SetAccount&ReplicatorSv1.RemoveAccount&ReplicatorSv1.GetRouteProfile&ReplicatorSv1.SetRouteProfile&ReplicatorSv1.RemoveRouteProfile&ReplicatorSv1.GetAttributeProfile&ReplicatorSv1.SetAttributeProfile&ReplicatorSv1.RemoveAttributeProfile&ReplicatorSv1.SetChargerProfile&ReplicatorSv1.GetChargerProfile&ReplicatorSv1.RemoveChargerProfile&ReplicatorSv1.GetDispatcherProfile&ReplicatorSv1.SetDispatcherProfile&ReplicatorSv1.RemoveDispatcherProfile&ReplicatorSv1.GetDispatcherHost&ReplicatorSv1.SetDispatcherHost&ReplicatorSv1.RemoveDispatcherHost&ReplicatorSv1.GetFilter&ReplicatorSv1.SetFilter&ReplicatorSv1.RemoveFilter&ReplicatorSv1.GetThreshold&ReplicatorSv1.SetThreshold&ReplicatorSv1.RemoveThreshold&ReplicatorSv1.GetStatQueue&ReplicatorSv1.SetStatQueue&ReplicatorSv1.RemoveStatQueue&ReplicatorSv1.GetResource&ReplicatorSv1.SetResource&ReplicatorSv1.RemoveResource&ReplicatorSv1.GetResourceProfile&ReplicatorSv1.SetResourceProfile&ReplicatorSv1.RemoveResourceProfile&ReplicatorSv1.GetStatQueueProfile&ReplicatorSv1.SetStatQueueProfile&ReplicatorSv1.RemoveStatQueueProfile&ReplicatorSv1.GetThresholdProfile&ReplicatorSv1.SetThresholdProfile&ReplicatorSv1.RemoveThresholdProfile&ReplicatorSv1.GetTiming&ReplicatorSv1.SetTiming&ReplicatorSv1.RemoveTiming&ReplicatorSv1.GetActionTriggers&ReplicatorSv1.SetActionTriggers&ReplicatorSv1.RemoveActionTriggers&ReplicatorSv1.SetSharedGroup&ReplicatorSv1.GetSharedGroup&ReplicatorSv1.RemoveSharedGroup&ReplicatorSv1.SetActions&ReplicatorSv1.GetActions&ReplicatorSv1.RemoveActions&ReplicatorSv1.SetActionPlan&ReplicatorSv1.GetActionPlan&ReplicatorSv1.RemoveActionPlan&ReplicatorSv1.SetAccountActionPlans&ReplicatorSv1.GetAccountActionPlans&ReplicatorSv1.RemAccountActionPlans&ReplicatorSv1.SetRatingPlan&ReplicatorSv1.GetRatingPlan&ReplicatorSv1.RemoveRatingPlan&ReplicatorSv1.SetRatingProfile&ReplicatorSv1.GetRatingProfile&ReplicatorSv1.RemoveRatingProfile&ReplicatorSv1.SetDestination&ReplicatorSv1.GetDestination&ReplicatorSv1.RemoveDestination&ReplicatorSv1.SetLoadIDs&ReplicatorSv1.GetItemLoadIDs&ReplicatorSv1.SetRateProfile&ReplicatorSv1.GetRateProfile&ReplicatorSv1.RemoveRateProfile&ReplicatorSv1.SetActionProfile&ReplicatorSv1.GetActionProfile&ReplicatorSv1.RemoveActionProfile,false,20
+cgrates.org,ATTR_API_REPLICATOR_AUTH,*auth,*string:~*req.ApiKey:repl12345,,,*req.APIMethods,*constant,ReplicatorSv1.Ping&ReplicatorSv1.GetAccount&ReplicatorSv1.SetAccount&ReplicatorSv1.RemoveAccount&ReplicatorSv1.GetRouteProfile&ReplicatorSv1.SetRouteProfile&ReplicatorSv1.RemoveRouteProfile&ReplicatorSv1.GetAttributeProfile&ReplicatorSv1.SetAttributeProfile&ReplicatorSv1.RemoveAttributeProfile&ReplicatorSv1.SetChargerProfile&ReplicatorSv1.GetChargerProfile&ReplicatorSv1.RemoveChargerProfile&ReplicatorSv1.GetDispatcherProfile&ReplicatorSv1.SetDispatcherProfile&ReplicatorSv1.RemoveDispatcherProfile&ReplicatorSv1.GetDispatcherHost&ReplicatorSv1.SetDispatcherHost&ReplicatorSv1.RemoveDispatcherHost&ReplicatorSv1.GetFilter&ReplicatorSv1.SetFilter&ReplicatorSv1.RemoveFilter&ReplicatorSv1.GetThreshold&ReplicatorSv1.SetThreshold&ReplicatorSv1.RemoveThreshold&ReplicatorSv1.GetStatQueue&ReplicatorSv1.SetStatQueue&ReplicatorSv1.RemoveStatQueue&ReplicatorSv1.GetResource&ReplicatorSv1.SetResource&ReplicatorSv1.RemoveResource&ReplicatorSv1.GetResourceProfile&ReplicatorSv1.SetResourceProfile&ReplicatorSv1.RemoveResourceProfile&ReplicatorSv1.GetStatQueueProfile&ReplicatorSv1.SetStatQueueProfile&ReplicatorSv1.RemoveStatQueueProfile&ReplicatorSv1.GetThresholdProfile&ReplicatorSv1.SetThresholdProfile&ReplicatorSv1.RemoveThresholdProfile&ReplicatorSv1.GetTiming&ReplicatorSv1.SetTiming&ReplicatorSv1.RemoveTiming&ReplicatorSv1.GetActionTriggers&ReplicatorSv1.SetActionTriggers&ReplicatorSv1.RemoveActionTriggers&ReplicatorSv1.SetSharedGroup&ReplicatorSv1.GetSharedGroup&ReplicatorSv1.RemoveSharedGroup&ReplicatorSv1.SetActions&ReplicatorSv1.GetActions&ReplicatorSv1.RemoveActions&ReplicatorSv1.SetActionPlan&ReplicatorSv1.GetActionPlan&ReplicatorSv1.RemoveActionPlan&ReplicatorSv1.SetAccountActionPlans&ReplicatorSv1.GetAccountActionPlans&ReplicatorSv1.RemAccountActionPlans&ReplicatorSv1.SetRatingPlan&ReplicatorSv1.GetRatingPlan&ReplicatorSv1.RemoveRatingPlan&ReplicatorSv1.SetRatingProfile&ReplicatorSv1.GetRatingProfile&ReplicatorSv1.RemoveRatingProfile&ReplicatorSv1.SetDestination&ReplicatorSv1.GetDestination&ReplicatorSv1.RemoveDestination&ReplicatorSv1.SetLoadIDs&ReplicatorSv1.GetItemLoadIDs,false,20
cgrates.org,ATTR_API_CDRSV2,*auth,*string:~*req.ApiKey:cdrsv212345,,,*req.APIMethods,*constant,CDRsV2.ProcessEvent&CDRsV2.StoreSessionCost,false,20
cgrates.org,ATTR_API_RATES_AUTH,*auth,*string:~*req.ApiKey:rPrf12345,,,*req.APIMethods,*constant,RateSv1.Ping&RateSv1.CostForEvent,false,20
cgrates.org,ATTR_API_CORE_AUTH,*auth,*string:~*req.ApiKey:core12345,,,*req.APIMethods,*constant,CoreSv1.Status&CoreSv1.Ping&CoreSv1.Sleep,false,20
diff --git a/dispatchers/attributes.go b/dispatchers/attributes.go
old mode 100755
new mode 100644
diff --git a/dispatchers/attributes_it_test.go b/dispatchers/attributes_it_test.go
old mode 100755
new mode 100644
diff --git a/dispatchers/chargers.go b/dispatchers/chargers.go
old mode 100755
new mode 100644
diff --git a/dispatchers/chargers_it_test.go b/dispatchers/chargers_it_test.go
old mode 100755
new mode 100644
diff --git a/dispatchers/dispatchers.go b/dispatchers/dispatchers.go
old mode 100755
new mode 100644
diff --git a/dispatchers/resources.go b/dispatchers/resources.go
old mode 100755
new mode 100644
diff --git a/dispatchers/resources_it_test.go b/dispatchers/resources_it_test.go
old mode 100755
new mode 100644
diff --git a/dispatchers/routes.go b/dispatchers/routes.go
old mode 100755
new mode 100644
diff --git a/dispatchers/routes_it_test.go b/dispatchers/routes_it_test.go
old mode 100755
new mode 100644
diff --git a/dispatchers/sessions.go b/dispatchers/sessions.go
old mode 100755
new mode 100644
diff --git a/dispatchers/sessions_it_test.go b/dispatchers/sessions_it_test.go
old mode 100755
new mode 100644
diff --git a/dispatchers/stats.go b/dispatchers/stats.go
old mode 100755
new mode 100644
diff --git a/dispatchers/stats_it_test.go b/dispatchers/stats_it_test.go
old mode 100755
new mode 100644
diff --git a/dispatchers/thresholds.go b/dispatchers/thresholds.go
old mode 100755
new mode 100644
diff --git a/dispatchers/thresholds_it_test.go b/dispatchers/thresholds_it_test.go
old mode 100755
new mode 100644
diff --git a/dispatchers/utils.go b/dispatchers/utils.go
old mode 100755
new mode 100644
diff --git a/engine/chargers_test.go b/engine/chargers_test.go
old mode 100755
new mode 100644
diff --git a/engine/libeventcost_test.go b/engine/libeventcost_test.go
old mode 100755
new mode 100644
diff --git a/engine/route_highestcost.go b/engine/route_highestcost.go
old mode 100755
new mode 100644
diff --git a/engine/route_qos.go b/engine/route_qos.go
old mode 100755
new mode 100644
diff --git a/engine/route_weight.go b/engine/route_weight.go
old mode 100755
new mode 100644
diff --git a/engine/storage_mongo_datadb.go b/engine/storage_mongo_datadb.go
index fe6176753..16b7c66c6 100644
--- a/engine/storage_mongo_datadb.go
+++ b/engine/storage_mongo_datadb.go
@@ -76,7 +76,6 @@ const (
ColCpp = "charger_profiles"
ColDpp = "dispatcher_profiles"
ColDph = "dispatcher_hosts"
- ColApp = "action_profiles"
ColLID = "load_ids"
)
@@ -636,13 +635,6 @@ func (ms *MongoStorage) GetKeysForPrefix(prefix string) (result []string, err er
result, err = ms.getField2(sctx, ColCpp, utils.ChargerProfilePrefix, subject, tntID)
case utils.DispatcherProfilePrefix:
result, err = ms.getField2(sctx, ColDpp, utils.DispatcherProfilePrefix, subject, tntID)
-<<<<<<< HEAD
- case utils.ActionProfilePrefix:
- result, err = ms.getField2(sctx, ColApp, utils.ActionProfilePrefix, subject, tntID)
-=======
- case utils.AccountProfilePrefix:
- result, err = ms.getField2(sctx, ColAnp, utils.AccountProfilePrefix, subject, tntID)
->>>>>>> Removing ActionS
case utils.DispatcherHostPrefix:
result, err = ms.getField2(sctx, ColDph, utils.DispatcherHostPrefix, subject, tntID)
case utils.AttributeFilterIndexes:
@@ -661,11 +653,6 @@ func (ms *MongoStorage) GetKeysForPrefix(prefix string) (result []string, err er
result, err = ms.getField3(sctx, ColIndx, utils.DispatcherFilterIndexes, "key")
case utils.ActionPlanIndexes:
result, err = ms.getField3(sctx, ColIndx, utils.ActionPlanIndexes, "key")
-<<<<<<< HEAD
-=======
- case utils.AccountProfileFilterIndexPrfx:
- result, err = ms.getField3(sctx, ColIndx, utils.AccountProfileFilterIndexPrfx, "key")
->>>>>>> Removing ActionS
case utils.FilterIndexPrfx:
result, err = ms.getField3(sctx, ColIndx, utils.FilterIndexPrfx, "key")
default:
@@ -716,13 +703,6 @@ func (ms *MongoStorage) HasDataDrv(category, subject, tenant string) (has bool,
count, err = ms.getCol(ColDpp).CountDocuments(sctx, bson.M{"tenant": tenant, "id": subject})
case utils.DispatcherHostPrefix:
count, err = ms.getCol(ColDph).CountDocuments(sctx, bson.M{"tenant": tenant, "id": subject})
-<<<<<<< HEAD
- case utils.ActionProfilePrefix:
- count, err = ms.getCol(ColApp).CountDocuments(sctx, bson.M{"tenant": tenant, "id": subject})
-=======
- case utils.AccountProfilePrefix:
- count, err = ms.getCol(ColAnp).CountDocuments(sctx, bson.M{"tenant": tenant, "id": subject})
->>>>>>> Removing ActionS
default:
err = fmt.Errorf("unsupported category in HasData: %s", category)
}
diff --git a/engine/z_stordb_it_test.go b/engine/z_stordb_it_test.go
index 4ea831fae..eaed7bcad 100644
--- a/engine/z_stordb_it_test.go
+++ b/engine/z_stordb_it_test.go
@@ -587,7 +587,7 @@ func testStorDBitCRUDTPAttributes(t *testing.T) {
},
}
if err := storDB.SetTPAttributes(tpAProfile); err != nil {
- t.Errorf("Unable to set TPActionProfile:%s", err)
+ t.Errorf("Unable to set TPAttributeProfile:%s", err)
}
//READ
diff --git a/general_tests/sentinel_it_test.go b/general_tests/sentinel_it_test.go
old mode 100755
new mode 100644
diff --git a/general_tests/tls_it_test.go b/general_tests/tls_it_test.go
old mode 100755
new mode 100644
diff --git a/general_tests/tutorial_calls_test.go b/general_tests/tutorial_calls_test.go
old mode 100755
new mode 100644
diff --git a/loaders/loader_it_test.go b/loaders/loader_it_test.go
index bb6d4b22e..756a5c34c 100644
--- a/loaders/loader_it_test.go
+++ b/loaders/loader_it_test.go
@@ -20,7 +20,6 @@ along with this program. If not, see
package loaders
import (
- "fmt"
"io"
"net/rpc"
"os"
@@ -50,8 +49,6 @@ var (
testLoaderStartEngine,
testLoaderRPCConn,
testLoaderPopulateData,
- testLoaderMoveFilesMatchingFiles,
- testLoaderMoveFilesRenameError,
testProcessFile,
testProcessFileLockFolder,
testProcessFileUnableToOpen,
@@ -411,58 +408,6 @@ func testLoaderVerifyOutDirForCustomSep(t *testing.T) {
}
}
-func testLoaderMoveFilesMatchingFiles(t *testing.T) {
- flPath := "/tmp/TestLoaderMoveFilesMatchingFiles"
- ldr := &Loader{
- tpInDir: flPath,
- tpOutDir: "/tmp",
- lockFilename: "ActionProfiles.csv",
- }
- if err := os.MkdirAll(flPath, 0777); err != nil {
- t.Error(err)
- }
- newFile, err := os.Create(path.Join(flPath, "ActionProfiles.csv"))
- if err != nil {
- t.Error(err)
- }
- newFile.Close()
-
- if err := ldr.moveFiles(); err != nil {
- t.Error(err)
- }
-
- if err := os.Remove(path.Join(flPath, "ActionProfiles.csv")); err != nil {
- t.Error(err)
- } else if err := os.Remove(flPath); err != nil {
- t.Error(err)
- }
-}
-
-func testLoaderMoveFilesRenameError(t *testing.T) {
- flPath := "/tmp/testLoaderMoveFilesRenameError"
- if err := os.MkdirAll(flPath, 0777); err != nil {
- t.Error(err)
- }
- ldr := &Loader{
- tpInDir: flPath,
- tpOutDir: flPath,
- lockFilename: "ActionProfiles.lks",
- }
- filepath := path.Join(flPath, "ActionProfiles")
- if err := os.MkdirAll(filepath, 0777); err != nil {
- t.Error(err)
- }
-
- expected := fmt.Sprintf("rename %s %s: file exists", filepath, filepath)
- if err := ldr.moveFiles(); err == nil || err.Error() != expected {
- t.Errorf("Expected %+v, received %+v", expected, err)
- }
-
- if err := os.Remove(filepath); err != nil {
- t.Error(err)
- }
-}
-
func testProcessFile(t *testing.T) {
flPath := "/tmp/testProcessFile"
if err := os.MkdirAll(flPath, 0777); err != nil {
diff --git a/loaders/loader_test.go b/loaders/loader_test.go
index 847bbe914..cb9cc355f 100644
--- a/loaders/loader_test.go
+++ b/loaders/loader_test.go
@@ -1513,148 +1513,6 @@ func TestNewLoaderWithMultiFiles(t *testing.T) {
}
}
-func TestLoaderWrongCsv(t *testing.T) {
- data := engine.NewInternalDB(nil, nil, true)
- ldr := &Loader{
- ldrID: "TestLoaderWrongCsv",
- bufLoaderData: make(map[string][]LoaderData),
- dm: engine.NewDataManager(data, config.CgrConfig().CacheCfg(), nil),
- timezone: "UTC",
- }
- ldr.dataTpls = map[string][]*config.FCTemplate{
- utils.MetaAttributeProfiles: {
- {Tag: "Tenant",
- Path: "Tenant",
- Type: utils.MetaVariable,
- Value: config.NewRSRParsersMustCompile("~*req.0", utils.InfieldSep),
- Mandatory: true,
- Layout: time.RFC3339},
- {Tag: "ID",
- Path: "ID",
- Type: utils.MetaVariable,
- Value: config.NewRSRParsersMustCompile("~*req.1", utils.InfieldSep),
- Mandatory: true,
- Layout: time.RFC3339},
- {Tag: "FilterIDs",
- Path: "FilterIDs",
- Type: utils.MetaVariable,
- Value: config.NewRSRParsersMustCompile("~*req.2", utils.InfieldSep),
- Layout: time.RFC3339},
- {Tag: "ActivationInterval",
- Path: "ActivationInterval",
- Type: utils.MetaVariable,
- Value: config.NewRSRParsersMustCompile("~*req.3", utils.InfieldSep),
- Layout: time.RFC3339},
- {Tag: "Weight",
- Path: "Weight",
- Type: utils.MetaVariable,
- Value: config.NewRSRParsersMustCompile("~*req.4", utils.InfieldSep),
- Layout: time.RFC3339},
- {Tag: "Schedule",
- Path: "Schedule",
- Type: utils.MetaVariable,
- Value: config.NewRSRParsersMustCompile("~*req.5", utils.InfieldSep),
- Layout: time.RFC3339},
- {Tag: "AccountIDs",
- Path: "AccountIDs",
- Type: utils.MetaVariable,
- Value: config.NewRSRParsersMustCompile("~*req.6", utils.InfieldSep),
- Layout: time.RFC3339},
- {Tag: "ActionID",
- Path: "ActionID",
- Type: utils.MetaVariable,
- Value: config.NewRSRParsersMustCompile("~*req.7", utils.InfieldSep),
- Layout: time.RFC3339},
- {Tag: "ActionFilterIDs",
- Path: "ActionFilterIDs",
- Type: utils.MetaVariable,
- Value: config.NewRSRParsersMustCompile("~*req.8", utils.InfieldSep),
- Layout: time.RFC3339},
- {Tag: "ActionBlocker",
- Path: "ActionBlocker",
- Type: utils.MetaVariable,
- Value: config.NewRSRParsersMustCompile("~*req.9", utils.InfieldSep),
- Layout: time.RFC3339},
- {Tag: "ActionTTL",
- Path: "ActionTTL",
- Type: utils.MetaVariable,
- Value: config.NewRSRParsersMustCompile("~*req.10", utils.InfieldSep),
- Layout: time.RFC3339},
- {Tag: "ActionType",
- Path: "ActionType",
- Type: utils.MetaVariable,
- Value: config.NewRSRParsersMustCompile("~*req.11", utils.InfieldSep),
- Layout: time.RFC3339},
- {Tag: "ActionOpts",
- Path: "ActionOpts",
- Type: utils.MetaVariable,
- Value: config.NewRSRParsersMustCompile("~*req.12", utils.InfieldSep),
- Layout: time.RFC3339},
- {Tag: "ActionPath",
- Path: "ActionPath",
- Type: utils.MetaVariable,
- Value: config.NewRSRParsersMustCompile("~*req.13", utils.InfieldSep),
- Layout: time.RFC3339},
- {Tag: "ActionValue",
- Path: "ActionValue",
- Type: utils.MetaVariable,
- Value: config.NewRSRParsersMustCompile("~*req.14", utils.InfieldSep),
- Layout: time.RFC3339},
- },
- }
-
- //Not a valid comment beginning of csv
- newCSVContentMiss := `
-//Tenant,ID,FilterIDs,ActivationInterval,Weight,Schedule,AccountIDs,ActionID,ActionFilterIDs,ActionBLocker,ActionTTL,ActionType,ActionOpts,ActionPath,ActionValue
-cgrates.org,ONE_TIME_ACT,,,10,*asap,1001;1002,TOPUP,,false,0s,*add_balance,,*balance.TestBalance.Value,10
-cgrates.org,ONE_TIME_ACT,,,,,,SET_BALANCE_TEST_DATA,,false,0s,*set_balance,,*balance.TestDataBalance.Type,*data
-cgrates.org,ONE_TIME_ACT,,,,,,TOPUP_TEST_DATA,,false,0s,*add_balance,,*balance.TestDataBalance.Value,1024
-cgrates.org,ONE_TIME_ACT,,,,,,SET_BALANCE_TEST_VOICE,,false,0s,*set_balance,,*balance.TestVoiceBalance.Type,*voice
-cgrates.org,ONE_TIME_ACT,,,,,,TOPUP_TEST_VOICE,,false,0s,*add_balance,,*balance.TestVoiceBalance.Value,15m15s
-`
-
- rdr := io.NopCloser(strings.NewReader(newCSVContentMiss))
- csvRdr := csv.NewReader(rdr)
- ldr.rdrs = map[string]map[string]*openedCSVFile{
- utils.MetaAttributeProfiles: {
- utils.AttributesCsv: &openedCSVFile{
- fileName: utils.AttributesCsv,
- rdr: rdr,
- csvRdr: csvRdr,
- },
- },
- }
- expectedErr := "invalid syntax"
- if err := ldr.processContent(utils.MetaAttributeProfiles, utils.EmptyString); err == nil || !strings.Contains(err.Error(), expectedErr) {
- t.Errorf("Expected %+q, received %+q", expectedErr, err)
- }
-
- //Missing fields in csv eg:ActionBLocker
- newCSVContent := `
-//Tenant,ID,FilterIDs,ActivationInterval,Weight,Schedule,AccountIDs,ActionID,ActionFilterIDs,ActionTTL,ActionType,ActionOpts,ActionPath,ActionValue
-cgrates.org,ONE_TIME_ACT,,,10,*asap,1001;1002,TOPUP,,false,0s,*add_balance,,*balance.TestBalance.Value,10
-cgrates.org,ONE_TIME_ACT,,,,,,SET_BALANCE_TEST_DATA,,false,0s,*set_balance,,*balance.TestDataBalance.Type,*data
-cgrates.org,ONE_TIME_ACT,,,,,,TOPUP_TEST_DATA,,false,0s,*add_balance,,*balance.TestDataBalance.Value,1024
-cgrates.org,ONE_TIME_ACT,,,,,,SET_BALANCE_TEST_VOICE,,false,0s,*set_balance,,*balance.TestVoiceBalance.Type,*voice
-cgrates.org,ONE_TIME_ACT,,,,,,TOPUP_TEST_VOICE,,false,0s,*add_balance,,*balance.TestVoiceBalance.Value,15m15s
-`
- rdr = io.NopCloser(strings.NewReader(newCSVContent))
- csvRdr = csv.NewReader(rdr)
- ldr.rdrs = map[string]map[string]*openedCSVFile{
- utils.MetaAttributeProfiles: {
- utils.AttributesCsv: &openedCSVFile{
- fileName: utils.AttributesCsv,
- rdr: rdr,
- csvRdr: csvRdr,
- },
- },
- }
- expectedErr = "invalid syntax"
- if err := ldr.processContent(utils.MetaAttributeProfiles, utils.EmptyString); err == nil || !strings.Contains(err.Error(), expectedErr) {
- t.Errorf("Expected %+q, received %+q", expectedErr, err)
- }
-}
-
func TestLoaderAttributesAsStructErrType(t *testing.T) {
data := engine.NewInternalDB(nil, nil, true)
ldr := &Loader{
diff --git a/migrator/accounts.go b/migrator/accounts.go
old mode 100755
new mode 100644
diff --git a/migrator/accounts2_it_test.go b/migrator/accounts2_it_test.go
old mode 100755
new mode 100644
diff --git a/migrator/accounts_it_test.go b/migrator/accounts_it_test.go
old mode 100755
new mode 100644
diff --git a/migrator/accounts_test.go b/migrator/accounts_test.go
old mode 100755
new mode 100644
diff --git a/migrator/attributes_it_test.go b/migrator/attributes_it_test.go
old mode 100755
new mode 100644
diff --git a/migrator/cdrs.go b/migrator/cdrs.go
old mode 100755
new mode 100644
diff --git a/migrator/cdrs_it_test.go b/migrator/cdrs_it_test.go
old mode 100755
new mode 100644
diff --git a/migrator/chargers.go b/migrator/chargers.go
old mode 100755
new mode 100644
diff --git a/migrator/chargers_it_test.go b/migrator/chargers_it_test.go
old mode 100755
new mode 100644
diff --git a/migrator/migrator.go b/migrator/migrator.go
old mode 100755
new mode 100644
diff --git a/migrator/migrator_stordb.go b/migrator/migrator_stordb.go
old mode 100755
new mode 100644
diff --git a/migrator/session_costs_it_test.go b/migrator/session_costs_it_test.go
old mode 100755
new mode 100644
diff --git a/migrator/stats_it_test.go b/migrator/stats_it_test.go
old mode 100755
new mode 100644
diff --git a/migrator/storage_map_datadb.go b/migrator/storage_map_datadb.go
old mode 100755
new mode 100644
diff --git a/migrator/storage_map_stordb.go b/migrator/storage_map_stordb.go
old mode 100755
new mode 100644
diff --git a/migrator/storage_sql.go b/migrator/storage_sql.go
old mode 100755
new mode 100644
diff --git a/migrator/tp_chargers.go b/migrator/tp_chargers.go
old mode 100755
new mode 100644
diff --git a/migrator/tp_filters_it_test.go b/migrator/tp_filters_it_test.go
old mode 100755
new mode 100644
diff --git a/services/datadb.go b/services/datadb.go
index 922ef7800..24d0f68d2 100644
--- a/services/datadb.go
+++ b/services/datadb.go
@@ -141,7 +141,7 @@ func (db *DataDBService) mandatoryDB() bool {
db.cfg.AttributeSCfg().Enabled || db.cfg.ResourceSCfg().Enabled || db.cfg.StatSCfg().Enabled ||
db.cfg.ThresholdSCfg().Enabled || db.cfg.RouteSCfg().Enabled || db.cfg.DispatcherSCfg().Enabled ||
db.cfg.LoaderCfg().Enabled() || db.cfg.ApierCfg().Enabled || db.cfg.RateSCfg().Enabled ||
- db.cfg.AccountSCfg().Enabled || db.cfg.ActionSCfg().Enabled || db.cfg.AnalyzerSCfg().Enabled
+ db.cfg.AccountSCfg().Enabled || db.cfg.AnalyzerSCfg().Enabled
}
// GetDM returns the DataManager
diff --git a/servmanager/servmanager.go b/servmanager/servmanager.go
index 93bef4fde..d7186f5da 100644
--- a/servmanager/servmanager.go
+++ b/servmanager/servmanager.go
@@ -251,8 +251,6 @@ func (srvMngr *ServiceManager) handleReload() {
go srvMngr.reloadService(utils.GlobalVarS)
case <-srvMngr.GetConfig().GetReloadChan(config.AccountSCfgJson):
go srvMngr.reloadService(utils.AccountS)
- case <-srvMngr.GetConfig().GetReloadChan(config.ActionSJson):
- go srvMngr.reloadService(utils.ActionS)
case <-srvMngr.GetConfig().GetReloadChan(config.CoreSCfgJson):
go srvMngr.reloadService(utils.CoreS)
}
diff --git a/utils/apitpdata.go b/utils/apitpdata.go
old mode 100755
new mode 100644
diff --git a/utils/consts.go b/utils/consts.go
old mode 100755
new mode 100644
index 925831351..e50851d33
--- a/utils/consts.go
+++ b/utils/consts.go
@@ -886,7 +886,6 @@ const (
StatsNA = -1.0
InvalidUsage = -1
InvalidDuration = time.Duration(-1)
- ActionS = "ActionS"
Schedule = "Schedule"
ActionFilterIDs = "ActionFilterIDs"
ActionBlocker = "ActionBlocker"
@@ -1023,7 +1022,6 @@ const (
EEsLow = "ees"
RateSLow = "rates"
AccountSLow = "accounts"
- ActionSLow = "actions"
)
// Actions