diff --git a/analyzers/analyzers_test.go b/analyzers/analyzers_test.go index 1526b1b27..52d96e96d 100644 --- a/analyzers/analyzers_test.go +++ b/analyzers/analyzers_test.go @@ -261,7 +261,7 @@ func TestAnalyzersV1Search(t *testing.T) { "RequestEncoding": "*gob", "RequestID": 3., "RequestMethod": "CoreSv1.Ping", - "RequestParams": json.RawMessage(`{"Tenant":"","ID":"","Time":null,"Event":null,"Opts":{"EventSource":"*attributes"}}`), + "RequestParams": json.RawMessage(`{"Tenant":"","ID":"","Time":null,"Event":null,"APIOpts":{"EventSource":"*attributes"}}`), "Reply": json.RawMessage(`"Pong"`), "RequestSource": "127.0.0.1:5566", "RequestStartTime": t1.Add(-24 * time.Hour).UTC().Format(time.RFC3339), @@ -299,7 +299,7 @@ func TestAnalyzersV1Search(t *testing.T) { reply = []map[string]interface{}{} if err = anz.V1StringQuery(&QueryArgs{ HeaderFilters: "RequestEncoding:*gob", - ContentFilters: []string{"*string:~*req.Opts.EventSource:*attributes"}, + ContentFilters: []string{"*string:~*req.APIOpts.EventSource:*attributes"}, }, &reply); err != nil { t.Fatal(err) } else if !reflect.DeepEqual(expRply, reply) { @@ -317,7 +317,7 @@ func TestAnalyzersV1Search(t *testing.T) { reply = []map[string]interface{}{} if err = anz.V1StringQuery(&QueryArgs{ HeaderFilters: "RequestEncoding:*gob", - ContentFilters: []string{"*string:~*opts.EventSource:*attributes"}, + ContentFilters: []string{"*string:~*req.APIOpts.EventSource:*attributes"}, }, &reply); err != nil { t.Fatal(err) } else if !reflect.DeepEqual(expRply, reply) { @@ -328,7 +328,7 @@ func TestAnalyzersV1Search(t *testing.T) { reply = []map[string]interface{}{} if err = anz.V1StringQuery(&QueryArgs{ HeaderFilters: "RequestEncoding:*gob", - ContentFilters: []string{"*string:~*req.Opts.EventSource:*cdrs"}, + ContentFilters: []string{"*string:~*req.APIOpts.EventSource:*cdrs"}, }, &reply); err != nil { t.Fatal(err) } else if !reflect.DeepEqual(expRply, reply) { @@ -336,7 +336,7 @@ func TestAnalyzersV1Search(t *testing.T) { } if err = anz.V1StringQuery(&QueryArgs{ HeaderFilters: "RequestEncoding:*gob", - ContentFilters: []string{"*notstring:~*req.Opts.EventSource:*attributes"}, + ContentFilters: []string{"*notstring:~*req.APIOpts.EventSource:*attributes"}, }, &reply); err != nil { t.Fatal(err) } else if !reflect.DeepEqual(expRply, reply) { diff --git a/apier/v1/api_interfaces.go b/apier/v1/api_interfaces.go index 0ef46233b..227b52b25 100644 --- a/apier/v1/api_interfaces.go +++ b/apier/v1/api_interfaces.go @@ -231,20 +231,20 @@ type ReplicatorSv1Interface interface { SetResource(rs *engine.ResourceWithAPIOpts, reply *string) error SetResourceProfile(rs *engine.ResourceProfileWithOpts, reply *string) error SetActionTriggers(args *engine.SetActionTriggersArgWithOpts, reply *string) error - SetSharedGroup(shg *engine.SharedGroupWithOpts, reply *string) error - SetActions(args *engine.SetActionsArgsWithOpts, reply *string) error - SetRatingPlan(rp *engine.RatingPlanWithOpts, reply *string) error - SetRatingProfile(rp *engine.RatingProfileWithOpts, reply *string) error - SetRouteProfile(sp *engine.RouteProfileWithOpts, reply *string) error - SetAttributeProfile(ap *engine.AttributeProfileWithOpts, reply *string) error - SetChargerProfile(cp *engine.ChargerProfileWithOpts, reply *string) error - SetDispatcherProfile(dpp *engine.DispatcherProfileWithOpts, reply *string) error - SetRateProfile(dpp *utils.RateProfileWithOpts, reply *string) error - SetActionPlan(args *engine.SetActionPlanArgWithOpts, reply *string) error - SetAccountActionPlans(args *engine.SetAccountActionPlansArgWithOpts, reply *string) error - SetDispatcherHost(dpp *engine.DispatcherHostWithOpts, reply *string) error + SetSharedGroup(shg *engine.SharedGroupWithAPIOpts, reply *string) error + SetActions(args *engine.SetActionsArgsWithAPIOpts, reply *string) error + SetRatingPlan(rp *engine.RatingPlanWithAPIOpts, reply *string) error + SetRatingProfile(rp *engine.RatingProfileWithAPIOpts, reply *string) error + SetRouteProfile(sp *engine.RouteProfileWithAPIOpts, reply *string) error + SetAttributeProfile(ap *engine.AttributeProfileWithAPIOpts, reply *string) error + SetChargerProfile(cp *engine.ChargerProfileWithAPIOpts, reply *string) error + SetDispatcherProfile(dpp *engine.DispatcherProfileWithAPIOpts, reply *string) error + SetRateProfile(dpp *utils.RateProfileWithAPIOpts, reply *string) error + SetActionPlan(args *engine.SetActionPlanArgWithAPIOpts, reply *string) error + SetAccountActionPlans(args *engine.SetAccountActionPlansArgWithAPIOpts, reply *string) error + SetDispatcherHost(dpp *engine.DispatcherHostWithAPIOpts, reply *string) error RemoveThreshold(args *utils.TenantIDWithAPIOpts, reply *string) error - SetLoadIDs(args *utils.LoadIDsWithOpts, reply *string) error + SetLoadIDs(args *utils.LoadIDsWithAPIOpts, reply *string) error RemoveDestination(id *utils.StringWithAPIOpts, reply *string) error RemoveAccount(id *utils.StringWithAPIOpts, reply *string) error RemoveStatQueue(args *utils.TenantIDWithAPIOpts, reply *string) error diff --git a/apier/v1/apier2_it_test.go b/apier/v1/apier2_it_test.go index 63168f44c..e3417bd7d 100644 --- a/apier/v1/apier2_it_test.go +++ b/apier/v1/apier2_it_test.go @@ -147,7 +147,7 @@ func testAPIerVerifyAttributesAfterLoad(t *testing.T) { }, } - eAttrPrf := &engine.AttributeProfileWithOpts{ + eAttrPrf := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: ev.Tenant, ID: "ATTR_1001_SIMPLEAUTH", diff --git a/apier/v1/attributes.go b/apier/v1/attributes.go index 539f58947..d8f888bfd 100644 --- a/apier/v1/attributes.go +++ b/apier/v1/attributes.go @@ -87,7 +87,7 @@ func (apierSv1 *APIerSv1) GetAttributeProfileIDsCount(args *utils.TenantWithAPIO } //SetAttributeProfile add/update a new Attribute Profile -func (apierSv1 *APIerSv1) SetAttributeProfile(alsWrp *engine.AttributeProfileWithOpts, reply *string) error { +func (apierSv1 *APIerSv1) SetAttributeProfile(alsWrp *engine.AttributeProfileWithAPIOpts, reply *string) error { if missing := utils.MissingStructFields(alsWrp.AttributeProfile, []string{utils.ID, utils.Attributes}); len(missing) != 0 { return utils.NewErrMandatoryIeMissing(missing...) } @@ -115,8 +115,8 @@ func (apierSv1 *APIerSv1) SetAttributeProfile(alsWrp *engine.AttributeProfileWit return utils.APIErrorHandler(err) } - if err := apierSv1.CallCache(utils.IfaceAsString(alsWrp.Opts[utils.CacheOpt]), alsWrp.Tenant, utils.CacheAttributeProfiles, - alsWrp.TenantID(), &alsWrp.FilterIDs, alsWrp.Contexts, alsWrp.Opts); err != nil { + if err := apierSv1.CallCache(utils.IfaceAsString(alsWrp.APIOpts[utils.CacheOpt]), alsWrp.Tenant, utils.CacheAttributeProfiles, + alsWrp.TenantID(), &alsWrp.FilterIDs, alsWrp.Contexts, alsWrp.APIOpts); err != nil { return utils.APIErrorHandler(err) } *reply = utils.OK diff --git a/apier/v1/attributes_it_test.go b/apier/v1/attributes_it_test.go index f6d720f76..5eae0d135 100644 --- a/apier/v1/attributes_it_test.go +++ b/apier/v1/attributes_it_test.go @@ -37,7 +37,7 @@ var ( alsPrfCfgPath string alsPrfCfg *config.CGRConfig attrSRPC *rpc.Client - alsPrf *engine.AttributeProfileWithOpts + alsPrf *engine.AttributeProfileWithAPIOpts alsPrfConfigDIR string //run tests for specific configuration sTestsAlsPrf = []func(t *testing.T){ @@ -245,7 +245,7 @@ func testAttributeSGetAttributeForEventNotFound(t *testing.T) { }, }, } - eAttrPrf2 := &engine.AttributeProfileWithOpts{ + eAttrPrf2 := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: ev.Tenant, ID: "ATTR_3", @@ -297,7 +297,7 @@ func testAttributeSGetAttributeForEventWithMetaAnyContext(t *testing.T) { }, }, } - eAttrPrf2 := &engine.AttributeProfileWithOpts{ + eAttrPrf2 := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: ev.Tenant, ID: "ATTR_2", @@ -452,7 +452,7 @@ func testAttributeSProcessEventWithNoneSubstitute(t *testing.T) { }, }, } - alsPrf = &engine.AttributeProfileWithOpts{ + alsPrf = &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "cgrates.org", ID: "AttributeWithNonSubstitute", @@ -523,7 +523,7 @@ func testAttributeSProcessEventWithNoneSubstitute2(t *testing.T) { }, }, } - alsPrf = &engine.AttributeProfileWithOpts{ + alsPrf = &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "cgrates.org", ID: "AttributeWithNonSubstitute", @@ -604,7 +604,7 @@ func testAttributeSProcessEventWithNoneSubstitute3(t *testing.T) { }, }, } - alsPrf = &engine.AttributeProfileWithOpts{ + alsPrf = &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "cgrates.org", ID: "AttributeWithNonSubstitute", @@ -660,7 +660,7 @@ func testAttributeSProcessEventWithNoneSubstitute3(t *testing.T) { } func testAttributeSProcessEventWithHeader(t *testing.T) { - attrPrf1 := &engine.AttributeProfileWithOpts{ + attrPrf1 := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: config.CgrConfig().GeneralCfg().DefaultTenant, ID: "ATTR_Header", @@ -743,7 +743,7 @@ func testAttributeSGetAttPrfIDs(t *testing.T) { } func testAttributeSSetAlsPrfBrokenReference(t *testing.T) { - alsPrf = &engine.AttributeProfileWithOpts{ + alsPrf = &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "cgrates.org", ID: "ApierTest", @@ -776,7 +776,7 @@ func testAttributeSSetAlsPrfBrokenReference(t *testing.T) { } func testAttributeSSetAlsPrf(t *testing.T) { - alsPrf = &engine.AttributeProfileWithOpts{ + alsPrf = &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "cgrates.org", ID: "ApierTest", @@ -872,7 +872,7 @@ func testAttributeSRemAlsPrf(t *testing.T) { } func testAttributeSSetAlsPrf2(t *testing.T) { - alsPrf = &engine.AttributeProfileWithOpts{ + alsPrf = &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "golant", ID: "ATTR_972587832508_SESSIONAUTH", @@ -915,7 +915,7 @@ func testAttributeSSetAlsPrf2(t *testing.T) { } func testAttributeSSetAlsPrf3(t *testing.T) { - alsPrf = &engine.AttributeProfileWithOpts{ + alsPrf = &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "golant", ID: "ATTR_972587832508_SESSIONAUTH", @@ -946,7 +946,7 @@ func testAttributeSSetAlsPrf3(t *testing.T) { } func testAttributeSSetAlsPrf4(t *testing.T) { - alsPrf = &engine.AttributeProfileWithOpts{ + alsPrf = &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "golant", ID: "ATTR_972587832508_SESSIONAUTH", @@ -984,7 +984,7 @@ func testAttributeSPing(t *testing.T) { } func testAttributeSProcessEventWithSearchAndReplace(t *testing.T) { - attrPrf1 := &engine.AttributeProfileWithOpts{ + attrPrf1 := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: config.CgrConfig().GeneralCfg().DefaultTenant, ID: "ATTR_Search_and_replace", @@ -1043,7 +1043,7 @@ func testAttributeSProcessEventWithSearchAndReplace(t *testing.T) { } func testAttributeSProcessWithMultipleRuns(t *testing.T) { - attrPrf1 := &engine.AttributeProfileWithOpts{ + attrPrf1 := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: config.CgrConfig().GeneralCfg().DefaultTenant, ID: "ATTR_1", @@ -1061,7 +1061,7 @@ func testAttributeSProcessWithMultipleRuns(t *testing.T) { Weight: 10, }, } - attrPrf2 := &engine.AttributeProfileWithOpts{ + attrPrf2 := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: config.CgrConfig().GeneralCfg().DefaultTenant, ID: "ATTR_2", @@ -1079,7 +1079,7 @@ func testAttributeSProcessWithMultipleRuns(t *testing.T) { Weight: 20, }, } - attrPrf3 := &engine.AttributeProfileWithOpts{ + attrPrf3 := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: config.CgrConfig().GeneralCfg().DefaultTenant, ID: "ATTR_3", @@ -1155,7 +1155,7 @@ func testAttributeSProcessWithMultipleRuns(t *testing.T) { } func testAttributeSProcessWithMultipleRuns2(t *testing.T) { - attrPrf1 := &engine.AttributeProfileWithOpts{ + attrPrf1 := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: config.CgrConfig().GeneralCfg().DefaultTenant, ID: "ATTR_1", @@ -1173,7 +1173,7 @@ func testAttributeSProcessWithMultipleRuns2(t *testing.T) { Weight: 10, }, } - attrPrf2 := &engine.AttributeProfileWithOpts{ + attrPrf2 := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: config.CgrConfig().GeneralCfg().DefaultTenant, ID: "ATTR_2", @@ -1191,7 +1191,7 @@ func testAttributeSProcessWithMultipleRuns2(t *testing.T) { Weight: 20, }, } - attrPrf3 := &engine.AttributeProfileWithOpts{ + attrPrf3 := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: config.CgrConfig().GeneralCfg().DefaultTenant, ID: "ATTR_3", @@ -1419,7 +1419,7 @@ func testAttributeSKillEngine(t *testing.T) { //Start tests for caching func testAttributeSCachingMetaNone(t *testing.T) { //*none option should not add attribute in cache only in Datamanager - attrPrf1 := &engine.AttributeProfileWithOpts{ + attrPrf1 := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: config.CgrConfig().GeneralCfg().DefaultTenant, ID: "ATTR_1", @@ -1436,7 +1436,7 @@ func testAttributeSCachingMetaNone(t *testing.T) { }, Weight: 10, }, - Opts: map[string]interface{}{ + APIOpts: map[string]interface{}{ utils.CacheOpt: utils.MetaNone, }, } @@ -1480,7 +1480,7 @@ func testAttributeSCachingMetaNone(t *testing.T) { func testAttributeSCachingMetaLoad(t *testing.T) { //*load option should add attribute in cache and in Datamanager - attrPrf1 := &engine.AttributeProfileWithOpts{ + attrPrf1 := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: config.CgrConfig().GeneralCfg().DefaultTenant, ID: "ATTR_1", @@ -1497,7 +1497,7 @@ func testAttributeSCachingMetaLoad(t *testing.T) { }, Weight: 10, }, - Opts: map[string]interface{}{ + APIOpts: map[string]interface{}{ utils.CacheOpt: utils.MetaLoad, }, } @@ -1587,7 +1587,7 @@ func testAttributeSCachingMetaLoad(t *testing.T) { func testAttributeSCachingMetaReload1(t *testing.T) { //*reload add the attributes in cache if was there before - attrPrf1 := &engine.AttributeProfileWithOpts{ + attrPrf1 := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: config.CgrConfig().GeneralCfg().DefaultTenant, ID: "ATTR_1", @@ -1604,7 +1604,7 @@ func testAttributeSCachingMetaReload1(t *testing.T) { }, Weight: 10, }, - Opts: map[string]interface{}{ + APIOpts: map[string]interface{}{ utils.CacheOpt: utils.MetaReload, }, } @@ -1648,7 +1648,7 @@ func testAttributeSCachingMetaReload1(t *testing.T) { func testAttributeSCachingMetaReload2(t *testing.T) { //add cache with *load option - attrPrf1 := &engine.AttributeProfileWithOpts{ + attrPrf1 := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: config.CgrConfig().GeneralCfg().DefaultTenant, ID: "ATTR_1", @@ -1665,7 +1665,7 @@ func testAttributeSCachingMetaReload2(t *testing.T) { }, Weight: 10, }, - Opts: map[string]interface{}{ + APIOpts: map[string]interface{}{ utils.CacheOpt: utils.MetaLoad, }, } @@ -1690,7 +1690,7 @@ func testAttributeSCachingMetaReload2(t *testing.T) { //add cache with *reload option // should overwrite the first - attrPrf2 := &engine.AttributeProfileWithOpts{ + attrPrf2 := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: config.CgrConfig().GeneralCfg().DefaultTenant, ID: "ATTR_1", @@ -1707,7 +1707,7 @@ func testAttributeSCachingMetaReload2(t *testing.T) { }, Weight: 10, }, - Opts: map[string]interface{}{ + APIOpts: map[string]interface{}{ utils.CacheOpt: utils.MetaReload, }, } @@ -1731,7 +1731,7 @@ func testAttributeSCachingMetaReload2(t *testing.T) { func testAttributeSCachingMetaRemove(t *testing.T) { //add cache with *load option - attrPrf1 := &engine.AttributeProfileWithOpts{ + attrPrf1 := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: config.CgrConfig().GeneralCfg().DefaultTenant, ID: "ATTR_1", @@ -1748,7 +1748,7 @@ func testAttributeSCachingMetaRemove(t *testing.T) { }, Weight: 10, }, - Opts: map[string]interface{}{ + APIOpts: map[string]interface{}{ utils.CacheOpt: utils.MetaLoad, }, } @@ -1783,7 +1783,7 @@ func testAttributeSCachingMetaRemove(t *testing.T) { // add with *remove cache option // should delete it from cache - attrPrf2 := &engine.AttributeProfileWithOpts{ + attrPrf2 := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: config.CgrConfig().GeneralCfg().DefaultTenant, ID: "ATTR_1", @@ -1800,7 +1800,7 @@ func testAttributeSCachingMetaRemove(t *testing.T) { }, Weight: 10, }, - Opts: map[string]interface{}{ + APIOpts: map[string]interface{}{ utils.CacheOpt: utils.MetaRemove, }, } @@ -1835,7 +1835,7 @@ func testAttributeSCachingMetaRemove(t *testing.T) { } func testAttributeSSetAttributeWithEmptyPath(t *testing.T) { - eAttrPrf2 := &engine.AttributeProfileWithOpts{ + eAttrPrf2 := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "cgrates.org", ID: "ATTR_3", @@ -1858,7 +1858,7 @@ func testAttributeSSetAttributeWithEmptyPath(t *testing.T) { } func testAttributeSCacheOpts(t *testing.T) { - attrPrf1 := &engine.AttributeProfileWithOpts{ + attrPrf1 := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: config.CgrConfig().GeneralCfg().DefaultTenant, ID: "ATTR_WITH_OPTS", @@ -1875,7 +1875,7 @@ func testAttributeSCacheOpts(t *testing.T) { }, Weight: 10, }, - Opts: map[string]interface{}{ + APIOpts: map[string]interface{}{ "Method": "SetAttributeProfile", "CustomField": "somethingCustom", }, @@ -1891,7 +1891,7 @@ func testAttributeSCacheOpts(t *testing.T) { func testAttributeSSetAlsPrfWithoutTenant(t *testing.T) { var reply string - alsPrf = &engine.AttributeProfileWithOpts{ + alsPrf = &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ ID: "ApierTest1", Contexts: []string{utils.MetaSessionS, utils.MetaCDRs}, diff --git a/apier/v1/chargers_it_test.go b/apier/v1/chargers_it_test.go index 0d5be4854..8cb172491 100755 --- a/apier/v1/chargers_it_test.go +++ b/apier/v1/chargers_it_test.go @@ -209,7 +209,7 @@ func testChargerSLoadAddCharger(t *testing.T) { t.Error("Unexpected reply returned", result) } - alsPrf = &engine.AttributeProfileWithOpts{ + alsPrf = &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "cgrates.org", ID: "ATTR_1001_SIMPLEAUTH", diff --git a/apier/v1/dispatcher.go b/apier/v1/dispatcher.go index 385ced975..e2351e91b 100755 --- a/apier/v1/dispatcher.go +++ b/apier/v1/dispatcher.go @@ -163,7 +163,7 @@ func (apierSv1 *APIerSv1) GetDispatcherHostIDs(tenantArg *utils.PaginatorWithTen } //SetDispatcherHost add/update a new Dispatcher Host -func (apierSv1 *APIerSv1) SetDispatcherHost(args *engine.DispatcherHostWithOpts, reply *string) error { +func (apierSv1 *APIerSv1) SetDispatcherHost(args *engine.DispatcherHostWithAPIOpts, reply *string) error { if missing := utils.MissingStructFields(args.DispatcherHost, []string{utils.ID}); len(missing) != 0 { return utils.NewErrMandatoryIeMissing(missing...) } @@ -178,8 +178,8 @@ func (apierSv1 *APIerSv1) SetDispatcherHost(args *engine.DispatcherHostWithOpts, return utils.APIErrorHandler(err) } //handle caching for DispatcherProfile - if err := apierSv1.CallCache(utils.IfaceAsString(args.Opts[utils.CacheOpt]), args.Tenant, utils.CacheDispatcherHosts, - args.TenantID(), nil, nil, args.Opts); err != nil { + if err := apierSv1.CallCache(utils.IfaceAsString(args.APIOpts[utils.CacheOpt]), args.Tenant, utils.CacheDispatcherHosts, + args.TenantID(), nil, nil, args.APIOpts); err != nil { return utils.APIErrorHandler(err) } *reply = utils.OK @@ -1097,62 +1097,62 @@ func (dS *DispatcherReplicatorSv1) SetActionTriggers(args *engine.SetActionTrigg } // SetSharedGroup -func (dS *DispatcherReplicatorSv1) SetSharedGroup(args *engine.SharedGroupWithOpts, reply *string) error { +func (dS *DispatcherReplicatorSv1) SetSharedGroup(args *engine.SharedGroupWithAPIOpts, reply *string) error { return dS.dS.ReplicatorSv1SetSharedGroup(args, reply) } // SetActions -func (dS *DispatcherReplicatorSv1) SetActions(args *engine.SetActionsArgsWithOpts, reply *string) error { +func (dS *DispatcherReplicatorSv1) SetActions(args *engine.SetActionsArgsWithAPIOpts, reply *string) error { return dS.dS.ReplicatorSv1SetActions(args, reply) } // SetRatingPlan -func (dS *DispatcherReplicatorSv1) SetRatingPlan(args *engine.RatingPlanWithOpts, reply *string) error { +func (dS *DispatcherReplicatorSv1) SetRatingPlan(args *engine.RatingPlanWithAPIOpts, reply *string) error { return dS.dS.ReplicatorSv1SetRatingPlan(args, reply) } // SetRatingProfile -func (dS *DispatcherReplicatorSv1) SetRatingProfile(args *engine.RatingProfileWithOpts, reply *string) error { +func (dS *DispatcherReplicatorSv1) SetRatingProfile(args *engine.RatingProfileWithAPIOpts, reply *string) error { return dS.dS.ReplicatorSv1SetRatingProfile(args, reply) } // SetRouteProfile -func (dS *DispatcherReplicatorSv1) SetRouteProfile(args *engine.RouteProfileWithOpts, reply *string) error { +func (dS *DispatcherReplicatorSv1) SetRouteProfile(args *engine.RouteProfileWithAPIOpts, reply *string) error { return dS.dS.ReplicatorSv1SetRouteProfile(args, reply) } // SetAttributeProfile -func (dS *DispatcherReplicatorSv1) SetAttributeProfile(args *engine.AttributeProfileWithOpts, reply *string) error { +func (dS *DispatcherReplicatorSv1) SetAttributeProfile(args *engine.AttributeProfileWithAPIOpts, reply *string) error { return dS.dS.ReplicatorSv1SetAttributeProfile(args, reply) } // SetChargerProfile -func (dS *DispatcherReplicatorSv1) SetChargerProfile(args *engine.ChargerProfileWithOpts, reply *string) error { +func (dS *DispatcherReplicatorSv1) SetChargerProfile(args *engine.ChargerProfileWithAPIOpts, reply *string) error { return dS.dS.ReplicatorSv1SetChargerProfile(args, reply) } // SetDispatcherProfile -func (dS *DispatcherReplicatorSv1) SetDispatcherProfile(args *engine.DispatcherProfileWithOpts, reply *string) error { +func (dS *DispatcherReplicatorSv1) SetDispatcherProfile(args *engine.DispatcherProfileWithAPIOpts, reply *string) error { return dS.dS.ReplicatorSv1SetDispatcherProfile(args, reply) } // SetRateProfile -func (dS *DispatcherReplicatorSv1) SetRateProfile(args *utils.RateProfileWithOpts, reply *string) error { +func (dS *DispatcherReplicatorSv1) SetRateProfile(args *utils.RateProfileWithAPIOpts, reply *string) error { return dS.dS.ReplicatorSv1SetRateProfile(args, reply) } // SetActionPlan -func (dS *DispatcherReplicatorSv1) SetActionPlan(args *engine.SetActionPlanArgWithOpts, reply *string) error { +func (dS *DispatcherReplicatorSv1) SetActionPlan(args *engine.SetActionPlanArgWithAPIOpts, reply *string) error { return dS.dS.ReplicatorSv1SetActionPlan(args, reply) } // SetAccountActionPlans -func (dS *DispatcherReplicatorSv1) SetAccountActionPlans(args *engine.SetAccountActionPlansArgWithOpts, reply *string) error { +func (dS *DispatcherReplicatorSv1) SetAccountActionPlans(args *engine.SetAccountActionPlansArgWithAPIOpts, reply *string) error { return dS.dS.ReplicatorSv1SetAccountActionPlans(args, reply) } // SetDispatcherHost -func (dS *DispatcherReplicatorSv1) SetDispatcherHost(args *engine.DispatcherHostWithOpts, reply *string) error { +func (dS *DispatcherReplicatorSv1) SetDispatcherHost(args *engine.DispatcherHostWithAPIOpts, reply *string) error { return dS.dS.ReplicatorSv1SetDispatcherHost(args, reply) } @@ -1162,7 +1162,7 @@ func (dS *DispatcherReplicatorSv1) RemoveThreshold(args *utils.TenantIDWithAPIOp } // SetLoadIDs -func (dS *DispatcherReplicatorSv1) SetLoadIDs(args *utils.LoadIDsWithOpts, reply *string) error { +func (dS *DispatcherReplicatorSv1) SetLoadIDs(args *utils.LoadIDsWithAPIOpts, reply *string) error { return dS.dS.ReplicatorSv1SetLoadIDs(args, reply) } diff --git a/apier/v1/dispatcher_it_test.go b/apier/v1/dispatcher_it_test.go index eab7490e9..971d5b6a1 100644 --- a/apier/v1/dispatcher_it_test.go +++ b/apier/v1/dispatcher_it_test.go @@ -38,7 +38,7 @@ var ( dispatcherCfg *config.CGRConfig dispatcherRPC *rpc.Client dispatcherProfile *DispatcherWithAPIOpts - dispatcherHost *engine.DispatcherHostWithOpts + dispatcherHost *engine.DispatcherHostWithAPIOpts dispatcherConfigDIR string //run tests for specific configuration sTestsDispatcher = []func(t *testing.T){ @@ -262,7 +262,7 @@ func testDispatcherSSetDispatcherHost(t *testing.T) { t.Error(err) } - dispatcherHost = &engine.DispatcherHostWithOpts{ + dispatcherHost = &engine.DispatcherHostWithAPIOpts{ DispatcherHost: &engine.DispatcherHost{ Tenant: "cgrates.org", RemoteHost: &config.RemoteHost{ @@ -418,7 +418,7 @@ func testDispatcherSRemDispatcherProfileWithoutTenant(t *testing.T) { } func testDispatcherSSetDispatcherHostWithoutTenant(t *testing.T) { - dispatcherHost = &engine.DispatcherHostWithOpts{ + dispatcherHost = &engine.DispatcherHostWithAPIOpts{ DispatcherHost: &engine.DispatcherHost{ RemoteHost: &config.RemoteHost{ ID: "DspHst7", diff --git a/apier/v1/filter_indexes_it_test.go b/apier/v1/filter_indexes_it_test.go index 67a26cf4d..2729550c0 100644 --- a/apier/v1/filter_indexes_it_test.go +++ b/apier/v1/filter_indexes_it_test.go @@ -2607,7 +2607,7 @@ func testV1FIdxSetAttributeProfileIndexes(t *testing.T) { err.Error() != utils.ErrNotFound.Error() { t.Error(err) } - alsPrf = &engine.AttributeProfileWithOpts{ + alsPrf = &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: tenant, ID: "ApierTest", @@ -2716,7 +2716,7 @@ func testV1FIdxSetSecondAttributeProfileIndexes(t *testing.T) { err.Error() != utils.ErrNotFound.Error() { t.Error(err) } - alsPrf = &engine.AttributeProfileWithOpts{ + alsPrf = &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: tenant, ID: "ApierTest2", diff --git a/apier/v1/filterindexecache_it_test.go b/apier/v1/filterindexecache_it_test.go index 6ec87aaf0..4ef95634f 100644 --- a/apier/v1/filterindexecache_it_test.go +++ b/apier/v1/filterindexecache_it_test.go @@ -995,7 +995,7 @@ func testV1FIdxCaSetAttributeProfile(t *testing.T) { } else if result != utils.OK { t.Error("Unexpected reply returned", result) } - alsPrf := &engine.AttributeProfileWithOpts{ + alsPrf := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "cgrates.org", ID: "TEST_PROFILE1", @@ -1088,7 +1088,7 @@ func testV1FIdxCaUpdateAttributeProfile(t *testing.T) { } else if result != utils.OK { t.Error("Unexpected reply returned", result) } - alsPrf := &engine.AttributeProfileWithOpts{ + alsPrf := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "cgrates.org", ID: "TEST_PROFILE1", @@ -1168,7 +1168,7 @@ func testV1FIdxCaUpdateAttributeProfileFromTP(t *testing.T) { t.Error(err) } reply.FilterIDs = []string{"TestFilter3"} - if err := tFIdxCaRpc.Call(utils.APIerSv1SetAttributeProfile, &engine.AttributeProfileWithOpts{AttributeProfile: &reply}, &result); err != nil { + if err := tFIdxCaRpc.Call(utils.APIerSv1SetAttributeProfile, &engine.AttributeProfileWithAPIOpts{AttributeProfile: &reply}, &result); err != nil { t.Error(err) } else if result != utils.OK { t.Error("Unexpected reply returned", result) diff --git a/apier/v1/full_remote_it_test.go b/apier/v1/full_remote_it_test.go index c3c7d9890..7ef13b393 100644 --- a/apier/v1/full_remote_it_test.go +++ b/apier/v1/full_remote_it_test.go @@ -131,7 +131,7 @@ func testFullRemoteITAttribute(t *testing.T) { } var replySet string - alsPrf := &engine.AttributeProfileWithOpts{ + alsPrf := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "cgrates.org", ID: "ATTR_1001_SIMPLEAUTH", diff --git a/apier/v1/remote_it_test.go b/apier/v1/remote_it_test.go index 53fa405aa..f768ec945 100644 --- a/apier/v1/remote_it_test.go +++ b/apier/v1/remote_it_test.go @@ -232,7 +232,7 @@ func testInternalRemoteITGetAccount(t *testing.T) { } func testInternalRemoteITGetAttribute(t *testing.T) { - alsPrf = &engine.AttributeProfileWithOpts{ + alsPrf = &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "cgrates.org", ID: "ATTR_1001_SIMPLEAUTH", @@ -635,7 +635,7 @@ func testInternalRemoteITGetDispatcherHost(t *testing.T) { t.Error(err) } - dispatcherHost = &engine.DispatcherHostWithOpts{ + dispatcherHost = &engine.DispatcherHostWithAPIOpts{ DispatcherHost: &engine.DispatcherHost{ Tenant: "cgrates.org", RemoteHost: &config.RemoteHost{ diff --git a/apier/v1/replicate_it_test.go b/apier/v1/replicate_it_test.go index f9332ab9d..fcd30df76 100644 --- a/apier/v1/replicate_it_test.go +++ b/apier/v1/replicate_it_test.go @@ -205,7 +205,7 @@ func testInternalReplicateITDestination(t *testing.T) { func testInternalReplicateITAttributeProfile(t *testing.T) { //set - alsPrf := &engine.AttributeProfileWithOpts{ + alsPrf := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "cgrates.org", ID: "ATTR_CDRE", @@ -634,7 +634,7 @@ func testInternalReplicateITDispatcherHost(t *testing.T) { &reply); err == nil || err.Error() != utils.ErrNotFound.Error() { t.Error(err) } - dispatcherHost = &engine.DispatcherHostWithOpts{ + dispatcherHost = &engine.DispatcherHostWithAPIOpts{ DispatcherHost: &engine.DispatcherHost{ Tenant: "cgrates.org", RemoteHost: &config.RemoteHost{ @@ -1456,7 +1456,7 @@ func testInternalReplicateITLoadIds(t *testing.T) { t.Errorf("Expecting same LoadIDs for both engines") } // set AttributeProfile - alsPrf = &engine.AttributeProfileWithOpts{ + alsPrf = &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "cgrates.org", ID: "AttributeWithNonSubstitute", diff --git a/apier/v1/replicator.go b/apier/v1/replicator.go index e6bbdbd15..9a3a18268 100644 --- a/apier/v1/replicator.go +++ b/apier/v1/replicator.go @@ -519,12 +519,12 @@ func (rplSv1 *ReplicatorSv1) SetActionTriggers(args *engine.SetActionTriggersArg } // SetSharedGroup is the replication method coresponding to the dataDb driver method -func (rplSv1 *ReplicatorSv1) SetSharedGroup(shg *engine.SharedGroupWithOpts, reply *string) (err error) { +func (rplSv1 *ReplicatorSv1) SetSharedGroup(shg *engine.SharedGroupWithAPIOpts, reply *string) (err error) { if err = rplSv1.dm.DataDB().SetSharedGroupDrv(shg.SharedGroup); err != nil { return } - if err = rplSv1.v1.CallCache(utils.IfaceAsString(shg.Opts[utils.CacheOpt]), - shg.Tenant, utils.CacheSharedGroups, shg.Id, nil, nil, shg.Opts); err != nil { + if err = rplSv1.v1.CallCache(utils.IfaceAsString(shg.APIOpts[utils.CacheOpt]), + shg.Tenant, utils.CacheSharedGroups, shg.Id, nil, nil, shg.APIOpts); err != nil { return } *reply = utils.OK @@ -532,12 +532,12 @@ func (rplSv1 *ReplicatorSv1) SetSharedGroup(shg *engine.SharedGroupWithOpts, rep } // SetActions is the replication method coresponding to the dataDb driver method -func (rplSv1 *ReplicatorSv1) SetActions(args *engine.SetActionsArgsWithOpts, reply *string) (err error) { +func (rplSv1 *ReplicatorSv1) SetActions(args *engine.SetActionsArgsWithAPIOpts, reply *string) (err error) { if err = rplSv1.dm.DataDB().SetActionsDrv(args.Key, args.Acs); err != nil { return } - if err = rplSv1.v1.CallCache(utils.IfaceAsString(args.Opts[utils.CacheOpt]), - args.Tenant, utils.CacheActions, args.Key, nil, nil, args.Opts); err != nil { + if err = rplSv1.v1.CallCache(utils.IfaceAsString(args.APIOpts[utils.CacheOpt]), + args.Tenant, utils.CacheActions, args.Key, nil, nil, args.APIOpts); err != nil { return } *reply = utils.OK @@ -545,12 +545,12 @@ func (rplSv1 *ReplicatorSv1) SetActions(args *engine.SetActionsArgsWithOpts, rep } // SetRatingPlan is the replication method coresponding to the dataDb driver method -func (rplSv1 *ReplicatorSv1) SetRatingPlan(rp *engine.RatingPlanWithOpts, reply *string) (err error) { +func (rplSv1 *ReplicatorSv1) SetRatingPlan(rp *engine.RatingPlanWithAPIOpts, reply *string) (err error) { if err = rplSv1.dm.DataDB().SetRatingPlanDrv(rp.RatingPlan); err != nil { return } - if err = rplSv1.v1.CallCache(utils.IfaceAsString(rp.Opts[utils.CacheOpt]), - rp.Tenant, utils.CacheRatingPlans, rp.Id, nil, nil, rp.Opts); err != nil { + if err = rplSv1.v1.CallCache(utils.IfaceAsString(rp.APIOpts[utils.CacheOpt]), + rp.Tenant, utils.CacheRatingPlans, rp.Id, nil, nil, rp.APIOpts); err != nil { return } *reply = utils.OK @@ -558,12 +558,12 @@ func (rplSv1 *ReplicatorSv1) SetRatingPlan(rp *engine.RatingPlanWithOpts, reply } // SetRatingProfile is the replication method coresponding to the dataDb driver method -func (rplSv1 *ReplicatorSv1) SetRatingProfile(rp *engine.RatingProfileWithOpts, reply *string) (err error) { +func (rplSv1 *ReplicatorSv1) SetRatingProfile(rp *engine.RatingProfileWithAPIOpts, reply *string) (err error) { if err = rplSv1.dm.DataDB().SetRatingProfileDrv(rp.RatingProfile); err != nil { return } - if err = rplSv1.v1.CallCache(utils.IfaceAsString(rp.Opts[utils.CacheOpt]), - rp.Tenant, utils.CacheRatingProfiles, rp.Id, nil, nil, rp.Opts); err != nil { + if err = rplSv1.v1.CallCache(utils.IfaceAsString(rp.APIOpts[utils.CacheOpt]), + rp.Tenant, utils.CacheRatingProfiles, rp.Id, nil, nil, rp.APIOpts); err != nil { return } *reply = utils.OK @@ -571,12 +571,12 @@ func (rplSv1 *ReplicatorSv1) SetRatingProfile(rp *engine.RatingProfileWithOpts, } // SetRouteProfile is the replication method coresponding to the dataDb driver method -func (rplSv1 *ReplicatorSv1) SetRouteProfile(sp *engine.RouteProfileWithOpts, reply *string) (err error) { +func (rplSv1 *ReplicatorSv1) SetRouteProfile(sp *engine.RouteProfileWithAPIOpts, reply *string) (err error) { if err = rplSv1.dm.DataDB().SetRouteProfileDrv(sp.RouteProfile); err != nil { return } - if err = rplSv1.v1.CallCache(utils.IfaceAsString(sp.Opts[utils.CacheOpt]), - sp.Tenant, utils.CacheRouteProfiles, sp.TenantID(), &sp.FilterIDs, nil, sp.Opts); err != nil { + if err = rplSv1.v1.CallCache(utils.IfaceAsString(sp.APIOpts[utils.CacheOpt]), + sp.Tenant, utils.CacheRouteProfiles, sp.TenantID(), &sp.FilterIDs, nil, sp.APIOpts); err != nil { return } *reply = utils.OK @@ -584,12 +584,12 @@ func (rplSv1 *ReplicatorSv1) SetRouteProfile(sp *engine.RouteProfileWithOpts, re } // SetAttributeProfile is the replication method coresponding to the dataDb driver method -func (rplSv1 *ReplicatorSv1) SetAttributeProfile(ap *engine.AttributeProfileWithOpts, reply *string) (err error) { +func (rplSv1 *ReplicatorSv1) SetAttributeProfile(ap *engine.AttributeProfileWithAPIOpts, reply *string) (err error) { if err = rplSv1.dm.DataDB().SetAttributeProfileDrv(ap.AttributeProfile); err != nil { return } - if err = rplSv1.v1.CallCache(utils.IfaceAsString(ap.Opts[utils.CacheOpt]), - ap.Tenant, utils.CacheAttributeProfiles, ap.TenantID(), &ap.FilterIDs, ap.Contexts, ap.Opts); err != nil { + if err = rplSv1.v1.CallCache(utils.IfaceAsString(ap.APIOpts[utils.CacheOpt]), + ap.Tenant, utils.CacheAttributeProfiles, ap.TenantID(), &ap.FilterIDs, ap.Contexts, ap.APIOpts); err != nil { return } *reply = utils.OK @@ -597,12 +597,12 @@ func (rplSv1 *ReplicatorSv1) SetAttributeProfile(ap *engine.AttributeProfileWith } // SetChargerProfile is the replication method coresponding to the dataDb driver method -func (rplSv1 *ReplicatorSv1) SetChargerProfile(cp *engine.ChargerProfileWithOpts, reply *string) (err error) { +func (rplSv1 *ReplicatorSv1) SetChargerProfile(cp *engine.ChargerProfileWithAPIOpts, reply *string) (err error) { if err = rplSv1.dm.DataDB().SetChargerProfileDrv(cp.ChargerProfile); err != nil { return } - if err = rplSv1.v1.CallCache(utils.IfaceAsString(cp.Opts[utils.CacheOpt]), - cp.Tenant, utils.CacheChargerProfiles, cp.TenantID(), &cp.FilterIDs, nil, cp.Opts); err != nil { + if err = rplSv1.v1.CallCache(utils.IfaceAsString(cp.APIOpts[utils.CacheOpt]), + cp.Tenant, utils.CacheChargerProfiles, cp.TenantID(), &cp.FilterIDs, nil, cp.APIOpts); err != nil { return } *reply = utils.OK @@ -610,12 +610,12 @@ func (rplSv1 *ReplicatorSv1) SetChargerProfile(cp *engine.ChargerProfileWithOpts } // SetDispatcherProfile is the replication method coresponding to the dataDb driver method -func (rplSv1 *ReplicatorSv1) SetDispatcherProfile(dpp *engine.DispatcherProfileWithOpts, reply *string) (err error) { +func (rplSv1 *ReplicatorSv1) SetDispatcherProfile(dpp *engine.DispatcherProfileWithAPIOpts, reply *string) (err error) { if err = rplSv1.dm.DataDB().SetDispatcherProfileDrv(dpp.DispatcherProfile); err != nil { return } - if err = rplSv1.v1.CallCache(utils.IfaceAsString(dpp.Opts[utils.CacheOpt]), - dpp.Tenant, utils.CacheDispatcherProfiles, dpp.TenantID(), &dpp.FilterIDs, dpp.Subsystems, dpp.Opts); err != nil { + if err = rplSv1.v1.CallCache(utils.IfaceAsString(dpp.APIOpts[utils.CacheOpt]), + dpp.Tenant, utils.CacheDispatcherProfiles, dpp.TenantID(), &dpp.FilterIDs, dpp.Subsystems, dpp.APIOpts); err != nil { return } *reply = utils.OK @@ -623,12 +623,12 @@ func (rplSv1 *ReplicatorSv1) SetDispatcherProfile(dpp *engine.DispatcherProfileW } // SetActionPlan is the replication method coresponding to the dataDb driver method -func (rplSv1 *ReplicatorSv1) SetActionPlan(args *engine.SetActionPlanArgWithOpts, reply *string) (err error) { +func (rplSv1 *ReplicatorSv1) SetActionPlan(args *engine.SetActionPlanArgWithAPIOpts, reply *string) (err error) { if err = rplSv1.dm.DataDB().SetActionPlanDrv(args.Key, args.Ats, args.Overwrite, utils.NonTransactional); err != nil { return } - if err = rplSv1.v1.CallCache(utils.IfaceAsString(args.Opts[utils.CacheOpt]), - args.Tenant, utils.CacheActionPlans, args.Key, nil, nil, args.Opts); err != nil { + if err = rplSv1.v1.CallCache(utils.IfaceAsString(args.APIOpts[utils.CacheOpt]), + args.Tenant, utils.CacheActionPlans, args.Key, nil, nil, args.APIOpts); err != nil { return } *reply = utils.OK @@ -636,12 +636,12 @@ func (rplSv1 *ReplicatorSv1) SetActionPlan(args *engine.SetActionPlanArgWithOpts } // SetAccountActionPlans is the replication method coresponding to the dataDb driver method -func (rplSv1 *ReplicatorSv1) SetAccountActionPlans(args *engine.SetAccountActionPlansArgWithOpts, reply *string) (err error) { +func (rplSv1 *ReplicatorSv1) SetAccountActionPlans(args *engine.SetAccountActionPlansArgWithAPIOpts, reply *string) (err error) { if err = rplSv1.dm.DataDB().SetAccountActionPlansDrv(args.AcntID, args.AplIDs, args.Overwrite); err != nil { return } - if err = rplSv1.v1.CallCache(utils.IfaceAsString(args.Opts[utils.CacheOpt]), - args.Tenant, utils.CacheAccountActionPlans, args.AcntID, nil, nil, args.Opts); err != nil { + if err = rplSv1.v1.CallCache(utils.IfaceAsString(args.APIOpts[utils.CacheOpt]), + args.Tenant, utils.CacheAccountActionPlans, args.AcntID, nil, nil, args.APIOpts); err != nil { return } *reply = utils.OK @@ -649,12 +649,12 @@ func (rplSv1 *ReplicatorSv1) SetAccountActionPlans(args *engine.SetAccountAction } // SetDispatcherHost is the replication method coresponding to the dataDb driver method -func (rplSv1 *ReplicatorSv1) SetDispatcherHost(dpp *engine.DispatcherHostWithOpts, reply *string) (err error) { +func (rplSv1 *ReplicatorSv1) SetDispatcherHost(dpp *engine.DispatcherHostWithAPIOpts, reply *string) (err error) { if err = rplSv1.dm.DataDB().SetDispatcherHostDrv(dpp.DispatcherHost); err != nil { return } - if err = rplSv1.v1.CallCache(utils.IfaceAsString(dpp.Opts[utils.CacheOpt]), - dpp.Tenant, utils.CacheDispatcherHosts, dpp.TenantID(), nil, nil, dpp.Opts); err != nil { + if err = rplSv1.v1.CallCache(utils.IfaceAsString(dpp.APIOpts[utils.CacheOpt]), + dpp.Tenant, utils.CacheDispatcherHosts, dpp.TenantID(), nil, nil, dpp.APIOpts); err != nil { return } *reply = utils.OK @@ -662,12 +662,12 @@ func (rplSv1 *ReplicatorSv1) SetDispatcherHost(dpp *engine.DispatcherHostWithOpt } // SetRateProfile is the replication method coresponding to the dataDb driver method -func (rplSv1 *ReplicatorSv1) SetRateProfile(dpp *utils.RateProfileWithOpts, reply *string) (err error) { +func (rplSv1 *ReplicatorSv1) SetRateProfile(dpp *utils.RateProfileWithAPIOpts, reply *string) (err error) { if err = rplSv1.dm.DataDB().SetRateProfileDrv(dpp.RateProfile); err != nil { return } - if err = rplSv1.v1.CallCache(utils.IfaceAsString(dpp.Opts[utils.CacheOpt]), - dpp.Tenant, utils.CacheRateProfiles, dpp.TenantID(), &dpp.FilterIDs, nil, dpp.Opts); err != nil { + if err = rplSv1.v1.CallCache(utils.IfaceAsString(dpp.APIOpts[utils.CacheOpt]), + dpp.Tenant, utils.CacheRateProfiles, dpp.TenantID(), &dpp.FilterIDs, nil, dpp.APIOpts); err != nil { return } *reply = utils.OK @@ -701,7 +701,7 @@ func (rplSv1 *ReplicatorSv1) SetAccountProfile(acp *utils.AccountProfileWithAPIO } // SetLoadIDs is the replication method coresponding to the dataDb driver method -func (rplSv1 *ReplicatorSv1) SetLoadIDs(args *utils.LoadIDsWithOpts, reply *string) (err error) { +func (rplSv1 *ReplicatorSv1) SetLoadIDs(args *utils.LoadIDsWithAPIOpts, reply *string) (err error) { if err = rplSv1.dm.DataDB().SetLoadIDsDrv(args.LoadIDs); err != nil { return } @@ -709,8 +709,8 @@ func (rplSv1 *ReplicatorSv1) SetLoadIDs(args *utils.LoadIDsWithOpts, reply *stri for lID := range args.LoadIDs { lIDs = append(lIDs, lID) } - if err = rplSv1.v1.callCacheMultiple(utils.IfaceAsString(args.Opts[utils.CacheOpt]), - args.Tenant, utils.CacheLoadIDs, lIDs, args.Opts); err != nil { + if err = rplSv1.v1.callCacheMultiple(utils.IfaceAsString(args.APIOpts[utils.CacheOpt]), + args.Tenant, utils.CacheLoadIDs, lIDs, args.APIOpts); err != nil { return } *reply = utils.OK diff --git a/apier/v2/attributes_it_test.go b/apier/v2/attributes_it_test.go index 1fb30e5fb..cb6f30e20 100644 --- a/apier/v2/attributes_it_test.go +++ b/apier/v2/attributes_it_test.go @@ -138,7 +138,7 @@ func testAttributeSSetAlsPrf(t *testing.T) { t.Error("Unexpected reply returned", result) } - alsPrf := &engine.AttributeProfileWithOpts{ + alsPrf := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "cgrates.org", ID: "ExternalAttribute", @@ -200,7 +200,7 @@ func testAttributeSUpdateAlsPrf(t *testing.T) { t.Error("Unexpected reply returned", result) } - alsPrf := &engine.AttributeProfileWithOpts{ + alsPrf := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "cgrates.org", ID: "ExternalAttribute", @@ -269,7 +269,7 @@ func testAttributeSSetAlsPrfWithoutTenant(t *testing.T) { t.Error("Unexpected reply returned", result) } - alsPrf := &engine.AttributeProfileWithOpts{ + alsPrf := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "cgrates.org", ID: "ExternalAttribute", diff --git a/apier/v2/cdrs_it_test.go b/apier/v2/cdrs_it_test.go index db7b4d032..79a333466 100644 --- a/apier/v2/cdrs_it_test.go +++ b/apier/v2/cdrs_it_test.go @@ -410,7 +410,7 @@ func testV2CDRsUsageNegative(t *testing.T) { func testV2CDRsDifferentTenants(t *testing.T) { //add an attribute - alsPrf := &engine.AttributeProfileWithOpts{ + alsPrf := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "cgrates.com", ID: "ATTR_Tenant", @@ -442,7 +442,7 @@ func testV2CDRsDifferentTenants(t *testing.T) { Blocker: false, Weight: 10, }, - Opts: map[string]interface{}{ + APIOpts: map[string]interface{}{ utils.CacheOpt: utils.MetaReload, }, } diff --git a/console/dispatchers_host_set.go b/console/dispatchers_host_set.go index 68de54222..6e55511ee 100644 --- a/console/dispatchers_host_set.go +++ b/console/dispatchers_host_set.go @@ -36,7 +36,7 @@ func init() { type CmdSetDispatcherHost struct { name string rpcMethod string - rpcParams *engine.DispatcherHostWithOpts + rpcParams *engine.DispatcherHostWithAPIOpts *CommandExecuter } @@ -50,9 +50,9 @@ func (self *CmdSetDispatcherHost) RpcMethod() string { func (self *CmdSetDispatcherHost) RpcParams(reset bool) interface{} { if reset || self.rpcParams == nil { - self.rpcParams = &engine.DispatcherHostWithOpts{ + self.rpcParams = &engine.DispatcherHostWithAPIOpts{ DispatcherHost: new(engine.DispatcherHost), - Opts: make(map[string]interface{}), + APIOpts: make(map[string]interface{}), } } return self.rpcParams diff --git a/dispatchers/replicator.go b/dispatchers/replicator.go index 43f0c8bb7..e633b4948 100644 --- a/dispatchers/replicator.go +++ b/dispatchers/replicator.go @@ -716,156 +716,156 @@ func (dS *DispatcherService) ReplicatorSv1SetActionTriggers(args *engine.SetActi }, utils.MetaReplicator, utils.ReplicatorSv1SetActionTriggers, args, rpl) } -func (dS *DispatcherService) ReplicatorSv1SetSharedGroup(args *engine.SharedGroupWithOpts, rpl *string) (err error) { +func (dS *DispatcherService) ReplicatorSv1SetSharedGroup(args *engine.SharedGroupWithAPIOpts, rpl *string) (err error) { if args == nil { - args = &engine.SharedGroupWithOpts{} + args = &engine.SharedGroupWithAPIOpts{} } args.Tenant = utils.FirstNonEmpty(args.Tenant, dS.cfg.GeneralCfg().DefaultTenant) if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { if err = dS.authorize(utils.ReplicatorSv1SetSharedGroup, args.Tenant, - utils.IfaceAsString(args.Opts[utils.OptsAPIKey]), utils.TimePointer(time.Now())); err != nil { + utils.IfaceAsString(args.APIOpts[utils.OptsAPIKey]), utils.TimePointer(time.Now())); err != nil { return } } return dS.Dispatch(&utils.CGREvent{ Tenant: args.Tenant, - APIOpts: args.Opts, + APIOpts: args.APIOpts, }, utils.MetaReplicator, utils.ReplicatorSv1SetSharedGroup, args, rpl) } -func (dS *DispatcherService) ReplicatorSv1SetActions(args *engine.SetActionsArgsWithOpts, rpl *string) (err error) { +func (dS *DispatcherService) ReplicatorSv1SetActions(args *engine.SetActionsArgsWithAPIOpts, rpl *string) (err error) { if args == nil { - args = &engine.SetActionsArgsWithOpts{} + args = &engine.SetActionsArgsWithAPIOpts{} } args.Tenant = utils.FirstNonEmpty(args.Tenant, dS.cfg.GeneralCfg().DefaultTenant) if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { if err = dS.authorize(utils.ReplicatorSv1SetActions, args.Tenant, - utils.IfaceAsString(args.Opts[utils.OptsAPIKey]), utils.TimePointer(time.Now())); err != nil { + utils.IfaceAsString(args.APIOpts[utils.OptsAPIKey]), utils.TimePointer(time.Now())); err != nil { return } } return dS.Dispatch(&utils.CGREvent{ Tenant: args.Tenant, - APIOpts: args.Opts, + APIOpts: args.APIOpts, }, utils.MetaReplicator, utils.ReplicatorSv1SetActions, args, rpl) } -func (dS *DispatcherService) ReplicatorSv1SetRatingPlan(args *engine.RatingPlanWithOpts, rpl *string) (err error) { +func (dS *DispatcherService) ReplicatorSv1SetRatingPlan(args *engine.RatingPlanWithAPIOpts, rpl *string) (err error) { if args == nil { - args = &engine.RatingPlanWithOpts{} + args = &engine.RatingPlanWithAPIOpts{} } args.Tenant = utils.FirstNonEmpty(args.Tenant, dS.cfg.GeneralCfg().DefaultTenant) if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { if err = dS.authorize(utils.ReplicatorSv1SetRatingPlan, args.Tenant, - utils.IfaceAsString(args.Opts[utils.OptsAPIKey]), utils.TimePointer(time.Now())); err != nil { + utils.IfaceAsString(args.APIOpts[utils.OptsAPIKey]), utils.TimePointer(time.Now())); err != nil { return } } return dS.Dispatch(&utils.CGREvent{ Tenant: args.Tenant, - APIOpts: args.Opts, + APIOpts: args.APIOpts, }, utils.MetaReplicator, utils.ReplicatorSv1SetRatingPlan, args, rpl) } -func (dS *DispatcherService) ReplicatorSv1SetRatingProfile(args *engine.RatingProfileWithOpts, rpl *string) (err error) { +func (dS *DispatcherService) ReplicatorSv1SetRatingProfile(args *engine.RatingProfileWithAPIOpts, rpl *string) (err error) { if args == nil { - args = &engine.RatingProfileWithOpts{} + args = &engine.RatingProfileWithAPIOpts{} } args.Tenant = utils.FirstNonEmpty(args.Tenant, dS.cfg.GeneralCfg().DefaultTenant) if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { if err = dS.authorize(utils.ReplicatorSv1SetRatingProfile, args.Tenant, - utils.IfaceAsString(args.Opts[utils.OptsAPIKey]), utils.TimePointer(time.Now())); err != nil { + utils.IfaceAsString(args.APIOpts[utils.OptsAPIKey]), utils.TimePointer(time.Now())); err != nil { return } } return dS.Dispatch(&utils.CGREvent{ Tenant: args.Tenant, - APIOpts: args.Opts, + APIOpts: args.APIOpts, }, utils.MetaReplicator, utils.ReplicatorSv1SetRatingProfile, args, rpl) } -func (dS *DispatcherService) ReplicatorSv1SetRouteProfile(args *engine.RouteProfileWithOpts, rpl *string) (err error) { +func (dS *DispatcherService) ReplicatorSv1SetRouteProfile(args *engine.RouteProfileWithAPIOpts, rpl *string) (err error) { if args == nil { - args = &engine.RouteProfileWithOpts{} + args = &engine.RouteProfileWithAPIOpts{} } args.Tenant = utils.FirstNonEmpty(args.Tenant, dS.cfg.GeneralCfg().DefaultTenant) if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { if err = dS.authorize(utils.ReplicatorSv1SetRouteProfile, args.Tenant, - utils.IfaceAsString(args.Opts[utils.OptsAPIKey]), utils.TimePointer(time.Now())); err != nil { + utils.IfaceAsString(args.APIOpts[utils.OptsAPIKey]), utils.TimePointer(time.Now())); err != nil { return } } return dS.Dispatch(&utils.CGREvent{ Tenant: args.Tenant, - APIOpts: args.Opts, + APIOpts: args.APIOpts, }, utils.MetaReplicator, utils.ReplicatorSv1SetRouteProfile, args, rpl) } -func (dS *DispatcherService) ReplicatorSv1SetAttributeProfile(args *engine.AttributeProfileWithOpts, rpl *string) (err error) { +func (dS *DispatcherService) ReplicatorSv1SetAttributeProfile(args *engine.AttributeProfileWithAPIOpts, rpl *string) (err error) { if args == nil { - args = &engine.AttributeProfileWithOpts{} + args = &engine.AttributeProfileWithAPIOpts{} } args.Tenant = utils.FirstNonEmpty(args.Tenant, dS.cfg.GeneralCfg().DefaultTenant) if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { if err = dS.authorize(utils.ReplicatorSv1SetAttributeProfile, args.Tenant, - utils.IfaceAsString(args.Opts[utils.OptsAPIKey]), utils.TimePointer(time.Now())); err != nil { + utils.IfaceAsString(args.APIOpts[utils.OptsAPIKey]), utils.TimePointer(time.Now())); err != nil { return } } return dS.Dispatch(&utils.CGREvent{ Tenant: args.Tenant, - APIOpts: args.Opts, + APIOpts: args.APIOpts, }, utils.MetaReplicator, utils.ReplicatorSv1SetAttributeProfile, args, rpl) } -func (dS *DispatcherService) ReplicatorSv1SetChargerProfile(args *engine.ChargerProfileWithOpts, rpl *string) (err error) { +func (dS *DispatcherService) ReplicatorSv1SetChargerProfile(args *engine.ChargerProfileWithAPIOpts, rpl *string) (err error) { if args == nil { - args = &engine.ChargerProfileWithOpts{} + args = &engine.ChargerProfileWithAPIOpts{} } args.Tenant = utils.FirstNonEmpty(args.Tenant, dS.cfg.GeneralCfg().DefaultTenant) if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { if err = dS.authorize(utils.ReplicatorSv1SetChargerProfile, args.Tenant, - utils.IfaceAsString(args.Opts[utils.OptsAPIKey]), utils.TimePointer(time.Now())); err != nil { + utils.IfaceAsString(args.APIOpts[utils.OptsAPIKey]), utils.TimePointer(time.Now())); err != nil { return } } return dS.Dispatch(&utils.CGREvent{ Tenant: args.Tenant, - APIOpts: args.Opts, + APIOpts: args.APIOpts, }, utils.MetaReplicator, utils.ReplicatorSv1SetChargerProfile, args, rpl) } -func (dS *DispatcherService) ReplicatorSv1SetDispatcherProfile(args *engine.DispatcherProfileWithOpts, rpl *string) (err error) { +func (dS *DispatcherService) ReplicatorSv1SetDispatcherProfile(args *engine.DispatcherProfileWithAPIOpts, rpl *string) (err error) { if args == nil { - args = &engine.DispatcherProfileWithOpts{} + args = &engine.DispatcherProfileWithAPIOpts{} } args.Tenant = utils.FirstNonEmpty(args.Tenant, dS.cfg.GeneralCfg().DefaultTenant) if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { if err = dS.authorize(utils.ReplicatorSv1SetDispatcherProfile, args.Tenant, - utils.IfaceAsString(args.Opts[utils.OptsAPIKey]), utils.TimePointer(time.Now())); err != nil { + utils.IfaceAsString(args.APIOpts[utils.OptsAPIKey]), utils.TimePointer(time.Now())); err != nil { return } } return dS.Dispatch(&utils.CGREvent{ Tenant: args.Tenant, - APIOpts: args.Opts, + APIOpts: args.APIOpts, }, utils.MetaReplicator, utils.ReplicatorSv1SetDispatcherProfile, args, rpl) } -func (dS *DispatcherService) ReplicatorSv1SetRateProfile(args *utils.RateProfileWithOpts, rpl *string) (err error) { +func (dS *DispatcherService) ReplicatorSv1SetRateProfile(args *utils.RateProfileWithAPIOpts, rpl *string) (err error) { if args == nil { - args = &utils.RateProfileWithOpts{} + args = &utils.RateProfileWithAPIOpts{} } args.Tenant = utils.FirstNonEmpty(args.Tenant, dS.cfg.GeneralCfg().DefaultTenant) if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { if err = dS.authorize(utils.ReplicatorSv1SetRateProfile, args.Tenant, - utils.IfaceAsString(args.Opts[utils.OptsAPIKey]), utils.TimePointer(time.Now())); err != nil { + utils.IfaceAsString(args.APIOpts[utils.OptsAPIKey]), utils.TimePointer(time.Now())); err != nil { return } } return dS.Dispatch(&utils.CGREvent{ Tenant: args.Tenant, - APIOpts: args.Opts, + APIOpts: args.APIOpts, }, utils.MetaReplicator, utils.ReplicatorSv1SetRateProfile, args, rpl) } @@ -886,54 +886,54 @@ func (dS *DispatcherService) ReplicatorSv1SetActionProfile(args *engine.ActionPr }, utils.MetaReplicator, utils.ReplicatorSv1SetActionProfile, args, rpl) } -func (dS *DispatcherService) ReplicatorSv1SetActionPlan(args *engine.SetActionPlanArgWithOpts, rpl *string) (err error) { +func (dS *DispatcherService) ReplicatorSv1SetActionPlan(args *engine.SetActionPlanArgWithAPIOpts, rpl *string) (err error) { if args == nil { - args = &engine.SetActionPlanArgWithOpts{} + args = &engine.SetActionPlanArgWithAPIOpts{} } args.Tenant = utils.FirstNonEmpty(args.Tenant, dS.cfg.GeneralCfg().DefaultTenant) if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { if err = dS.authorize(utils.ReplicatorSv1SetActionPlan, args.Tenant, - utils.IfaceAsString(args.Opts[utils.OptsAPIKey]), utils.TimePointer(time.Now())); err != nil { + utils.IfaceAsString(args.APIOpts[utils.OptsAPIKey]), utils.TimePointer(time.Now())); err != nil { return } } return dS.Dispatch(&utils.CGREvent{ Tenant: args.Tenant, - APIOpts: args.Opts, + APIOpts: args.APIOpts, }, utils.MetaReplicator, utils.ReplicatorSv1SetActionPlan, args, rpl) } -func (dS *DispatcherService) ReplicatorSv1SetAccountActionPlans(args *engine.SetAccountActionPlansArgWithOpts, rpl *string) (err error) { +func (dS *DispatcherService) ReplicatorSv1SetAccountActionPlans(args *engine.SetAccountActionPlansArgWithAPIOpts, rpl *string) (err error) { if args == nil { - args = &engine.SetAccountActionPlansArgWithOpts{} + args = &engine.SetAccountActionPlansArgWithAPIOpts{} } args.Tenant = utils.FirstNonEmpty(args.Tenant, dS.cfg.GeneralCfg().DefaultTenant) if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { if err = dS.authorize(utils.ReplicatorSv1SetAccountActionPlans, args.Tenant, - utils.IfaceAsString(args.Opts[utils.OptsAPIKey]), utils.TimePointer(time.Now())); err != nil { + utils.IfaceAsString(args.APIOpts[utils.OptsAPIKey]), utils.TimePointer(time.Now())); err != nil { return } } return dS.Dispatch(&utils.CGREvent{ Tenant: args.Tenant, - APIOpts: args.Opts, + APIOpts: args.APIOpts, }, utils.MetaReplicator, utils.ReplicatorSv1SetAccountActionPlans, args, rpl) } -func (dS *DispatcherService) ReplicatorSv1SetDispatcherHost(args *engine.DispatcherHostWithOpts, rpl *string) (err error) { +func (dS *DispatcherService) ReplicatorSv1SetDispatcherHost(args *engine.DispatcherHostWithAPIOpts, rpl *string) (err error) { if args == nil { - args = &engine.DispatcherHostWithOpts{} + args = &engine.DispatcherHostWithAPIOpts{} } args.Tenant = utils.FirstNonEmpty(args.Tenant, dS.cfg.GeneralCfg().DefaultTenant) if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { if err = dS.authorize(utils.ReplicatorSv1SetDispatcherHost, args.Tenant, - utils.IfaceAsString(args.Opts[utils.OptsAPIKey]), utils.TimePointer(time.Now())); err != nil { + utils.IfaceAsString(args.APIOpts[utils.OptsAPIKey]), utils.TimePointer(time.Now())); err != nil { return } } return dS.Dispatch(&utils.CGREvent{ Tenant: args.Tenant, - APIOpts: args.Opts, + APIOpts: args.APIOpts, }, utils.MetaReplicator, utils.ReplicatorSv1SetDispatcherHost, args, rpl) } @@ -971,20 +971,20 @@ func (dS *DispatcherService) ReplicatorSv1RemoveDestination(args *utils.StringWi }, utils.MetaReplicator, utils.ReplicatorSv1RemoveDestination, args, rpl) } -func (dS *DispatcherService) ReplicatorSv1SetLoadIDs(args *utils.LoadIDsWithOpts, rpl *string) (err error) { +func (dS *DispatcherService) ReplicatorSv1SetLoadIDs(args *utils.LoadIDsWithAPIOpts, rpl *string) (err error) { if args == nil { - args = &utils.LoadIDsWithOpts{} + args = &utils.LoadIDsWithAPIOpts{} } args.Tenant = utils.FirstNonEmpty(args.Tenant, dS.cfg.GeneralCfg().DefaultTenant) if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { if err = dS.authorize(utils.ReplicatorSv1SetLoadIDs, args.Tenant, - utils.IfaceAsString(args.Opts[utils.OptsAPIKey]), utils.TimePointer(time.Now())); err != nil { + utils.IfaceAsString(args.APIOpts[utils.OptsAPIKey]), utils.TimePointer(time.Now())); err != nil { return } } return dS.Dispatch(&utils.CGREvent{ Tenant: args.Tenant, - APIOpts: args.Opts, + APIOpts: args.APIOpts, }, utils.MetaReplicator, utils.ReplicatorSv1SetLoadIDs, args, rpl) } diff --git a/dispatchers/replicator_it_test.go b/dispatchers/replicator_it_test.go index 1bb4b1fdc..dabfa8510 100644 --- a/dispatchers/replicator_it_test.go +++ b/dispatchers/replicator_it_test.go @@ -196,12 +196,12 @@ func testDspRplAccount(t *testing.T) { func testDspRplSupplierProfile(t *testing.T) { // Set RouteProfile var replyStr string - argSetSupplierProfile := &engine.RouteProfileWithOpts{ + argSetSupplierProfile := &engine.RouteProfileWithAPIOpts{ RouteProfile: &engine.RouteProfile{ Tenant: "cgrates.org", ID: "ID", }, - Opts: map[string]interface{}{ + APIOpts: map[string]interface{}{ utils.OptsAPIKey: "repl12345", }, } @@ -257,12 +257,12 @@ func testDspRplSupplierProfile(t *testing.T) { func testDspRplAttributeProfile(t *testing.T) { // Set AttributeProfile var replyStr string - setAttributeProfile := &engine.AttributeProfileWithOpts{ + setAttributeProfile := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "cgrates.org", ID: "id", }, - Opts: map[string]interface{}{ + APIOpts: map[string]interface{}{ utils.OptsAPIKey: "repl12345", }, } @@ -317,12 +317,12 @@ func testDspRplAttributeProfile(t *testing.T) { func testDspRplChargerProfile(t *testing.T) { // Set ChargerProfile var replyStr string - setChargerProfile := &engine.ChargerProfileWithOpts{ + setChargerProfile := &engine.ChargerProfileWithAPIOpts{ ChargerProfile: &engine.ChargerProfile{ ID: "id", Tenant: "cgrates.org", }, - Opts: map[string]interface{}{ + APIOpts: map[string]interface{}{ utils.OptsAPIKey: "repl12345", }, } @@ -376,12 +376,12 @@ func testDspRplChargerProfile(t *testing.T) { func testDspRplDispatcherProfile(t *testing.T) { // Set DispatcherProfile var replyStr string - setDispatcherProfile := &engine.DispatcherProfileWithOpts{ + setDispatcherProfile := &engine.DispatcherProfileWithAPIOpts{ DispatcherProfile: &engine.DispatcherProfile{ Tenant: "cgrates.org", ID: "ID", }, - Opts: map[string]interface{}{ + APIOpts: map[string]interface{}{ utils.OptsAPIKey: "repl12345", }, } @@ -435,14 +435,14 @@ func testDspRplDispatcherProfile(t *testing.T) { func testDspRplDispatcherHost(t *testing.T) { // Set DispatcherHost var replyStr string - setDispatcherHost := &engine.DispatcherHostWithOpts{ + setDispatcherHost := &engine.DispatcherHostWithAPIOpts{ DispatcherHost: &engine.DispatcherHost{ Tenant: "cgrates.org", RemoteHost: &config.RemoteHost{ ID: "ID", }, }, - Opts: map[string]interface{}{ + APIOpts: map[string]interface{}{ utils.OptsAPIKey: "repl12345", }, } @@ -1021,11 +1021,11 @@ func testDspRplActionTriggers(t *testing.T) { func testDspRplSharedGroup(t *testing.T) { // Set SharedGroup var replyStr string - setSharedGroup := &engine.SharedGroupWithOpts{ + setSharedGroup := &engine.SharedGroupWithAPIOpts{ SharedGroup: &engine.SharedGroup{ Id: "IDSharedGroup", }, - Opts: map[string]interface{}{ + APIOpts: map[string]interface{}{ utils.OptsAPIKey: "repl12345", }, } @@ -1075,7 +1075,7 @@ func testDspRplSharedGroup(t *testing.T) { func testDspRplActions(t *testing.T) { // Set Actions var replyStr string - setActions := &engine.SetActionsArgsWithOpts{ + setActions := &engine.SetActionsArgsWithAPIOpts{ Acs: engine.Actions{ &engine.Action{ Id: "Action1", @@ -1084,7 +1084,7 @@ func testDspRplActions(t *testing.T) { }, Key: "KeyActions", Tenant: "cgrates.org", - Opts: map[string]interface{}{ + APIOpts: map[string]interface{}{ utils.OptsAPIKey: "repl12345", }, } @@ -1136,7 +1136,7 @@ func testDspRplActions(t *testing.T) { func testDspRplActionPlan(t *testing.T) { // Set ActionPlan var replyStr string - setActionPlan := &engine.SetActionPlanArgWithOpts{ + setActionPlan := &engine.SetActionPlanArgWithAPIOpts{ Ats: &engine.ActionPlan{ Id: "idtas", AccountIDs: utils.StringMap{ @@ -1150,7 +1150,7 @@ func testDspRplActionPlan(t *testing.T) { }, Key: "KeyActionPlan", Tenant: "cgrates.org", - Opts: map[string]interface{}{ + APIOpts: map[string]interface{}{ utils.OptsAPIKey: "repl12345", }, } @@ -1200,12 +1200,12 @@ func testDspRplActionPlan(t *testing.T) { func testDspRplAccountActionPlans(t *testing.T) { // Set AccountActionPlans var replyStr string - setAccountActionPlans := &engine.SetAccountActionPlansArgWithOpts{ + setAccountActionPlans := &engine.SetAccountActionPlansArgWithAPIOpts{ AplIDs: []string{"KeyAccountActionPlans"}, Overwrite: true, AcntID: "KeyAccountActionPlans", Tenant: "cgrates.org", - Opts: map[string]interface{}{ + APIOpts: map[string]interface{}{ utils.OptsAPIKey: "repl12345", }, } @@ -1255,7 +1255,7 @@ func testDspRplAccountActionPlans(t *testing.T) { func testDspRplRatingPlan(t *testing.T) { // Set RatingPlan var replyStr string - setRatingPlan := &engine.RatingPlanWithOpts{ + setRatingPlan := &engine.RatingPlanWithAPIOpts{ RatingPlan: &engine.RatingPlan{ Id: "id", DestinationRates: map[string]engine.RPRateList{ @@ -1264,7 +1264,7 @@ func testDspRplRatingPlan(t *testing.T) { Timings: map[string]*engine.RITiming{"Timings": {Months: utils.Months{4}}}, }, Tenant: "cgrates.org", - Opts: map[string]interface{}{ + APIOpts: map[string]interface{}{ utils.OptsAPIKey: "repl12345", }, } @@ -1314,14 +1314,14 @@ func testDspRplRatingPlan(t *testing.T) { func testDspRplRatingProfile(t *testing.T) { // Set RatingProfile var replyStr string - setRatingProfile := &engine.RatingProfileWithOpts{ + setRatingProfile := &engine.RatingProfileWithAPIOpts{ RatingProfile: &engine.RatingProfile{ Id: "idRatingProfile", RatingPlanActivations: engine.RatingPlanActivations{ &engine.RatingPlanActivation{RatingPlanId: "RatingPlanId"}}, }, Tenant: "cgrates.org", - Opts: map[string]interface{}{ + APIOpts: map[string]interface{}{ utils.OptsAPIKey: "repl12345", }, } @@ -1426,12 +1426,12 @@ func testDspRplDestination(t *testing.T) { func testDspRplLoadIDs(t *testing.T) { // Set LoadIDs var replyStr string - setLoadIDs := &utils.LoadIDsWithOpts{ + setLoadIDs := &utils.LoadIDsWithAPIOpts{ LoadIDs: map[string]int64{ "LoadID1": 1, "LoadID2": 2}, Tenant: "cgrates.org", - Opts: map[string]interface{}{ + APIOpts: map[string]interface{}{ utils.OptsAPIKey: "repl12345", }, } @@ -1473,7 +1473,7 @@ func testDspRplLoadIDs(t *testing.T) { func testDspRplRateProfile(t *testing.T) { // Set RateProfile var replyStr string - rPrf := &utils.RateProfileWithOpts{ + rPrf := &utils.RateProfileWithAPIOpts{ RateProfile: &utils.RateProfile{ Tenant: "cgrates.org", ID: "RP1", @@ -1507,7 +1507,7 @@ func testDspRplRateProfile(t *testing.T) { }, }, }, - Opts: map[string]interface{}{ + APIOpts: map[string]interface{}{ utils.OptsAPIKey: "repl12345", }, } diff --git a/engine/caches.go b/engine/caches.go index d3756655c..83e7bb7b1 100644 --- a/engine/caches.go +++ b/engine/caches.go @@ -37,7 +37,7 @@ var Cache *CacheS func init() { Cache = NewCacheS(config.CgrConfig(), nil, nil) gob.Register(new(AttributeProfile)) - gob.Register(new(AttributeProfileWithOpts)) + gob.Register(new(AttributeProfileWithAPIOpts)) // Threshold gob.Register(new(Threshold)) gob.Register(new(ThresholdProfile)) @@ -56,17 +56,17 @@ func init() { gob.Register(new(StatQueueProfileWithOpts)) // RouteS gob.Register(new(RouteProfile)) - gob.Register(new(RouteProfileWithOpts)) + gob.Register(new(RouteProfileWithAPIOpts)) // Filters gob.Register(new(Filter)) gob.Register(new(FilterWithAPIOpts)) // Dispatcher gob.Register(new(DispatcherHost)) gob.Register(new(DispatcherHostProfile)) - gob.Register(new(DispatcherHostWithOpts)) + gob.Register(new(DispatcherHostWithAPIOpts)) // RateProfiles gob.Register(new(utils.RateProfile)) - gob.Register(new(utils.RateProfileWithOpts)) + gob.Register(new(utils.RateProfileWithAPIOpts)) // ActionProfiles gob.Register(new(ActionProfile)) gob.Register(new(ActionProfileWithAPIOpts)) diff --git a/engine/datamanager.go b/engine/datamanager.go index aa5d35fcc..8110e90fa 100644 --- a/engine/datamanager.go +++ b/engine/datamanager.go @@ -1817,10 +1817,10 @@ func (dm *DataManager) SetSharedGroup(sg *SharedGroup, config.CgrConfig().DataDbCfg().RplFiltered, utils.SharedGroupPrefix, sg.Id, // this are used to get the host IDs from cache utils.ReplicatorSv1SetSharedGroup, - &SharedGroupWithOpts{ + &SharedGroupWithAPIOpts{ SharedGroup: sg, Tenant: config.CgrConfig().GeneralCfg().DefaultTenant, - Opts: utils.GenerateDBItemOpts(itm.APIKey, itm.RouteID, + APIOpts: utils.GenerateDBItemOpts(itm.APIKey, itm.RouteID, config.CgrConfig().DataDbCfg().RplCache, utils.EmptyString)}) } return @@ -1900,11 +1900,11 @@ func (dm *DataManager) GetActions(key string, skipCache bool, transactionID stri } //SetActionsArgsWithOpts is used to send the key and the Actions to replicator -type SetActionsArgsWithOpts struct { - Key string - Acs Actions - Tenant string - Opts map[string]interface{} +type SetActionsArgsWithAPIOpts struct { + Key string + Acs Actions + Tenant string + APIOpts map[string]interface{} } func (dm *DataManager) SetActions(key string, as Actions, transactionID string) (err error) { @@ -1919,11 +1919,11 @@ func (dm *DataManager) SetActions(key string, as Actions, transactionID string) config.CgrConfig().DataDbCfg().RplFiltered, utils.ActionPrefix, key, // this are used to get the host IDs from cache utils.ReplicatorSv1SetActions, - &SetActionsArgsWithOpts{ + &SetActionsArgsWithAPIOpts{ Key: key, Acs: as, Tenant: config.CgrConfig().GeneralCfg().DefaultTenant, - Opts: utils.GenerateDBItemOpts(itm.APIKey, itm.RouteID, + APIOpts: utils.GenerateDBItemOpts(itm.APIKey, itm.RouteID, config.CgrConfig().DataDbCfg().RplCache, utils.EmptyString)}) } return @@ -1975,13 +1975,13 @@ func (dm *DataManager) GetActionPlan(key string, skipCache bool, transactionID s return } -// SetActionPlanArgWithOpts is used in replicatorV1 for dispatcher -type SetActionPlanArgWithOpts struct { +// SetActionPlanArgWithAPIOpts is used in replicatorV1 for dispatcher +type SetActionPlanArgWithAPIOpts struct { Key string Ats *ActionPlan Overwrite bool Tenant string - Opts map[string]interface{} + APIOpts map[string]interface{} } func (dm *DataManager) SetActionPlan(key string, ats *ActionPlan, @@ -1997,12 +1997,12 @@ func (dm *DataManager) SetActionPlan(key string, ats *ActionPlan, config.CgrConfig().DataDbCfg().RplFiltered, utils.ActionPlanPrefix, key, // this are used to get the host IDs from cache utils.ReplicatorSv1SetActionPlan, - &SetActionPlanArgWithOpts{ + &SetActionPlanArgWithAPIOpts{ Key: key, Ats: ats, Overwrite: overwrite, Tenant: config.CgrConfig().GeneralCfg().DefaultTenant, - Opts: utils.GenerateDBItemOpts(itm.APIKey, itm.RouteID, + APIOpts: utils.GenerateDBItemOpts(itm.APIKey, itm.RouteID, config.CgrConfig().DataDbCfg().RplCache, utils.EmptyString)}) } return @@ -2079,13 +2079,13 @@ func (dm *DataManager) GetAccountActionPlans(acntID string, return } -//SetAccountActionPlansArgWithOpts is used to send the key and the Actions to replicator -type SetAccountActionPlansArgWithOpts struct { +//SetAccountActionPlansArgWithAPIOpts is used to send the key and the Actions to replicator +type SetAccountActionPlansArgWithAPIOpts struct { AcntID string AplIDs []string Overwrite bool Tenant string - Opts map[string]interface{} + APIOpts map[string]interface{} } func (dm *DataManager) SetAccountActionPlans(acntID string, aPlIDs []string, overwrite bool) (err error) { @@ -2100,12 +2100,12 @@ func (dm *DataManager) SetAccountActionPlans(acntID string, aPlIDs []string, ove config.CgrConfig().DataDbCfg().RplFiltered, utils.AccountActionPlansPrefix, acntID, // this are used to get the host IDs from cache utils.ReplicatorSv1SetAccountActionPlans, - &SetAccountActionPlansArgWithOpts{ + &SetAccountActionPlansArgWithAPIOpts{ AcntID: acntID, AplIDs: aPlIDs, Overwrite: overwrite, Tenant: config.CgrConfig().GeneralCfg().DefaultTenant, - Opts: utils.GenerateDBItemOpts(itm.APIKey, itm.RouteID, + APIOpts: utils.GenerateDBItemOpts(itm.APIKey, itm.RouteID, config.CgrConfig().DataDbCfg().RplCache, utils.EmptyString)}) } return @@ -2203,10 +2203,10 @@ func (dm *DataManager) SetRatingPlan(rp *RatingPlan, transactionID string) (err config.CgrConfig().DataDbCfg().RplFiltered, utils.RatingPlanPrefix, rp.Id, // this are used to get the host IDs from cache utils.ReplicatorSv1SetRatingPlan, - &RatingPlanWithOpts{ + &RatingPlanWithAPIOpts{ RatingPlan: rp, Tenant: config.CgrConfig().GeneralCfg().DefaultTenant, - Opts: utils.GenerateDBItemOpts(itm.APIKey, itm.RouteID, + APIOpts: utils.GenerateDBItemOpts(itm.APIKey, itm.RouteID, config.CgrConfig().DataDbCfg().RplCache, utils.EmptyString)}) } return @@ -2300,10 +2300,10 @@ func (dm *DataManager) SetRatingProfile(rpf *RatingProfile, config.CgrConfig().DataDbCfg().RplFiltered, utils.RatingProfilePrefix, rpf.Id, // this are used to get the host IDs from cache utils.ReplicatorSv1SetRatingProfile, - &RatingProfileWithOpts{ + &RatingProfileWithAPIOpts{ RatingProfile: rpf, Tenant: config.CgrConfig().GeneralCfg().DefaultTenant, - Opts: utils.GenerateDBItemOpts(itm.APIKey, itm.RouteID, + APIOpts: utils.GenerateDBItemOpts(itm.APIKey, itm.RouteID, config.CgrConfig().DataDbCfg().RplCache, utils.EmptyString)}) } return @@ -2425,9 +2425,9 @@ func (dm *DataManager) SetRouteProfile(rpp *RouteProfile, withIndex bool) (err e config.CgrConfig().DataDbCfg().RplFiltered, utils.RouteProfilePrefix, rpp.TenantID(), // this are used to get the host IDs from cache utils.ReplicatorSv1SetRouteProfile, - &RouteProfileWithOpts{ + &RouteProfileWithAPIOpts{ RouteProfile: rpp, - Opts: utils.GenerateDBItemOpts(itm.APIKey, itm.RouteID, + APIOpts: utils.GenerateDBItemOpts(itm.APIKey, itm.RouteID, config.CgrConfig().DataDbCfg().RplCache, utils.EmptyString)}) } return @@ -2561,9 +2561,9 @@ func (dm *DataManager) SetAttributeProfile(ap *AttributeProfile, withIndex bool) config.CgrConfig().DataDbCfg().RplFiltered, utils.AttributeProfilePrefix, ap.TenantID(), // this are used to get the host IDs from cache utils.ReplicatorSv1SetAttributeProfile, - &AttributeProfileWithOpts{ + &AttributeProfileWithAPIOpts{ AttributeProfile: ap, - Opts: utils.GenerateDBItemOpts(itm.APIKey, itm.RouteID, + APIOpts: utils.GenerateDBItemOpts(itm.APIKey, itm.RouteID, config.CgrConfig().DataDbCfg().RplCache, utils.EmptyString)}) } return @@ -2690,9 +2690,9 @@ func (dm *DataManager) SetChargerProfile(cpp *ChargerProfile, withIndex bool) (e config.CgrConfig().DataDbCfg().RplFiltered, utils.ChargerProfilePrefix, cpp.TenantID(), // this are used to get the host IDs from cache utils.ReplicatorSv1SetChargerProfile, - &ChargerProfileWithOpts{ + &ChargerProfileWithAPIOpts{ ChargerProfile: cpp, - Opts: utils.GenerateDBItemOpts(itm.APIKey, itm.RouteID, + APIOpts: utils.GenerateDBItemOpts(itm.APIKey, itm.RouteID, config.CgrConfig().DataDbCfg().RplCache, utils.EmptyString)}) } return @@ -2820,9 +2820,9 @@ func (dm *DataManager) SetDispatcherProfile(dpp *DispatcherProfile, withIndex bo config.CgrConfig().DataDbCfg().RplFiltered, utils.DispatcherProfilePrefix, dpp.TenantID(), // this are used to get the host IDs from cache utils.ReplicatorSv1SetDispatcherProfile, - &DispatcherProfileWithOpts{ + &DispatcherProfileWithAPIOpts{ DispatcherProfile: dpp, - Opts: utils.GenerateDBItemOpts(itm.APIKey, itm.RouteID, + APIOpts: utils.GenerateDBItemOpts(itm.APIKey, itm.RouteID, config.CgrConfig().DataDbCfg().RplCache, utils.EmptyString)}) } return @@ -2929,9 +2929,9 @@ func (dm *DataManager) SetDispatcherHost(dpp *DispatcherHost) (err error) { config.CgrConfig().DataDbCfg().RplFiltered, utils.DispatcherHostPrefix, dpp.TenantID(), // this are used to get the host IDs from cache utils.ReplicatorSv1SetDispatcherHost, - &DispatcherHostWithOpts{ + &DispatcherHostWithAPIOpts{ DispatcherHost: dpp, - Opts: utils.GenerateDBItemOpts(itm.APIKey, itm.RouteID, + APIOpts: utils.GenerateDBItemOpts(itm.APIKey, itm.RouteID, config.CgrConfig().DataDbCfg().RplCache, utils.EmptyString)}) } return @@ -3027,10 +3027,10 @@ func (dm *DataManager) SetLoadIDs(loadIDs map[string]int64) (err error) { config.CgrConfig().DataDbCfg().RplFiltered, utils.LoadIDPrefix, objIDs, // this are used to get the host IDs from cache utils.ReplicatorSv1SetLoadIDs, - &utils.LoadIDsWithOpts{ + &utils.LoadIDsWithAPIOpts{ LoadIDs: loadIDs, Tenant: config.CgrConfig().GeneralCfg().DefaultTenant, - Opts: utils.GenerateDBItemOpts(itm.APIKey, itm.RouteID, + APIOpts: utils.GenerateDBItemOpts(itm.APIKey, itm.RouteID, config.CgrConfig().DataDbCfg().RplCache, utils.EmptyString)}) } return @@ -3158,9 +3158,9 @@ func (dm *DataManager) SetRateProfile(rpp *utils.RateProfile, withIndex bool) (e config.CgrConfig().DataDbCfg().RplFiltered, utils.RateProfilePrefix, rpp.TenantID(), // this are used to get the host IDs from cache utils.ReplicatorSv1SetRateProfile, - &utils.RateProfileWithOpts{ + &utils.RateProfileWithAPIOpts{ RateProfile: rpp, - Opts: utils.GenerateDBItemOpts(itm.APIKey, itm.RouteID, + APIOpts: utils.GenerateDBItemOpts(itm.APIKey, itm.RouteID, config.CgrConfig().DataDbCfg().RplCache, utils.EmptyString)}) } return @@ -3248,9 +3248,9 @@ func (dm *DataManager) RemoveRateProfileRates(tenant, id string, rateIDs []strin config.CgrConfig().DataDbCfg().RplFiltered, utils.RateProfilePrefix, oldRpp.TenantID(), // this are used to get the host IDs from cache utils.ReplicatorSv1SetRateProfile, - &utils.RateProfileWithOpts{ + &utils.RateProfileWithAPIOpts{ RateProfile: oldRpp, - Opts: utils.GenerateDBItemOpts(itm.APIKey, itm.RouteID, + APIOpts: utils.GenerateDBItemOpts(itm.APIKey, itm.RouteID, config.CgrConfig().DataDbCfg().RplCache, utils.EmptyString)}) } return @@ -3298,9 +3298,9 @@ func (dm *DataManager) SetRateProfileRates(rpp *utils.RateProfile, withIndex boo config.CgrConfig().DataDbCfg().RplFiltered, utils.RateProfilePrefix, oldRpp.TenantID(), // this are used to get the host IDs from cache utils.ReplicatorSv1SetRateProfile, - &utils.RateProfileWithOpts{ + &utils.RateProfileWithAPIOpts{ RateProfile: oldRpp, - Opts: utils.GenerateDBItemOpts(itm.APIKey, itm.RouteID, + APIOpts: utils.GenerateDBItemOpts(itm.APIKey, itm.RouteID, config.CgrConfig().DataDbCfg().RplCache, utils.EmptyString)}) } return diff --git a/engine/dispatcherprfl.go b/engine/dispatcherprfl.go index 8a81ae4b5..7dca7f417 100644 --- a/engine/dispatcherprfl.go +++ b/engine/dispatcherprfl.go @@ -113,10 +113,10 @@ type DispatcherProfile struct { Hosts DispatcherHostProfiles // dispatch to these connections } -// DispatcherProfileWithOpts is used in replicatorV1 for dispatcher -type DispatcherProfileWithOpts struct { +// DispatcherProfileWithAPIOpts is used in replicatorV1 for dispatcher +type DispatcherProfileWithAPIOpts struct { *DispatcherProfile - Opts map[string]interface{} + APIOpts map[string]interface{} } func (dP *DispatcherProfile) TenantID() string { @@ -139,9 +139,9 @@ type DispatcherHost struct { } // DispatcherHostWithOpts is used in replicatorV1 for dispatcher -type DispatcherHostWithOpts struct { +type DispatcherHostWithAPIOpts struct { *DispatcherHost - Opts map[string]interface{} + APIOpts map[string]interface{} } // TenantID returns the tenant concatenated with the ID diff --git a/engine/libattributes.go b/engine/libattributes.go index 024918ab5..645ad9506 100644 --- a/engine/libattributes.go +++ b/engine/libattributes.go @@ -47,10 +47,10 @@ type AttributeProfile struct { Weight float64 } -// AttributeProfileWithOpts is used in replicatorV1 for dispatcher -type AttributeProfileWithOpts struct { +// AttributeProfileWithAPIOpts is used in replicatorV1 for dispatcher +type AttributeProfileWithAPIOpts struct { *AttributeProfile - Opts map[string]interface{} + APIOpts map[string]interface{} } func (ap *AttributeProfile) compileSubstitutes() (err error) { diff --git a/engine/libchargers.go b/engine/libchargers.go index ec1b379f2..72378dd02 100644 --- a/engine/libchargers.go +++ b/engine/libchargers.go @@ -35,10 +35,10 @@ type ChargerProfile struct { Weight float64 } -// ChargerProfileWithOpts is used in replicatorV1 for dispatcher -type ChargerProfileWithOpts struct { +// ChargerProfileWithAPIOpts is used in replicatorV1 for dispatcher +type ChargerProfileWithAPIOpts struct { *ChargerProfile - Opts map[string]interface{} + APIOpts map[string]interface{} } func (cP *ChargerProfile) TenantID() string { diff --git a/engine/ratingplan.go b/engine/ratingplan.go index 6ebacb8b3..256193897 100644 --- a/engine/ratingplan.go +++ b/engine/ratingplan.go @@ -33,10 +33,10 @@ type RatingPlan struct { } // RatingPlanWithOpts is used in replicatorV1 for dispatcher -type RatingPlanWithOpts struct { +type RatingPlanWithAPIOpts struct { *RatingPlan - Tenant string - Opts map[string]interface{} + Tenant string + APIOpts map[string]interface{} } type RPRate struct { diff --git a/engine/ratingprofile.go b/engine/ratingprofile.go index fd09e0db3..155483099 100644 --- a/engine/ratingprofile.go +++ b/engine/ratingprofile.go @@ -33,11 +33,11 @@ type RatingProfile struct { RatingPlanActivations RatingPlanActivations } -// RatingProfileWithOpts is used in replicatorV1 for dispatcher -type RatingProfileWithOpts struct { +// RatingProfileWithAPIOpts is used in replicatorV1 for dispatcher +type RatingProfileWithAPIOpts struct { *RatingProfile - Tenant string - Opts map[string]interface{} + Tenant string + APIOpts map[string]interface{} } type RatingPlanActivation struct { diff --git a/engine/routes.go b/engine/routes.go index a7702f391..76c312504 100644 --- a/engine/routes.go +++ b/engine/routes.go @@ -59,10 +59,10 @@ type RouteProfile struct { cache map[string]interface{} } -// RouteProfileWithOpts is used in replicatorV1 for dispatcher -type RouteProfileWithOpts struct { +// RouteProfileWithAPIOpts is used in replicatorV1 for dispatcher +type RouteProfileWithAPIOpts struct { *RouteProfile - Opts map[string]interface{} + APIOpts map[string]interface{} } func (rp *RouteProfile) compileCacheParameters() error { diff --git a/engine/sharedgroup.go b/engine/sharedgroup.go index c49c25017..ae4f565d5 100644 --- a/engine/sharedgroup.go +++ b/engine/sharedgroup.go @@ -45,10 +45,10 @@ type SharedGroup struct { } // SharedGroupWithOpts is used in replicatorV1 for dispatcher -type SharedGroupWithOpts struct { +type SharedGroupWithAPIOpts struct { *SharedGroup - Tenant string - Opts map[string]interface{} + Tenant string + APIOpts map[string]interface{} } type SharingParameters struct { diff --git a/general_tests/attributes_it_test.go b/general_tests/attributes_it_test.go index a7acdc60e..71d68d7aa 100644 --- a/general_tests/attributes_it_test.go +++ b/general_tests/attributes_it_test.go @@ -168,7 +168,7 @@ func testAttributeSProcessEvent(t *testing.T) { func testAttributeSProcessEventWithAccount(t *testing.T) { // add new attribute profile var result string - alsPrf := &engine.AttributeProfileWithOpts{ + alsPrf := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "cgrates.org", ID: "ATTR_ACCOUNT", @@ -250,7 +250,7 @@ func testAttributeSProcessEventWithAccount(t *testing.T) { func testAttributeSProcessEventWithAccountFull(t *testing.T) { // add new attribute profile var result string - alsPrf := &engine.AttributeProfileWithOpts{ + alsPrf := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "cgrates.org", ID: "ATTR_ACCOUNT2", @@ -380,7 +380,7 @@ func testAttributeSProcessEventWithStat(t *testing.T) { } // add new attribute profile - alsPrf := &engine.AttributeProfileWithOpts{ + alsPrf := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "cgrates.org", ID: "ATTR_STATS", @@ -463,7 +463,7 @@ func testAttributeSProcessEventWithStat(t *testing.T) { func testAttributeSProcessEventWithStatFull(t *testing.T) { // add new attribute profile - alsPrf := &engine.AttributeProfileWithOpts{ + alsPrf := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "cgrates.org", ID: "ATTR_STATS2", @@ -609,7 +609,7 @@ func testAttributeSProcessEventWithResource(t *testing.T) { } // add new attribute profile - alsPrf := &engine.AttributeProfileWithOpts{ + alsPrf := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "cgrates.org", ID: "ATTR_RESOURCE", @@ -692,7 +692,7 @@ func testAttributeSProcessEventWithResource(t *testing.T) { func testAttributeSProcessEventWithResourceFull(t *testing.T) { // add new attribute profile var result string - alsPrf := &engine.AttributeProfileWithOpts{ + alsPrf := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "cgrates.org", ID: "ATTR_RESOURCE2", @@ -783,7 +783,7 @@ func testAttributeSProcessEventWithResourceFull(t *testing.T) { func testAttributeSProcessEventWithLibPhoneNumber(t *testing.T) { // add new attribute profile var result string - alsPrf := &engine.AttributeProfileWithOpts{ + alsPrf := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "cgrates.org", ID: "ATTR_LIBPHONENUMBER2", @@ -867,7 +867,7 @@ func testAttributeSProcessEventWithLibPhoneNumber(t *testing.T) { func testAttributeSProcessEventWithLibPhoneNumberComposed(t *testing.T) { // add new attribute profile var result string - alsPrf := &engine.AttributeProfileWithOpts{ + alsPrf := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "cgrates.org", ID: "ATTR_LIBPHONENUMBER_COMPOSED", @@ -969,7 +969,7 @@ func testAttributeSProcessEventWithLibPhoneNumberComposed(t *testing.T) { func testAttributeSProcessEventWithLibPhoneNumberFull(t *testing.T) { // add new attribute profile var result string - alsPrf := &engine.AttributeProfileWithOpts{ + alsPrf := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "cgrates.org", ID: "ATTR_LIBPHONENUMBER", diff --git a/general_tests/cdrs_processevent_it_test.go b/general_tests/cdrs_processevent_it_test.go index c57ab3b88..cfea308f9 100644 --- a/general_tests/cdrs_processevent_it_test.go +++ b/general_tests/cdrs_processevent_it_test.go @@ -171,7 +171,7 @@ func testV1CDRsProcessEventAttrS(t *testing.T) { }, } var cdrs []*engine.CDR - alsPrf := &engine.AttributeProfileWithOpts{ + alsPrf := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "cgrates.org", ID: "ApierTest", diff --git a/general_tests/filtered_replication_it_test.go b/general_tests/filtered_replication_it_test.go index 93bacd30a..fe7ac80f7 100644 --- a/general_tests/filtered_replication_it_test.go +++ b/general_tests/filtered_replication_it_test.go @@ -158,7 +158,7 @@ func testFltrRplRPCConn(t *testing.T) { func testFltrRplAttributeProfile(t *testing.T) { attrID := "ATTR1" - attrPrf := &engine.AttributeProfileWithOpts{ + attrPrf := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "cgrates.org", ID: attrID, @@ -1242,7 +1242,7 @@ func testFltrRplDispatcherProfile(t *testing.T) { func testFltrRplDispatcherHost(t *testing.T) { dspID := "DSH1" - dspPrf := &engine.DispatcherHostWithOpts{ + dspPrf := &engine.DispatcherHostWithAPIOpts{ DispatcherHost: &engine.DispatcherHost{ Tenant: "cgrates.org", RemoteHost: &config.RemoteHost{ diff --git a/general_tests/filters_it_test.go b/general_tests/filters_it_test.go index 1b41e214f..630ba2f2a 100644 --- a/general_tests/filters_it_test.go +++ b/general_tests/filters_it_test.go @@ -1002,7 +1002,7 @@ func testV1FltrChargerSuffix(t *testing.T) { } func testV1FltrAttributesPrefix(t *testing.T) { - chargerProfile := &engine.AttributeProfileWithOpts{ + chargerProfile := &engine.AttributeProfileWithAPIOpts{ AttributeProfile: &engine.AttributeProfile{ Tenant: "cgrates.new", ID: "ATTR_1001", diff --git a/utils/coreutils.go b/utils/coreutils.go index ac80631cc..f43628afb 100644 --- a/utils/coreutils.go +++ b/utils/coreutils.go @@ -934,10 +934,10 @@ func RandomInteger(min, max int) int { return math_rand.Intn(max-min) + min } -type LoadIDsWithOpts struct { +type LoadIDsWithAPIOpts struct { LoadIDs map[string]int64 Tenant string - Opts map[string]interface{} + APIOpts map[string]interface{} } // IsURL returns if the path is an URL diff --git a/utils/librates.go b/utils/librates.go index 5f57353c5..346382214 100644 --- a/utils/librates.go +++ b/utils/librates.go @@ -115,10 +115,10 @@ func (rt *Rate) RunTimes(sTime, eTime time.Time, verbosity int) (aTimes [][]time return nil, ErrMaxIterationsReached } -// RateProfileWithOpts is used in replicatorV1 for dispatcher -type RateProfileWithOpts struct { +// RateProfileWithAPIOpts is used in replicatorV1 for dispatcher +type RateProfileWithAPIOpts struct { *RateProfile - Opts map[string]interface{} + APIOpts map[string]interface{} } // RateSInterval is used by RateS to integrate Rate info for one charging interval