diff --git a/apier/v1/attributes.go b/apier/v1/attributes.go index c70d0b5a1..2cd4448bc 100644 --- a/apier/v1/attributes.go +++ b/apier/v1/attributes.go @@ -67,9 +67,9 @@ func (apierSv1 *APIerSv1) GetAttributeProfileIDs(args *utils.PaginatorWithTenant return nil } -// GetAttributeProfileIDsCount sets in reply var the total number of AttributeProfileIDs registered for a tenant +// GetAttributeProfileCount sets in reply var the total number of AttributeProfileIDs registered for a tenant // returns ErrNotFound in case of 0 AttributeProfileIDs -func (apierSv1 *APIerSv1) GetAttributeProfileIDsCount(args *utils.TenantWithAPIOpts, reply *int) (err error) { +func (apierSv1 *APIerSv1) GetAttributeProfileCount(args *utils.TenantWithAPIOpts, reply *int) (err error) { tnt := args.Tenant if tnt == utils.EmptyString { tnt = apierSv1.Config.GeneralCfg().DefaultTenant diff --git a/apier/v1/attributes_it_test.go b/apier/v1/attributes_it_test.go index 7c88342f6..5670bfaee 100644 --- a/apier/v1/attributes_it_test.go +++ b/apier/v1/attributes_it_test.go @@ -1281,13 +1281,13 @@ func testAttributeSProcessWithMultipleRuns2(t *testing.T) { func testAttributeSGetAttributeProfileIDsCount(t *testing.T) { var reply int - if err := attrSRPC.Call(utils.APIerSv1GetAttributeProfileIDsCount, + if err := attrSRPC.Call(utils.APIerSv1GetAttributeProfileCount, &utils.TenantWithAPIOpts{}, &reply); err != nil { t.Error(err) } else if reply != 7 { t.Errorf("Expecting: 7, received: %+v", reply) } - if err := attrSRPC.Call(utils.APIerSv1GetAttributeProfileIDsCount, + if err := attrSRPC.Call(utils.APIerSv1GetAttributeProfileCount, &utils.TenantWithAPIOpts{Tenant: "cgrates.org"}, &reply); err != nil { t.Error(err) } else if reply != 7 { @@ -1306,7 +1306,7 @@ func testAttributeSGetAttributeProfileIDsCount(t *testing.T) { } else if resp != utils.OK { t.Error("Unexpected reply returned", resp) } - if err := attrSRPC.Call(utils.APIerSv1GetAttributeProfileIDsCount, + if err := attrSRPC.Call(utils.APIerSv1GetAttributeProfileCount, &utils.TenantWithAPIOpts{Tenant: "cgrates.org"}, &reply); err != nil { t.Error(err) } else if reply != 6 { @@ -1324,7 +1324,7 @@ func testAttributeSGetAttributeProfileIDsCount(t *testing.T) { } else if resp != utils.OK { t.Error("Unexpected reply returned", resp) } - if err := attrSRPC.Call(utils.APIerSv1GetAttributeProfileIDsCount, + if err := attrSRPC.Call(utils.APIerSv1GetAttributeProfileCount, &utils.TenantWithAPIOpts{Tenant: "cgrates.org"}, &reply); err != nil { t.Error(err) } else if reply != 5 { @@ -1342,7 +1342,7 @@ func testAttributeSGetAttributeProfileIDsCount(t *testing.T) { } else if resp != utils.OK { t.Error("Unexpected reply returned", resp) } - if err := attrSRPC.Call(utils.APIerSv1GetAttributeProfileIDsCount, + if err := attrSRPC.Call(utils.APIerSv1GetAttributeProfileCount, &utils.TenantWithAPIOpts{Tenant: "cgrates.org"}, &reply); err != nil { t.Error(err) } else if reply != 4 { @@ -1360,7 +1360,7 @@ func testAttributeSGetAttributeProfileIDsCount(t *testing.T) { } else if resp != utils.OK { t.Error("Unexpected reply returned", resp) } - if err := attrSRPC.Call(utils.APIerSv1GetAttributeProfileIDsCount, + if err := attrSRPC.Call(utils.APIerSv1GetAttributeProfileCount, &utils.TenantWithAPIOpts{Tenant: "cgrates.org"}, &reply); err != nil { t.Error(err) } else if reply != 3 { @@ -1378,7 +1378,7 @@ func testAttributeSGetAttributeProfileIDsCount(t *testing.T) { } else if resp != utils.OK { t.Error("Unexpected reply returned", resp) } - if err := attrSRPC.Call(utils.APIerSv1GetAttributeProfileIDsCount, + if err := attrSRPC.Call(utils.APIerSv1GetAttributeProfileCount, &utils.TenantWithAPIOpts{Tenant: "cgrates.org"}, &reply); err != nil { t.Error(err) } else if reply != 2 { @@ -1397,7 +1397,7 @@ func testAttributeSGetAttributeProfileIDsCount(t *testing.T) { } else if resp != utils.OK { t.Error("Unexpected reply returned", resp) } - if err := attrSRPC.Call(utils.APIerSv1GetAttributeProfileIDsCount, + if err := attrSRPC.Call(utils.APIerSv1GetAttributeProfileCount, &utils.TenantWithAPIOpts{Tenant: "cgrates.org"}, &reply); err != nil { t.Error(err) } else if reply != 1 { @@ -1416,7 +1416,7 @@ func testAttributeSGetAttributeProfileIDsCount(t *testing.T) { } else if resp != utils.OK { t.Error("Unexpected reply returned", resp) } - if err := attrSRPC.Call(utils.APIerSv1GetAttributeProfileIDsCount, + if err := attrSRPC.Call(utils.APIerSv1GetAttributeProfileCount, &utils.TenantWithAPIOpts{Tenant: "cgrates.org"}, &reply); err == nil || err.Error() != utils.ErrNotFound.Error() { t.Error(err) } diff --git a/apier/v1/thresholds.go b/apier/v1/thresholds.go index a8ffc8e85..c76a06448 100644 --- a/apier/v1/thresholds.go +++ b/apier/v1/thresholds.go @@ -104,9 +104,9 @@ func (apierSv1 *APIerSv1) GetThresholdProfileIDs(args *utils.PaginatorWithTenant return nil } -// GetThresholdProfileIDsCount sets in reply var the total number of ThresholdProfileIDs registered for the received tenant +// GetThresholdProfileCount sets in reply var the total number of ThresholdProfileIDs registered for the received tenant // returns ErrNotFound in case of 0 ThresholdProfileIDs -func (apierSv1 *APIerSv1) GetThresholdProfileIDsCount(args *utils.TenantWithAPIOpts, reply *int) (err error) { +func (apierSv1 *APIerSv1) GetThresholdProfileCount(args *utils.TenantWithAPIOpts, reply *int) (err error) { tnt := args.Tenant if tnt == utils.EmptyString { tnt = apierSv1.Config.GeneralCfg().DefaultTenant @@ -158,7 +158,7 @@ func (apierSv1 *APIerSv1) RemoveThresholdProfile(args *utils.TenantIDWithAPIOpts if tnt == utils.EmptyString { tnt = apierSv1.Config.GeneralCfg().DefaultTenant } - if err := apierSv1.DataManager.RemoveThresholdProfile(tnt, args.ID, true); err != nil { + if err := apierSv1.DataManager.RemoveThresholdProfile(tnt, args.ID, true); err != nil { return utils.APIErrorHandler(err) } //handle caching for ThresholdProfile diff --git a/apier/v1/thresholds_it_test.go b/apier/v1/thresholds_it_test.go index dfff8bbcd..60c2ce1fe 100644 --- a/apier/v1/thresholds_it_test.go +++ b/apier/v1/thresholds_it_test.go @@ -823,14 +823,14 @@ func testV1TSRemThresholdProfileWithoutTenant(t *testing.T) { func testv1TSGetThresholdProfileIDsCount(t *testing.T) { var reply int - if err := tSv1Rpc.Call(utils.APIerSv1GetThresholdProfileIDsCount, + if err := tSv1Rpc.Call(utils.APIerSv1GetThresholdProfileCount, &utils.TenantWithAPIOpts{}, &reply); err != nil { t.Error(err) } else if reply != 7 { t.Errorf("Expected 7, received %+v", reply) } - if err := tSv1Rpc.Call(utils.APIerSv1GetThresholdProfileIDsCount, + if err := tSv1Rpc.Call(utils.APIerSv1GetThresholdProfileCount, &utils.TenantWithAPIOpts{Tenant: "cgrates.org"}, &reply); err != nil { t.Error(err) diff --git a/utils/consts.go b/utils/consts.go index 32a7f2ea6..9fdf2363f 100644 --- a/utils/consts.go +++ b/utils/consts.go @@ -1430,7 +1430,7 @@ const ( APIerSv1GetSharedGroup = "APIerSv1.GetSharedGroup" APIerSv1RemoveActionTrigger = "APIerSv1.RemoveActionTrigger" APIerSv1GetAccount = "APIerSv1.GetAccount" - APIerSv1GetAttributeProfileIDsCount = "APIerSv1.GetAttributeProfileIDsCount" + APIerSv1GetAttributeProfileCount = "APIerSv1.GetAttributeProfileCount" APIerSv1GetMaxUsage = "APIerSv1.GetMaxUsage" APIerSv1GetTiming = "APIerSv1.GetTiming" APIerSv1SetTiming = "APIerSv1.SetTiming" @@ -1548,17 +1548,17 @@ const ( // ThresholdS APIs const ( - ThresholdSv1ProcessEvent = "ThresholdSv1.ProcessEvent" - ThresholdSv1GetThreshold = "ThresholdSv1.GetThreshold" - ThresholdSv1ResetThreshold = "ThresholdSv1.ResetThreshold" - ThresholdSv1GetThresholdIDs = "ThresholdSv1.GetThresholdIDs" - ThresholdSv1Ping = "ThresholdSv1.Ping" - ThresholdSv1GetThresholdsForEvent = "ThresholdSv1.GetThresholdsForEvent" - APIerSv1GetThresholdProfileIDs = "APIerSv1.GetThresholdProfileIDs" - APIerSv1GetThresholdProfileIDsCount = "APIerSv1.GetThresholdProfileIDsCount" - APIerSv1GetThresholdProfile = "APIerSv1.GetThresholdProfile" - APIerSv1RemoveThresholdProfile = "APIerSv1.RemoveThresholdProfile" - APIerSv1SetThresholdProfile = "APIerSv1.SetThresholdProfile" + ThresholdSv1ProcessEvent = "ThresholdSv1.ProcessEvent" + ThresholdSv1GetThreshold = "ThresholdSv1.GetThreshold" + ThresholdSv1ResetThreshold = "ThresholdSv1.ResetThreshold" + ThresholdSv1GetThresholdIDs = "ThresholdSv1.GetThresholdIDs" + ThresholdSv1Ping = "ThresholdSv1.Ping" + ThresholdSv1GetThresholdsForEvent = "ThresholdSv1.GetThresholdsForEvent" + APIerSv1GetThresholdProfileIDs = "APIerSv1.GetThresholdProfileIDs" + APIerSv1GetThresholdProfileCount = "APIerSv1.GetThresholdProfileCount" + APIerSv1GetThresholdProfile = "APIerSv1.GetThresholdProfile" + APIerSv1RemoveThresholdProfile = "APIerSv1.RemoveThresholdProfile" + APIerSv1SetThresholdProfile = "APIerSv1.SetThresholdProfile" ) // StatS APIs