diff --git a/apier/v1/sessions_process_event_it_test.go b/apier/v1/sessions_process_event_it_test.go index 9fa2f9b4c..c64182a76 100644 --- a/apier/v1/sessions_process_event_it_test.go +++ b/apier/v1/sessions_process_event_it_test.go @@ -182,8 +182,8 @@ func testSSv1ItProcessEventAuth(t *testing.T) { if rply.MaxUsage == nil || rply.MaxUsage["CustomerCharges"] != authUsage { t.Errorf("Unexpected MaxUsage: %v", rply.MaxUsage) } - if rply.ResourceMessage == nil || rply.ResourceMessage["CustomerCharges"] == utils.EmptyString { - t.Errorf("Unexpected ResourceMessage: %s", rply.ResourceMessage) + if rply.ResourceAllocation == nil || rply.ResourceAllocation["CustomerCharges"] == utils.EmptyString { + t.Errorf("Unexpected ResourceAllocation: %s", rply.ResourceAllocation) } eSplrs := &engine.SortedRoutes{ ProfileID: "SPL_ACNT_1001", @@ -266,8 +266,8 @@ func testSSv1ItProcessEventInitiateSession(t *testing.T) { if rply.MaxUsage == nil || rply.MaxUsage["CustomerCharges"] != initUsage { t.Errorf("Unexpected MaxUsage: %v", rply.MaxUsage) } - if rply.ResourceMessage == nil || rply.ResourceMessage["CustomerCharges"] != "RES_ACNT_1001" { - t.Errorf("Unexpected ResourceMessage: %s", rply.ResourceMessage) + if rply.ResourceAllocation == nil || rply.ResourceAllocation["CustomerCharges"] != "RES_ACNT_1001" { + t.Errorf("Unexpected ResourceAllocation: %s", rply.ResourceAllocation) } eAttrs := &engine.AttrSProcessEventReply{ MatchedProfiles: []string{"ATTR_ACNT_1001"}, diff --git a/packages/debian/changelog b/packages/debian/changelog index 928aa6a81..8851623eb 100644 --- a/packages/debian/changelog +++ b/packages/debian/changelog @@ -77,6 +77,7 @@ cgrates (0.11.0~dev) UNRELEASED; urgency=medium * [RSRParsers] Removed attribute sistem from RSRParser * [RSRParsers] Added grave accent(`) char as a delimiter to not split tge RSR value * [RSRParsers] Moved RSRFilter from RSRParsers to the *rsr FilterS + * [SessionS] Rename from ResourceMessage to ResourceAllocation -- DanB Wed, 19 Feb 2020 13:25:52 +0200 diff --git a/sessions/sessions.go b/sessions/sessions.go index bce9f5c53..50f3c6a7d 100644 --- a/sessions/sessions.go +++ b/sessions/sessions.go @@ -3024,14 +3024,14 @@ type V1ProcessEventArgs struct { // V1ProcessEventReply is the reply for the ProcessEvent API type V1ProcessEventReply struct { - MaxUsage map[string]time.Duration - Cost *float64 // Cost is the cost received from Rater, ignoring accounting part - ResourceMessage map[string]string - Attributes *engine.AttrSProcessEventReply - Routes *engine.SortedRoutes - ThresholdIDs *[]string - StatQueueIDs *[]string - STIRIdentity map[string]string + MaxUsage map[string]time.Duration + Cost *float64 // Cost is the cost received from Rater, ignoring accounting part + ResourceAllocation map[string]string + Attributes *engine.AttrSProcessEventReply + Routes *engine.SortedRoutes + ThresholdIDs *[]string + StatQueueIDs *[]string + STIRIdentity map[string]string } // AsNavigableMap is part of engine.NavigableMapper interface @@ -3045,12 +3045,12 @@ func (v1Rply *V1ProcessEventReply) AsNavigableMap() utils.NavigableMap2 { } cgrReply[utils.CapMaxUsage] = usage } - if v1Rply.ResourceMessage != nil { + if v1Rply.ResourceAllocation != nil { res := make(utils.NavigableMap2) - for k, v := range v1Rply.ResourceMessage { + for k, v := range v1Rply.ResourceAllocation { res[k] = utils.NewNMData(v) } - cgrReply[utils.CapResourceMessage] = res + cgrReply[utils.CapResourceAllocation] = res } if v1Rply.Attributes != nil { attrs := make(utils.NavigableMap2) @@ -3286,7 +3286,7 @@ func (sS *SessionS) BiRPCv1ProcessEvent(clnt rpcclient.ClientConnector, }); err != nil { return } - rply.ResourceMessage = make(map[string]string) + rply.ResourceAllocation = make(map[string]string) for _, chrs := range chrgrs { runID := chrs.ChargerSProfile @@ -3309,19 +3309,19 @@ func (sS *SessionS) BiRPCv1ProcessEvent(clnt rpcclient.ClientConnector, attrRU, &resMessage); err != nil { return utils.NewErrResourceS(err) } - rply.ResourceMessage[runID] = resMessage + rply.ResourceAllocation[runID] = resMessage } else if resourceFlagsWithParams.HasKey(utils.MetaAllocate) { if err = sS.connMgr.Call(sS.cgrCfg.SessionSCfg().ResSConns, nil, utils.ResourceSv1AllocateResources, attrRU, &resMessage); err != nil { return utils.NewErrResourceS(err) } - rply.ResourceMessage[runID] = resMessage + rply.ResourceAllocation[runID] = resMessage } else if resourceFlagsWithParams.HasKey(utils.MetaRelease) { if err = sS.connMgr.Call(sS.cgrCfg.SessionSCfg().ResSConns, nil, utils.ResourceSv1ReleaseResources, attrRU, &resMessage); err != nil { return utils.NewErrResourceS(err) } - rply.ResourceMessage[runID] = resMessage + rply.ResourceAllocation[runID] = resMessage } } } diff --git a/sessions/sessions_test.go b/sessions/sessions_test.go index c58331cfc..894db2ecc 100644 --- a/sessions/sessions_test.go +++ b/sessions/sessions_test.go @@ -1341,8 +1341,8 @@ func TestV1ProcessEventReplyAsNavigableMap(t *testing.T) { t.Errorf("Expecting \n%+v\n, received: \n%+v", expected, rply) } //resource message check - v1per.ResourceMessage = map[string]string{utils.MetaDefault: "Resource"} - expected[utils.CapResourceMessage] = utils.NavigableMap2{utils.MetaDefault: utils.NewNMData("Resource")} + v1per.ResourceAllocation = map[string]string{utils.MetaDefault: "Resource"} + expected[utils.CapResourceAllocation] = utils.NavigableMap2{utils.MetaDefault: utils.NewNMData("Resource")} if rply := v1per.AsNavigableMap(); !reflect.DeepEqual(expected, rply) { t.Errorf("Expecting \n%+v\n, received: \n%+v", expected, rply) } diff --git a/utils/consts.go b/utils/consts.go index c05140d45..aae5f1af1 100755 --- a/utils/consts.go +++ b/utils/consts.go @@ -919,7 +919,6 @@ const ( MetaDurationSeconds = "*duration_seconds" MetaDurationNanoseconds = "*duration_nanoseconds" CapAttributes = "Attributes" - CapResourceMessage = "ResourceMessage" CapResourceAllocation = "ResourceAllocation" CapMaxUsage = "MaxUsage" CapRoutes = "Routes"