mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
sessions: rename IPAllocation reply field to AllocatedIP
This commit is contained in:
committed by
Dan Christian Bogos
parent
4a1f3144ba
commit
c4389a9ab6
@@ -164,7 +164,7 @@ func (sS *SessionS) BiRPCv1AuthorizeEvent(ctx *context.Context,
|
||||
utils.IPsV1AuthorizeIP, args, &allocIP); err != nil {
|
||||
return utils.NewErrIPs(err)
|
||||
}
|
||||
authReply.IPAllocation = &allocIP
|
||||
authReply.AllocatedIP = &allocIP
|
||||
}
|
||||
if routeS {
|
||||
routesReply, err := sS.getRoutes(ctx, args.Clone())
|
||||
@@ -386,7 +386,7 @@ func (sS *SessionS) BiRPCv1InitiateSession(ctx *context.Context,
|
||||
utils.IPsV1AllocateIP, args, &allocIP); err != nil {
|
||||
return utils.NewErrIPs(err)
|
||||
}
|
||||
rply.IPAllocation = &allocIP
|
||||
rply.AllocatedIP = &allocIP
|
||||
defer func() { // we need to release the IPs back in case of errors
|
||||
if err != nil {
|
||||
var reply string
|
||||
|
||||
@@ -438,7 +438,7 @@ func (v1Rply *V1ProcessMessageReply) AsNavigableMap() map[string]*utils.DataNode
|
||||
type V1AuthorizeReply struct {
|
||||
Attributes *attributes.AttrSProcessEventReply `json:",omitempty"`
|
||||
ResourceAllocation *string `json:",omitempty"`
|
||||
IPAllocation *utils.AllocatedIP `json:",omitempty"`
|
||||
AllocatedIP *utils.AllocatedIP `json:",omitempty"`
|
||||
MaxUsage *utils.Decimal `json:",omitempty"`
|
||||
RouteProfiles routes.SortedRoutesList `json:",omitempty"`
|
||||
ThresholdIDs *[]string `json:",omitempty"`
|
||||
@@ -471,12 +471,11 @@ func (r *V1AuthorizeReply) AsNavigableMap() map[string]*utils.DataNode {
|
||||
}
|
||||
cgrReply[utils.CapAttributes] = attrs
|
||||
}
|
||||
if r.IPAllocation != nil {
|
||||
alloc := &utils.DataNode{
|
||||
if r.AllocatedIP != nil {
|
||||
cgrReply[utils.AllocatedIPField] = &utils.DataNode{
|
||||
Type: utils.NMMapType,
|
||||
Map: r.IPAllocation.AsNavigableMap(),
|
||||
Map: r.AllocatedIP.AsNavigableMap(),
|
||||
}
|
||||
cgrReply[utils.CapIPAllocation] = alloc
|
||||
}
|
||||
if r.ResourceAllocation != nil {
|
||||
cgrReply[utils.CapResourceAllocation] = utils.NewLeafNode(*r.ResourceAllocation)
|
||||
@@ -522,7 +521,7 @@ type V1AuthorizeReplyWithDigest struct {
|
||||
type V1InitSessionReply struct {
|
||||
Attributes *attributes.AttrSProcessEventReply `json:",omitempty"`
|
||||
ResourceAllocation *string `json:",omitempty"`
|
||||
IPAllocation *utils.AllocatedIP `json:",omitempty"`
|
||||
AllocatedIP *utils.AllocatedIP `json:",omitempty"`
|
||||
MaxUsage *time.Duration `json:",omitempty"`
|
||||
ThresholdIDs *[]string `json:",omitempty"`
|
||||
StatQueueIDs *[]string `json:",omitempty"`
|
||||
@@ -554,12 +553,11 @@ func (r *V1InitSessionReply) AsNavigableMap() map[string]*utils.DataNode {
|
||||
}
|
||||
cgrReply[utils.CapAttributes] = attrs
|
||||
}
|
||||
if r.IPAllocation != nil {
|
||||
alloc := &utils.DataNode{
|
||||
if r.AllocatedIP != nil {
|
||||
cgrReply[utils.AllocatedIPField] = &utils.DataNode{
|
||||
Type: utils.NMMapType,
|
||||
Map: r.IPAllocation.AsNavigableMap(),
|
||||
Map: r.AllocatedIP.AsNavigableMap(),
|
||||
}
|
||||
cgrReply[utils.CapIPAllocation] = alloc
|
||||
}
|
||||
if r.ResourceAllocation != nil {
|
||||
cgrReply[utils.CapResourceAllocation] = utils.NewLeafNode(*r.ResourceAllocation)
|
||||
|
||||
@@ -1163,7 +1163,7 @@ const (
|
||||
MetaDurationNanoseconds = "*duration_nanoseconds"
|
||||
CapAttributes = "Attributes"
|
||||
CapResourceAllocation = "ResourceAllocation"
|
||||
CapIPAllocation = "IPAllocation"
|
||||
AllocatedIPField = "AllocatedIP"
|
||||
CapMaxUsage = "MaxUsage"
|
||||
CapRoutes = "Routes"
|
||||
CapRouteProfiles = "RouteProfiles"
|
||||
|
||||
Reference in New Issue
Block a user