mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Rename from ResourceMessage to ResourceAllocation
This commit is contained in:
@@ -175,8 +175,8 @@ func testSSv1ItProcessEventAuth(t *testing.T) {
|
||||
if rply.MaxUsage != authUsage {
|
||||
t.Errorf("Unexpected MaxUsage: %v", rply.MaxUsage)
|
||||
}
|
||||
if *rply.ResourceMessage == utils.EmptyString {
|
||||
t.Errorf("Unexpected ResourceMessage: %s", *rply.ResourceMessage)
|
||||
if *rply.ResourceAllocation == utils.EmptyString {
|
||||
t.Errorf("Unexpected ResourceAllocation: %s", *rply.ResourceAllocation)
|
||||
}
|
||||
eSplrs := &engine.SortedSuppliers{
|
||||
ProfileID: "SPL_ACNT_1001",
|
||||
@@ -259,8 +259,8 @@ func testSSv1ItProcessEventInitiateSession(t *testing.T) {
|
||||
if rply.MaxUsage != initUsage {
|
||||
t.Errorf("Unexpected MaxUsage: %v", rply.MaxUsage)
|
||||
}
|
||||
if *rply.ResourceMessage != "RES_ACNT_1001" {
|
||||
t.Errorf("Unexpected ResourceMessage: %s", *rply.ResourceMessage)
|
||||
if *rply.ResourceAllocation != "RES_ACNT_1001" {
|
||||
t.Errorf("Unexpected ResourceAllocation: %s", *rply.ResourceAllocation)
|
||||
}
|
||||
eAttrs := &engine.AttrSProcessEventReply{
|
||||
MatchedProfiles: []string{"ATTR_ACNT_1001"},
|
||||
|
||||
@@ -10,6 +10,7 @@ cgrates (0.10.2~dev) UNRELEASED; urgency=medium
|
||||
* [SessionS] Use correctly SessionTTLUsage when calculate end usage in case of terminate session from ttl mechanism
|
||||
* [RSRParsers] Removed attribute sistem from RSRParser
|
||||
* [RSRParsers] Added grave accent(`) char as a delimiter to not split tge RSR value
|
||||
* [SessionS] Rename from ResourceMessage to ResourceAllocation
|
||||
|
||||
-- DanB <danb@cgrates.org> Tue, 12 May 2020 13:08:15 +0300
|
||||
|
||||
|
||||
@@ -2932,13 +2932,13 @@ type V1ProcessEventArgs struct {
|
||||
|
||||
// V1ProcessEventReply is the reply for the ProcessEvent API
|
||||
type V1ProcessEventReply struct {
|
||||
MaxUsage time.Duration
|
||||
ResourceMessage *string
|
||||
Attributes *engine.AttrSProcessEventReply
|
||||
Suppliers *engine.SortedSuppliers
|
||||
ThresholdIDs *[]string
|
||||
StatQueueIDs *[]string
|
||||
getMaxUsage bool
|
||||
MaxUsage time.Duration
|
||||
ResourceAllocation *string
|
||||
Attributes *engine.AttrSProcessEventReply
|
||||
Suppliers *engine.SortedSuppliers
|
||||
ThresholdIDs *[]string
|
||||
StatQueueIDs *[]string
|
||||
getMaxUsage bool
|
||||
}
|
||||
|
||||
// SetMaxUsageNeeded used by agent that use the reply as NavigableMapper
|
||||
@@ -2956,8 +2956,8 @@ func (v1Rply *V1ProcessEventReply) AsNavigableMap() utils.NavigableMap2 {
|
||||
if v1Rply.getMaxUsage {
|
||||
cgrReply[utils.CapMaxUsage] = utils.NewNMData(v1Rply.MaxUsage)
|
||||
}
|
||||
if v1Rply.ResourceMessage != nil {
|
||||
cgrReply[utils.CapResourceMessage] = utils.NewNMData(*v1Rply.ResourceMessage)
|
||||
if v1Rply.ResourceAllocation != nil {
|
||||
cgrReply[utils.CapResourceAllocation] = utils.NewNMData(*v1Rply.ResourceAllocation)
|
||||
}
|
||||
if v1Rply.Attributes != nil {
|
||||
attrs := make(utils.NavigableMap2)
|
||||
@@ -3071,21 +3071,21 @@ func (sS *SessionS) BiRPCv1ProcessEvent(clnt rpcclient.ClientConnector,
|
||||
attrRU, &resMessage); err != nil {
|
||||
return utils.NewErrResourceS(err)
|
||||
}
|
||||
rply.ResourceMessage = &resMessage
|
||||
rply.ResourceAllocation = &resMessage
|
||||
}
|
||||
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 = &resMessage
|
||||
rply.ResourceAllocation = &resMessage
|
||||
}
|
||||
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 = &resMessage
|
||||
rply.ResourceAllocation = &resMessage
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1336,8 +1336,8 @@ func TestV1ProcessEventReplyAsNavigableMap(t *testing.T) {
|
||||
t.Errorf("Expecting \n%+v\n, received: \n%+v", expected, rply)
|
||||
}
|
||||
//resource message check
|
||||
v1per.ResourceMessage = utils.StringPointer("Resource")
|
||||
expected[utils.CapResourceMessage] = utils.NewNMData("Resource")
|
||||
v1per.ResourceAllocation = utils.StringPointer("Resource")
|
||||
expected[utils.CapResourceAllocation] = utils.NewNMData("Resource")
|
||||
if rply := v1per.AsNavigableMap(); !reflect.DeepEqual(expected, rply) {
|
||||
t.Errorf("Expecting \n%+v\n, received: \n%+v", expected, rply)
|
||||
}
|
||||
|
||||
@@ -807,7 +807,6 @@ const (
|
||||
MetaDurationSeconds = "*duration_seconds"
|
||||
MetaDurationNanoseconds = "*duration_nanoseconds"
|
||||
CapAttributes = "Attributes"
|
||||
CapResourceMessage = "ResourceMessage"
|
||||
CapResourceAllocation = "ResourceAllocation"
|
||||
CapMaxUsage = "MaxUsage"
|
||||
CapSuppliers = "Suppliers"
|
||||
|
||||
Reference in New Issue
Block a user