diff --git a/apier/v1/filter_indexes_it_test.go b/apier/v1/filter_indexes_it_test.go index 085073ea8..04218467d 100644 --- a/apier/v1/filter_indexes_it_test.go +++ b/apier/v1/filter_indexes_it_test.go @@ -955,7 +955,7 @@ func testV1FIdxSetRouteProfileIndexes(t *testing.T) { err.Error() != utils.ErrNotFound.Error() { t.Error(err) } - rPrf := &RouteWithOpts{ + rPrf := &RouteWithAPIOpts{ RouteProfile: &engine.RouteProfile{ Tenant: tenant, ID: "TEST_PROFILE1", @@ -1053,7 +1053,7 @@ func testV1FIdxSetSecondRouteProfileIndexes(t *testing.T) { err.Error() != utils.ErrNotFound.Error() { t.Error(err) } - rPrf := &RouteWithOpts{ + rPrf := &RouteWithAPIOpts{ RouteProfile: &engine.RouteProfile{ Tenant: tenant, ID: "TEST_PROFILE2", diff --git a/apier/v1/replicate_it_test.go b/apier/v1/replicate_it_test.go index 7bcc0cf09..7ce33a747 100644 --- a/apier/v1/replicate_it_test.go +++ b/apier/v1/replicate_it_test.go @@ -347,7 +347,7 @@ func testInternalReplicateITRouteProfile(t *testing.T) { err.Error() != utils.ErrNotFound.Error() { t.Error(err) } - rPrf := &RouteWithOpts{ + rPrf := &RouteWithAPIOpts{ RouteProfile: &engine.RouteProfile{ Tenant: "cgrates.org", ID: "TEST_PROFILE1", diff --git a/apier/v1/routes.go b/apier/v1/routes.go index 41172556a..afbbc13db 100644 --- a/apier/v1/routes.go +++ b/apier/v1/routes.go @@ -64,13 +64,13 @@ func (apierSv1 *APIerSv1) GetRouteProfileIDs(args *utils.PaginatorWithTenant, sp return nil } -type RouteWithOpts struct { +type RouteWithAPIOpts struct { *engine.RouteProfile - Opts map[string]interface{} + APIOpts map[string]interface{} } //SetRouteProfile add a new Route configuration -func (apierSv1 *APIerSv1) SetRouteProfile(args *RouteWithOpts, reply *string) error { +func (apierSv1 *APIerSv1) SetRouteProfile(args *RouteWithAPIOpts, reply *string) error { if missing := utils.MissingStructFields(args.RouteProfile, []string{utils.ID}); len(missing) != 0 { return utils.NewErrMandatoryIeMissing(missing...) } @@ -85,8 +85,8 @@ func (apierSv1 *APIerSv1) SetRouteProfile(args *RouteWithOpts, reply *string) er return utils.APIErrorHandler(err) } //handle caching for SupplierProfile - if err := apierSv1.CallCache(utils.IfaceAsString(args.Opts[utils.CacheOpt]), args.Tenant, utils.CacheRouteProfiles, - args.TenantID(), &args.FilterIDs, nil, args.Opts); err != nil { + if err := apierSv1.CallCache(utils.IfaceAsString(args.APIOpts[utils.CacheOpt]), args.Tenant, utils.CacheRouteProfiles, + args.TenantID(), &args.FilterIDs, nil, args.APIOpts); err != nil { return utils.APIErrorHandler(err) } *reply = utils.OK diff --git a/apier/v1/routes_it_test.go b/apier/v1/routes_it_test.go index e9a7ff3b0..e216e9eae 100644 --- a/apier/v1/routes_it_test.go +++ b/apier/v1/routes_it_test.go @@ -36,7 +36,7 @@ var ( routeSv1CfgPath string routeSv1Cfg *config.CGRConfig routeSv1Rpc *rpc.Client - routePrf *RouteWithOpts + routePrf *RouteWithAPIOpts routeSv1ConfDIR string //run tests for specific configuration sTestsRouteSV1 = []func(t *testing.T){ @@ -846,7 +846,7 @@ func testV1RouteGetRouteWithoutFilter(t *testing.T) { } func testV1RouteSetRouteProfiles(t *testing.T) { - routePrf = &RouteWithOpts{ + routePrf = &RouteWithAPIOpts{ RouteProfile: &engine.RouteProfile{ Tenant: "cgrates.org", ID: "TEST_PROFILE1", @@ -1108,7 +1108,7 @@ func testV1RoutesOneRouteWithoutDestination(t *testing.T) { err.Error() != utils.ErrNotFound.Error() { t.Error(err) } - routePrf = &RouteWithOpts{ + routePrf = &RouteWithAPIOpts{ RouteProfile: &engine.RouteProfile{ Tenant: "cgrates.org", ID: "ROUTE_DESTINATION", @@ -1182,7 +1182,7 @@ func testV1RouteMultipleRouteSameID(t *testing.T) { err.Error() != utils.ErrNotFound.Error() { t.Error(err) } - routePrf = &RouteWithOpts{ + routePrf = &RouteWithAPIOpts{ RouteProfile: &engine.RouteProfile{ Tenant: "cgrates.org", ID: "MULTIPLE_ROUTES", @@ -1290,7 +1290,7 @@ func testV1RouteMultipleRouteSameID(t *testing.T) { } func testV1RouteAccountWithRatingPlan(t *testing.T) { - routePrf = &RouteWithOpts{ + routePrf = &RouteWithAPIOpts{ RouteProfile: &engine.RouteProfile{ Tenant: "cgrates.org", ID: "RouteWithAccAndRP", @@ -1570,7 +1570,7 @@ func testV1RouteStopEngine(t *testing.T) { } func testV1RouteSetRouteProfilesWithoutTenant(t *testing.T) { - routePrf = &RouteWithOpts{ + routePrf = &RouteWithAPIOpts{ RouteProfile: &engine.RouteProfile{ Tenant: "cgrates.org", ID: "TEST_PROFILE10", diff --git a/console/routes_profile_set.go b/console/routes_profile_set.go index 03123b5a9..b400f4d97 100644 --- a/console/routes_profile_set.go +++ b/console/routes_profile_set.go @@ -28,7 +28,7 @@ func init() { c := &CmdSetRoute{ name: "routes_profile_set", rpcMethod: utils.APIerSv1SetRouteProfile, - rpcParams: &v1.RouteWithOpts{}, + rpcParams: &v1.RouteWithAPIOpts{}, } commands[c.Name()] = c c.CommandExecuter = &CommandExecuter{c} @@ -37,7 +37,7 @@ func init() { type CmdSetRoute struct { name string rpcMethod string - rpcParams *v1.RouteWithOpts + rpcParams *v1.RouteWithAPIOpts *CommandExecuter } @@ -51,9 +51,9 @@ func (self *CmdSetRoute) RpcMethod() string { func (self *CmdSetRoute) RpcParams(reset bool) interface{} { if reset || self.rpcParams == nil { - self.rpcParams = &v1.RouteWithOpts{ + self.rpcParams = &v1.RouteWithAPIOpts{ RouteProfile: new(engine.RouteProfile), - Opts: map[string]interface{}{}, + APIOpts: map[string]interface{}{}, } } return self.rpcParams diff --git a/general_tests/filtered_replication_it_test.go b/general_tests/filtered_replication_it_test.go index 9581e4cd8..785dd3ade 100644 --- a/general_tests/filtered_replication_it_test.go +++ b/general_tests/filtered_replication_it_test.go @@ -925,7 +925,7 @@ func testFltrRplResourceProfile(t *testing.T) { func testFltrRplRouteProfile(t *testing.T) { rpID := "RT1" - rpPrf := &v1.RouteWithOpts{ + rpPrf := &v1.RouteWithAPIOpts{ RouteProfile: &engine.RouteProfile{ Tenant: "cgrates.org", ID: rpID, diff --git a/general_tests/route_it_test.go b/general_tests/route_it_test.go index 7653d3442..c822a6242 100644 --- a/general_tests/route_it_test.go +++ b/general_tests/route_it_test.go @@ -37,7 +37,7 @@ var ( splSv1CfgPath string splSv1Cfg *config.CGRConfig splSv1Rpc *rpc.Client - splPrf *v1.RouteWithOpts + splPrf *v1.RouteWithAPIOpts splSv1ConfDIR string //run tests for specific configuration sTestsSupplierSV1 = []func(t *testing.T){ @@ -133,7 +133,7 @@ func testV1SplSSetSupplierProfilesWithoutRatingPlanIDs(t *testing.T) { err.Error() != utils.ErrNotFound.Error() { t.Error(err) } - splPrf = &v1.RouteWithOpts{ + splPrf = &v1.RouteWithAPIOpts{ RouteProfile: &engine.RouteProfile{ Tenant: "cgrates.org", ID: "TEST_PROFILE2", @@ -197,7 +197,7 @@ func testV1SplSAddNewSplPrf(t *testing.T) { t.Error(err) } //create a new Supplier Profile to test *reas and *reds sorting strategy - splPrf = &v1.RouteWithOpts{ + splPrf = &v1.RouteWithAPIOpts{ RouteProfile: &engine.RouteProfile{ Tenant: "cgrates.org", ID: "ROUTE_ResourceTest", @@ -473,7 +473,7 @@ func testV1SplSAddNewSplPrf2(t *testing.T) { t.Error(err) } //create a new Supplier Profile to test *reas and *reds sorting strategy - splPrf = &v1.RouteWithOpts{ + splPrf = &v1.RouteWithAPIOpts{ RouteProfile: &engine.RouteProfile{ Tenant: "cgrates.org", ID: "ROUTE_ResourceDescendent",