mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-25 09:08:45 +05:00
remove V1 prefix from apis wrapper methods
This commit is contained in:
committed by
Dan Christian Bogos
parent
8f3093587f
commit
fb03793c6b
@@ -196,11 +196,11 @@ type AttributeSv1 struct {
|
||||
}
|
||||
|
||||
// V1GetAttributeForEvent returns the AttributeProfile that matches the event
|
||||
func (atrS *AttributeSv1) V1GetAttributeForEvent(ctx *context.Context, args *utils.CGREvent, attrPrf *utils.APIAttributeProfile) (err error) {
|
||||
return atrS.V1GetAttributeForEvent(ctx, args, attrPrf)
|
||||
func (atrS *AttributeSv1) GetAttributeForEvent(ctx *context.Context, args *utils.CGREvent, attrPrf *utils.APIAttributeProfile) (err error) {
|
||||
return atrS.atrs.V1GetAttributeForEvent(ctx, args, attrPrf)
|
||||
}
|
||||
|
||||
// V1ProcessEvent proccess the event and returns the result
|
||||
func (atrS *AttributeSv1) V1ProcessEvent(ctx *context.Context, args *utils.CGREvent, attrEvntRpl *attributes.AttrSProcessEventReply) (err error) {
|
||||
return atrS.V1ProcessEvent(ctx, args, attrEvntRpl)
|
||||
func (atrS *AttributeSv1) ProcessEvent(ctx *context.Context, args *utils.CGREvent, attrEvntRpl *attributes.AttrSProcessEventReply) (err error) {
|
||||
return atrS.atrs.V1ProcessEvent(ctx, args, attrEvntRpl)
|
||||
}
|
||||
|
||||
@@ -72,16 +72,16 @@ type CdrSv1 struct {
|
||||
}
|
||||
|
||||
// V1ProcessEvent will process the CGREvent
|
||||
func (cdrS *CdrSv1) V1ProcessEvent(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) {
|
||||
func (cdrS *CdrSv1) ProcessEvent(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) {
|
||||
return cdrS.cdrs.V1ProcessEvent(ctx, args, reply)
|
||||
}
|
||||
|
||||
// V1ProcessEventWithGet has the same logic with V1ProcessEvent except it adds the proccessed events to the reply
|
||||
func (cdrS *CdrSv1) V1ProcessEventWithGet(ctx *context.Context, args *utils.CGREvent, evs *[]*utils.EventsWithOpts) (err error) {
|
||||
func (cdrS *CdrSv1) ProcessEventWithGet(ctx *context.Context, args *utils.CGREvent, evs *[]*utils.EventsWithOpts) (err error) {
|
||||
return cdrS.cdrs.V1ProcessEventWithGet(ctx, args, evs)
|
||||
}
|
||||
|
||||
// V1ProcessStoredEvents processes stored events based on provided filters.
|
||||
func (cdrS *CdrSv1) V1ProcessStoredEvents(ctx *context.Context, args *utils.CDRFilters, reply *string) (err error) {
|
||||
func (cdrS *CdrSv1) ProcessStoredEvents(ctx *context.Context, args *utils.CDRFilters, reply *string) (err error) {
|
||||
return cdrS.cdrs.V1ProcessStoredEvents(ctx, args, reply)
|
||||
}
|
||||
|
||||
@@ -192,11 +192,11 @@ type ChargerSv1 struct {
|
||||
}
|
||||
|
||||
// V1ProcessEvent will process the event received via API and return list of events forked
|
||||
func (chgS *ChargerSv1) V1ProcessEvent(ctx *context.Context, args *utils.CGREvent, reply *[]*chargers.ChrgSProcessEventReply) (err error) {
|
||||
func (chgS *ChargerSv1) ProcessEvent(ctx *context.Context, args *utils.CGREvent, reply *[]*chargers.ChrgSProcessEventReply) (err error) {
|
||||
return chgS.chgs.V1ProcessEvent(ctx, args, reply)
|
||||
}
|
||||
|
||||
// V1GetChargersForEvent exposes the list of ordered matching ChargingProfiles for an event
|
||||
func (chgS *ChargerSv1) V1GetChargersForEvent(ctx *context.Context, args *utils.CGREvent, rply *[]*utils.ChargerProfile) (err error) {
|
||||
func (chgS *ChargerSv1) GetChargersForEvent(ctx *context.Context, args *utils.CGREvent, rply *[]*utils.ChargerProfile) (err error) {
|
||||
return chgS.chgs.V1GetChargersForEvent(ctx, args, rply)
|
||||
}
|
||||
|
||||
12
apis/ips.go
12
apis/ips.go
@@ -195,32 +195,32 @@ type IPSv1 struct {
|
||||
}
|
||||
|
||||
// V1GetIPAllocationForEvent returns the IPAllocations object matching the event.
|
||||
func (ipS *IPSv1) V1GetIPAllocationForEvent(ctx *context.Context, args *utils.CGREvent, reply *utils.IPAllocations) error {
|
||||
func (ipS *IPSv1) GetIPAllocationForEvent(ctx *context.Context, args *utils.CGREvent, reply *utils.IPAllocations) error {
|
||||
return ipS.ips.V1GetIPAllocationForEvent(ctx, args, reply)
|
||||
}
|
||||
|
||||
// V1AuthorizeIP checks if it's able to allocate an IP address for the given event.
|
||||
func (ipS *IPSv1) V1AuthorizeIP(ctx *context.Context, args *utils.CGREvent, reply *utils.AllocatedIP) error {
|
||||
func (ipS *IPSv1) AuthorizeIP(ctx *context.Context, args *utils.CGREvent, reply *utils.AllocatedIP) error {
|
||||
return ipS.ips.V1AuthorizeIP(ctx, args, reply)
|
||||
}
|
||||
|
||||
// V1AllocateIP allocates an IP address for the given event.
|
||||
func (ipS *IPSv1) V1AllocateIP(ctx *context.Context, args *utils.CGREvent, reply *utils.AllocatedIP) error {
|
||||
func (ipS *IPSv1) AllocateIP(ctx *context.Context, args *utils.CGREvent, reply *utils.AllocatedIP) error {
|
||||
return ipS.ips.V1AllocateIP(ctx, args, reply)
|
||||
}
|
||||
|
||||
// V1ReleaseIP releases an allocated IP address for the given event.
|
||||
func (ipS *IPSv1) V1ReleaseIP(ctx *context.Context, args *utils.CGREvent, reply *string) error {
|
||||
func (ipS *IPSv1) ReleaseIP(ctx *context.Context, args *utils.CGREvent, reply *string) error {
|
||||
return ipS.ips.V1ReleaseIP(ctx, args, reply)
|
||||
}
|
||||
|
||||
// V1GetIPAllocations returns all IP allocations for a tenantID.
|
||||
func (ipS *IPSv1) V1GetIPAllocations(ctx *context.Context, arg *utils.TenantIDWithAPIOpts, reply *utils.IPAllocations) error {
|
||||
func (ipS *IPSv1) GetIPAllocations(ctx *context.Context, arg *utils.TenantIDWithAPIOpts, reply *utils.IPAllocations) error {
|
||||
return ipS.ips.V1GetIPAllocations(ctx, arg, reply)
|
||||
}
|
||||
|
||||
// V1ClearIPAllocations clears IP allocations from an IPAllocations object.
|
||||
// If args.AllocationIDs is empty or nil, all allocations will be cleared.
|
||||
func (ipS *IPSv1) V1ClearIPAllocations(ctx *context.Context, arg *utils.ClearIPAllocationsArgs, reply *string) error {
|
||||
func (ipS *IPSv1) ClearIPAllocations(ctx *context.Context, arg *utils.ClearIPAllocationsArgs, reply *string) error {
|
||||
return ipS.ips.V1ClearIPAllocations(ctx, arg, reply)
|
||||
}
|
||||
|
||||
@@ -193,21 +193,21 @@ type RankingSv1 struct {
|
||||
}
|
||||
|
||||
// V1ScheduleQueries manually schedules or reschedules ranking queries.
|
||||
func (rnkS *RankingSv1) V1ScheduleQueries(ctx *context.Context, args *utils.ArgScheduleRankingQueries, scheduled *int) (err error) {
|
||||
func (rnkS *RankingSv1) ScheduleQueries(ctx *context.Context, args *utils.ArgScheduleRankingQueries, scheduled *int) (err error) {
|
||||
return rnkS.rnkS.V1ScheduleQueries(ctx, args, scheduled)
|
||||
}
|
||||
|
||||
// V1GetRanking retrieves ranking metrics with optional filtering.
|
||||
func (rnkS *RankingSv1) V1GetRanking(ctx *context.Context, arg *utils.TenantIDWithAPIOpts, retRanking *utils.Ranking) (err error) {
|
||||
func (rnkS *RankingSv1) GetRanking(ctx *context.Context, arg *utils.TenantIDWithAPIOpts, retRanking *utils.Ranking) (err error) {
|
||||
return rnkS.rnkS.V1GetRanking(ctx, arg, retRanking)
|
||||
}
|
||||
|
||||
// V1GetSchedule retrieves information about currently scheduled rankings.
|
||||
func (rnkS *RankingSv1) V1GetSchedule(ctx *context.Context, args *utils.ArgScheduledRankings, schedRankings *[]utils.ScheduledRanking) (err error) {
|
||||
func (rnkS *RankingSv1) GetSchedule(ctx *context.Context, args *utils.ArgScheduledRankings, schedRankings *[]utils.ScheduledRanking) (err error) {
|
||||
return rnkS.rnkS.V1GetSchedule(ctx, args, schedRankings)
|
||||
}
|
||||
|
||||
// V1GetRankingSummary retrieves the most recent ranking summary.
|
||||
func (rnkS *RankingSv1) V1GetRankingSummary(ctx *context.Context, arg *utils.TenantIDWithAPIOpts, reply *utils.RankingSummary) (err error) {
|
||||
func (rnkS *RankingSv1) GetRankingSummary(ctx *context.Context, arg *utils.TenantIDWithAPIOpts, reply *utils.RankingSummary) (err error) {
|
||||
return rnkS.rnkS.V1GetRankingSummary(ctx, arg, reply)
|
||||
}
|
||||
|
||||
@@ -326,12 +326,12 @@ type RateSv1 struct {
|
||||
}
|
||||
|
||||
// V1RateProfilesForEvent will be called to list the RateProfilesIDs that are matching the event
|
||||
func (rtS *RateSv1) V1RateProfilesForEvent(ctx *context.Context, args *utils.CGREvent, rpIDs *[]string) (err error) {
|
||||
func (rtS *RateSv1) RateProfilesForEvent(ctx *context.Context, args *utils.CGREvent, rpIDs *[]string) (err error) {
|
||||
return rtS.rtS.V1RateProfilesForEvent(ctx, args, rpIDs)
|
||||
}
|
||||
|
||||
// RateProfilesForEvent returns the list of rates that are matching the event from a specific profile
|
||||
func (rS *RateSv1) V1RateProfileRatesForEvent(ctx *context.Context, args *utils.CGREventWithRateProfile, rtIDs *[]string) (err error) {
|
||||
func (rS *RateSv1) RateProfileRatesForEvent(ctx *context.Context, args *utils.CGREventWithRateProfile, rtIDs *[]string) (err error) {
|
||||
return rS.rtS.V1RateProfileRatesForEvent(ctx, args, rtIDs)
|
||||
}
|
||||
|
||||
@@ -339,6 +339,6 @@ func (rS *RateSv1) V1RateProfileRatesForEvent(ctx *context.Context, args *utils.
|
||||
// profiles. If a higher priority profile fails, it tries the next matching
|
||||
// profile. This continues until a valid cost is found or all profiles are
|
||||
// exhausted.
|
||||
func (rS *RateSv1) V1CostForEvent(ctx *context.Context, args *utils.CGREvent, rpCost *utils.RateProfileCost) (err error) {
|
||||
func (rS *RateSv1) CostForEvent(ctx *context.Context, args *utils.CGREvent, rpCost *utils.RateProfileCost) (err error) {
|
||||
return rS.rtS.V1CostForEvent(ctx, args, rpCost)
|
||||
}
|
||||
|
||||
@@ -196,31 +196,31 @@ type ResourceSv1 struct {
|
||||
}
|
||||
|
||||
// V1GetResourcesForEvent returns active resource configs matching the event
|
||||
func (rS *ResourceSv1) V1GetResourcesForEvent(ctx *context.Context, args *utils.CGREvent, reply *resources.Resources) (err error) {
|
||||
func (rS *ResourceSv1) GetResourcesForEvent(ctx *context.Context, args *utils.CGREvent, reply *resources.Resources) (err error) {
|
||||
return rS.rsS.V1GetResourcesForEvent(ctx, args, reply)
|
||||
}
|
||||
|
||||
// V1AuthorizeResources queries service to find if an Usage is allowed
|
||||
func (rS *ResourceSv1) V1AuthorizeResources(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) {
|
||||
func (rS *ResourceSv1) AuthorizeResources(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) {
|
||||
return rS.rsS.V1AuthorizeResources(ctx, args, reply)
|
||||
}
|
||||
|
||||
// V1AllocateResources is called when a resource requires allocation
|
||||
func (rS *ResourceSv1) V1AllocateResources(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) {
|
||||
func (rS *ResourceSv1) AllocateResources(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) {
|
||||
return rS.rsS.V1AllocateResources(ctx, args, reply)
|
||||
}
|
||||
|
||||
// V1ReleaseResources is called when we need to clear an allocation
|
||||
func (rS *ResourceSv1) V1ReleaseResources(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) {
|
||||
func (rS *ResourceSv1) ReleaseResources(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) {
|
||||
return rS.rsS.V1ReleaseResources(ctx, args, reply)
|
||||
}
|
||||
|
||||
// V1GetResource returns a resource
|
||||
func (rS *ResourceSv1) V1GetResource(ctx *context.Context, arg *utils.TenantIDWithAPIOpts, reply *utils.Resource) error {
|
||||
func (rS *ResourceSv1) GetResource(ctx *context.Context, arg *utils.TenantIDWithAPIOpts, reply *utils.Resource) error {
|
||||
return rS.rsS.V1GetResource(ctx, arg, reply)
|
||||
}
|
||||
|
||||
// V1GetResource returns a resource configuration
|
||||
func (rS *ResourceSv1) V1GetResourceWithConfig(ctx *context.Context, arg *utils.TenantIDWithAPIOpts, reply *utils.ResourceWithConfig) (err error) {
|
||||
func (rS *ResourceSv1) GetResourceWithConfig(ctx *context.Context, arg *utils.TenantIDWithAPIOpts, reply *utils.ResourceWithConfig) (err error) {
|
||||
return rS.rsS.V1GetResourceWithConfig(ctx, arg, reply)
|
||||
}
|
||||
|
||||
@@ -193,11 +193,11 @@ type RouteSv1 struct {
|
||||
}
|
||||
|
||||
// V1GetRoutes returns the list of valid routes.
|
||||
func (rpS *RouteSv1) V1GetRoutes(ctx *context.Context, args *utils.CGREvent, reply *routes.SortedRoutesList) (err error) {
|
||||
func (rpS *RouteSv1) GetRoutes(ctx *context.Context, args *utils.CGREvent, reply *routes.SortedRoutesList) (err error) {
|
||||
return rpS.rpS.V1GetRoutes(ctx, args, reply)
|
||||
}
|
||||
|
||||
// V1GetRoutesList returns the list of valid routes.
|
||||
func (rpS *RouteSv1) V1GetRoutesList(ctx *context.Context, args *utils.CGREvent, reply *[]string) (err error) {
|
||||
func (rpS *RouteSv1) GetRoutesList(ctx *context.Context, args *utils.CGREvent, reply *[]string) (err error) {
|
||||
return rpS.rpS.V1GetRoutesList(ctx, args, reply)
|
||||
}
|
||||
|
||||
@@ -192,21 +192,21 @@ type TrendSv1 struct {
|
||||
}
|
||||
|
||||
// V1ScheduleQueries manually schedules or reschedules trend queries.
|
||||
func (tS *TrendSv1) V1ScheduleQueries(ctx *context.Context, args *utils.ArgScheduleTrendQueries, scheduled *int) (err error) {
|
||||
func (tS *TrendSv1) ScheduleQueries(ctx *context.Context, args *utils.ArgScheduleTrendQueries, scheduled *int) (err error) {
|
||||
return tS.trndS.V1ScheduleQueries(ctx, args, scheduled)
|
||||
}
|
||||
|
||||
// V1GetTrend retrieves trend metrics with optional time and index filtering.
|
||||
func (tS *TrendSv1) V1GetTrend(ctx *context.Context, arg *utils.ArgGetTrend, retTrend *utils.Trend) (err error) {
|
||||
func (tS *TrendSv1) GetTrend(ctx *context.Context, arg *utils.ArgGetTrend, retTrend *utils.Trend) (err error) {
|
||||
return tS.trndS.V1GetTrend(ctx, arg, retTrend)
|
||||
}
|
||||
|
||||
// V1GetScheduledTrends retrieves information about currently scheduled trends.
|
||||
func (tS *TrendSv1) V1GetScheduledTrends(ctx *context.Context, args *utils.ArgScheduledTrends, schedTrends *[]utils.ScheduledTrend) (err error) {
|
||||
func (tS *TrendSv1) GetScheduledTrends(ctx *context.Context, args *utils.ArgScheduledTrends, schedTrends *[]utils.ScheduledTrend) (err error) {
|
||||
return tS.trndS.V1GetScheduledTrends(ctx, args, schedTrends)
|
||||
}
|
||||
|
||||
// V1GetTrendSummary retrieves the most recent trend summary.
|
||||
func (tS *TrendSv1) V1GetTrendSummary(ctx *context.Context, arg utils.TenantIDWithAPIOpts, reply *utils.TrendSummary) (err error) {
|
||||
func (tS *TrendSv1) GetTrendSummary(ctx *context.Context, arg utils.TenantIDWithAPIOpts, reply *utils.TrendSummary) (err error) {
|
||||
return tS.trndS.V1GetTrendSummary(ctx, arg, reply)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user