diff --git a/data/postman/TutRouteS/TutRouteS.postman_collection.json b/data/postman/TutRouteS/TutRouteS.postman_collection.json new file mode 100644 index 000000000..274699460 --- /dev/null +++ b/data/postman/TutRouteS/TutRouteS.postman_collection.json @@ -0,0 +1,421 @@ +{ + "variables": [], + "info": { + "name": "TutRouteS", + "_postman_id": "d5c3040b-e6fa-fc18-61b6-be7ec4b44a2d", + "description": "", + "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" + }, + "item": [ + { + "name": "LoaderS", + "description": "", + "item": [ + { + "name": "APIerSv1.LoadTariffPlanFromFolder", + "request": { + "url": "{{base_url}}/jsonrpc", + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"id\": 6,\n \"method\": \"APIerSv1.LoadTariffPlanFromFolder\",\n \"params\": [\n {\n \"FolderPath\": \"/usr/local/src/cgrates/data/tariffplans/tutroutes\"\n }\n ]\n}" + }, + "description": "" + }, + "response": [] + } + ] + }, + { + "name": "CDRs", + "description": "", + "item": [ + { + "name": "APIerSv2.GetCdrs", + "request": { + "url": "{{base_url}}/jsonrpc", + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"id\": \"11111\",\n \"method\": \"APIerSv2.GetCDRs\",\n \"params\": [\n {\n }\n ]\n}" + }, + "description": "" + }, + "response": [] + } + ] + }, + { + "name": "RouteS", + "description": "", + "item": [ + { + "name": "APIerSv1.GetRouteProfile ACNT_1001", + "request": { + "url": "{{base_url}}/jsonrpc", + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"method\": \"APIerSv1.GetRouteProfile\",\n \"params\": [\n {\n \"Tenant\": \"cgrates.org\",\n \"ID\": \"ROUTE_ACNT_1001\"\n }\n ]\n}" + }, + "description": "" + }, + "response": [] + }, + { + "name": "APIerSv1.GetRouteProfile ACNT_1002", + "request": { + "url": "{{base_url}}/jsonrpc", + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"method\": \"APIerSv1.GetRouteProfile\",\n \"params\": [\n {\n \"Tenant\": \"cgrates.org\",\n \"ID\": \"ROUTE_ACNT_1002\"\n }\n ]\n}" + }, + "description": "" + }, + "response": [] + }, + { + "name": "APIerSv1.GetSupplierProfileACNT_1003", + "request": { + "url": "{{base_url}}/jsonrpc", + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"method\": \"APIerSv1.GetRouteProfile\",\n \"params\": [\n {\n \"Tenant\": \"cgrates.org\",\n \"ID\": \"ROUTE_ACNT_1003\"\n }\n ]\n}" + }, + "description": "" + }, + "response": [] + }, + { + "name": "APIerSv1.GetSupplierProfileACNT_1004", + "request": { + "url": "{{base_url}}/jsonrpc", + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"method\": \"APIerSv1.GetRouteProfile\",\n \"params\": [\n {\n \"Tenant\": \"cgrates.org\",\n \"ID\": \"ROUTE_ACNT_1004\"\n }\n ]\n}" + }, + "description": "" + }, + "response": [] + }, + { + "name": "APIerSv1.GetSupplierProfileACNT_1004 copy", + "request": { + "url": "{{base_url}}/jsonrpc", + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"method\": \"APIerSv1.GetRouteProfile\",\n \"params\": [\n {\n \"Tenant\": \"cgrates.org\",\n \"ID\": \"ROUTE_ACNT_1005\"\n }\n ]\n}" + }, + "description": "" + }, + "response": [] + }, + { + "name": "RouteSv1.GetRoutes", + "request": { + "url": "{{base_url}}/jsonrpc", + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"method\": \"RouteSv1.GetRoutes\",\n\t\"params\": [{\n\t\t\"IgnoreErrors\": false,\n\t\t\"MaxCost\": \"\",\n\t\t\"Tenant\": \"cgrates.org\",\n\t\t\"ID\": \"99ceb66\",\n\t\t\"Time\": \"2021-02-17T18:20:47+01:00\",\n\t\t\"Event\": {\n\t\t\t\"Account\": \"1005\",\n\t\t\t\"Destination\": \"1002\"\n\t\t},\n\t\t\"Opts\": {},\n\t\t\"Limit\": null,\n\t\t\"Offset\": null\n\t}],\n\t\"id\": 64\n}" + }, + "description": "" + }, + "response": [] + } + ] + }, + { + "name": "RALs", + "description": "", + "item": [ + { + "name": "APIerSv1.GetCost 1001 vendor1", + "request": { + "url": "{{base_url}}/jsonrpc", + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"method\": \"APIerSv1.GetCost\",\n \"params\": [\n {\n \"Tenant\": \"cgrates.org\",\n \"Category\": \"vendor1\",\n \"Subject\": \"1001\",\n \"Destination\": \"1002\",\n \"AnswerTime\": \"2020-09-12T15:12:23.190554134+02:00\",\n \"Usage\": \"2m17s\"\n }\n ],\n \"id\": 0\n}" + }, + "description": "" + }, + "response": [] + }, + { + "name": "APIerSv1.GetCost 1001 vendor2", + "request": { + "url": "{{base_url}}/jsonrpc", + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"method\": \"APIerSv1.GetCost\",\n \"params\": [\n {\n \"Tenant\": \"cgrates.org\",\n \"Category\": \"vendor2\",\n \"Subject\": \"1001\",\n \"Destination\": \"1002\",\n \"AnswerTime\": \"2020-09-12T15:12:23.190554134+02:00\",\n \"Usage\": \"50s\"\n }\n ],\n \"id\": 0\n}" + }, + "description": "" + }, + "response": [] + }, + { + "name": "APIerSv2.GetAccount 1001", + "request": { + "url": "{{base_url}}/jsonrpc", + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"method\": \"APIerSv2.GetAccount\",\n \"params\": [\n {\n \"Tenant\": \"cgrates.org\",\n \"Account\": \"1001\"\n }\n ]\n}" + }, + "description": "" + }, + "response": [] + } + ] + }, + { + "name": "StatS", + "description": "", + "item": [ + { + "name": "APIerSv1.GetStatQueueProfile VENDOR_1", + "request": { + "url": "{{base_url}}/jsonrpc", + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"method\": \"APIerSv1.GetStatQueueProfile\",\n \"params\": [\n {\n \"Tenant\": \"cgrates.org\",\n \"id\": \"STATS_VENDOR_1\"\n }\n ]\n}" + }, + "description": "" + }, + "response": [] + }, + { + "name": "APIerSv1.GetStatQueueProfile VENDOR_2", + "request": { + "url": "{{base_url}}/jsonrpc", + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"method\": \"APIerSv1.GetStatQueueProfile\",\n \"params\": [\n {\n \"Tenant\": \"cgrates.org\",\n \"id\": \"STATS_VENDOR_2\"\n }\n ]\n}" + }, + "description": "" + }, + "response": [] + }, + { + "name": "StatSv1.GetQueueStringMetrics VENDOR_1", + "request": { + "url": "{{base_url}}/jsonrpc", + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"method\": \"StatSv1.GetQueueStringMetrics\",\n \"params\": [\n {\n \"Tenant\": \"cgrates.org\",\n \"id\": \"STATS_VENDOR_1\"\n }\n ]\n}" + }, + "description": "" + }, + "response": [] + }, + { + "name": "StatSv1.GetQueueStringMetrics VENDOR_2", + "request": { + "url": "{{base_url}}/jsonrpc", + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"method\": \"StatSv1.GetQueueStringMetrics\",\n \"params\": [\n {\n \"Tenant\": \"cgrates.org\",\n \"id\": \"STATS_VENDOR_2\"\n }\n ]\n}" + }, + "description": "" + }, + "response": [] + }, + { + "name": "StatSv1.ProcessEvent VENDOR_1", + "request": { + "url": "{{base_url}}/jsonrpc", + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"method\": \"StatSv1.ProcessEvent\",\n \"params\": [\n {\n \"Tenant\": \"cgrates.org\",\n \"ID\": \"7094cd19-c893-41d5-b380-40e3a05fd34d\",\n \"Event\": {\n \"Account\": \"1001\",\n \"Category\": \"vendor1\",\n \"Cost\": 1.10855,\n \"Usage\": \"1m5s\"\n }\n }\n ],\n \"id\": 24\n}" + }, + "description": "" + }, + "response": [] + }, + { + "name": "StatSv1.ProcessEvent VENDOR_2", + "request": { + "url": "{{base_url}}/jsonrpc", + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"method\": \"StatSv1.ProcessEvent\",\n \"params\": [\n {\n \"Tenant\": \"cgrates.org\",\n \"ID\": \"7094cd19-c893-41d5-b380-40e3a05fd34d\",\n \"Event\": {\n \"Account\": \"1001\",\n \"Category\": \"vendor2\",\n \"Cost\": 0.1079,\n \"Usage\": \"2m10s\"\n }\n }\n ],\n \"id\": 24\n}" + }, + "description": "" + }, + "response": [] + }, + { + "name": "StatSv1.ProcessEvent VENDOR_1 copy", + "request": { + "url": "{{base_url}}/jsonrpc", + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"method\": \"StatSv1.ProcessEvent\",\n \"params\": [\n {\n \"Tenant\": \"cgrates.org\",\n \"ID\": \"7094cd19-c893-41d5-b380-40e3a05fd34d\",\n \"Event\": {\n \"Account\": \"1001\",\n \"Category\": \"vendor1\",\n \"Cost\": 0.22879,\n \"Usage\": \"2m17s\"\n }\n }\n ],\n \"id\": 24\n}" + }, + "description": "" + }, + "response": [] + }, + { + "name": "StatSv1.ProcessEvent VENDOR_2 copy", + "request": { + "url": "{{base_url}}/jsonrpc", + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"method\": \"StatSv1.ProcessEvent\",\n \"params\": [\n {\n \"Tenant\": \"cgrates.org\",\n \"ID\": \"7094cd19-c893-41d5-b380-40e3a05fd34d\",\n \"Event\": {\n \"Account\": \"1001\",\n \"Category\": \"vendor2\",\n \"Cost\": 0.0415,\n \"Usage\": \"50s\"\n }\n }\n ],\n \"id\": 24\n}" + }, + "description": "" + }, + "response": [] + } + ] + } + ] +} \ No newline at end of file diff --git a/data/tariffplans/tutroutes/AccountActions.csv b/data/tariffplans/tutroutes/AccountActions.csv new file mode 100644 index 000000000..ac6b1fb06 --- /dev/null +++ b/data/tariffplans/tutroutes/AccountActions.csv @@ -0,0 +1,4 @@ +#Tenant,Account,ActionPlanID,ActionTriggersID,AllowNegative,Disabled +cgrates.org,1001,STANDARD_PLAN,,, +cgrates.org,1002,STANDARD_PLAN,,, +cgrates.org,1003,STANDARD_PLAN,,, diff --git a/data/tariffplans/tutroutes/ActionPlans.csv b/data/tariffplans/tutroutes/ActionPlans.csv new file mode 100644 index 000000000..4d14f3e9a --- /dev/null +++ b/data/tariffplans/tutroutes/ActionPlans.csv @@ -0,0 +1,2 @@ +#Id,ActionsId,TimingId,Weight +STANDARD_PLAN,TOPUP_RST_MONETARY_10,*asap,10 diff --git a/data/tariffplans/tutroutes/Actions.csv b/data/tariffplans/tutroutes/Actions.csv new file mode 100644 index 000000000..e809987e7 --- /dev/null +++ b/data/tariffplans/tutroutes/Actions.csv @@ -0,0 +1,4 @@ +#ActionsId[0],Action[1],ExtraParameters[2],Filter[3],BalanceId[4],BalanceType[5],Categories[6],DestinationIds[7],RatingSubject[8],SharedGroup[9],ExpiryTime[10],TimingIds[11],Units[12],BalanceWeight[13],BalanceBlocker[14],BalanceDisabled[15],Weight[16] + +# TOPUP_RST_MONETARY_10 resets the <*default> <*monetary> balance to 10 units +TOPUP_RST_MONETARY_10,*topup_reset,,,*default,*monetary,,,,,,,10,10,,,10 \ No newline at end of file diff --git a/data/tariffplans/tutroutes/Chargers.csv b/data/tariffplans/tutroutes/Chargers.csv new file mode 100644 index 000000000..898d9277c --- /dev/null +++ b/data/tariffplans/tutroutes/Chargers.csv @@ -0,0 +1,3 @@ +# Tenant,ID,FilterIDs,ActivationInterval,RunID,AttributeIDs,Weight + +cgrates.org,CGR_DEFAULT,,,*default,*none,0 diff --git a/data/tariffplans/tutroutes/DestinationRates.csv b/data/tariffplans/tutroutes/DestinationRates.csv new file mode 100644 index 000000000..0b8a8499f --- /dev/null +++ b/data/tariffplans/tutroutes/DestinationRates.csv @@ -0,0 +1,4 @@ +#ID,DestinationsID,RatesID,RoundingMethod,RoundingDecimals,MaxCost,MaxCostStrategy +DR_10_1CSEC,DST_10,RT_1CSEC,*up,5,, +DR_10_10C,DST_10,RT_10C,*up,5,, +DR_10_5C,DST_10,RT_5C,*up,5,, \ No newline at end of file diff --git a/data/tariffplans/tutroutes/Destinations.csv b/data/tariffplans/tutroutes/Destinations.csv new file mode 100644 index 000000000..0150b795c --- /dev/null +++ b/data/tariffplans/tutroutes/Destinations.csv @@ -0,0 +1,2 @@ +#ID,Prefix +DST_10,10 \ No newline at end of file diff --git a/data/tariffplans/tutroutes/Rates.csv b/data/tariffplans/tutroutes/Rates.csv new file mode 100644 index 000000000..5cc733b3a --- /dev/null +++ b/data/tariffplans/tutroutes/Rates.csv @@ -0,0 +1,5 @@ +#ID,ConnectFee,Rate,RateUnit,RateIncrement,GroupIntervalStart +RT_1CSEC,0,0.01,1s,1m,0 +RT_1CSEC,0,0.01,1s,1s,1m +RT_10C,0,0.1,1m,1s,0 +RT_5C,0,0.05,1m,1s,0 diff --git a/data/tariffplans/tutroutes/RatingPlans.csv b/data/tariffplans/tutroutes/RatingPlans.csv new file mode 100644 index 000000000..9c199f211 --- /dev/null +++ b/data/tariffplans/tutroutes/RatingPlans.csv @@ -0,0 +1,4 @@ +#ID,DestinationRatesID,TimingID,Weight +RP_STANDARD,DR_10_1CSEC,*any,0 +RP_VENDOR1,DR_10_10C,*any,0 +RP_VENDOR2,DR_10_5C,*any,0 diff --git a/data/tariffplans/tutroutes/RatingProfiles.csv b/data/tariffplans/tutroutes/RatingProfiles.csv new file mode 100644 index 000000000..6d8f99d57 --- /dev/null +++ b/data/tariffplans/tutroutes/RatingProfiles.csv @@ -0,0 +1,4 @@ +#Tenant,Category,Subject,ActivationTime,RatingPlanID,FallbackSubject +cgrates.org,call,*any,2019-03-01T00:00:00Z,RP_STANDARD, +cgrates.org,vendor1,*any,2019-03-01T00:00:00Z,RP_VENDOR1, +cgrates.org,vendor2,*any,2019-03-01T00:00:00Z,RP_VENDOR2, \ No newline at end of file diff --git a/data/tariffplans/tutroutes/Resources.csv b/data/tariffplans/tutroutes/Resources.csv new file mode 100644 index 000000000..6aee74e85 --- /dev/null +++ b/data/tariffplans/tutroutes/Resources.csv @@ -0,0 +1,3 @@ +#Tenant[0],Id[1],FilterIDs[2],ActivationInterval[3],TTL[4],Limit[5],AllocationMessage[6],Blocker[7],Stored[8],Weight[9],ThresholdIDs[10] +cgrates.org,RES_GRP1,*string:~*req.Account:1001|1002|1003,,-1,10,,,,0,*none +cgrates.org,RES_GRP2,*string:~*req.Account:1004,,-1,10,,,,0,*none \ No newline at end of file diff --git a/data/tariffplans/tutroutes/Routes.csv b/data/tariffplans/tutroutes/Routes.csv new file mode 100644 index 000000000..781424c6e --- /dev/null +++ b/data/tariffplans/tutroutes/Routes.csv @@ -0,0 +1,17 @@ +#Tenant,ID,FilterIDs,ActivationInterval,Sorting,SortingParameters,RouteID,RouteFilterIDs,RouteAccountIDs,RouteRatingPlanIDs,RouteResourceIDs,RouteStatIDs,RouteWeight,RouteBlocker,RouteParameters,Weight + +cgrates.org,ROUTE_ACNT_1001,*string:~*req.Account:1001,,*weight,,vendor1,,,,,,10,,, +cgrates.org,ROUTE_ACNT_1001,,,,,vendor2,*gte:~*accounts.1001.BalanceMap.*monetary[0].Value:10,,,,,20,,, + +cgrates.org,ROUTE_ACNT_1002,*string:~*req.Account:1002,,*lc,,vendor1,*lte:~*resources.RES_GRP1.TotalUsage:5,,RP_VENDOR1,,,0,,, +cgrates.org,ROUTE_ACNT_1002,,,,,vendor2,*gte:~*stats.STATS_VENDOR_2.*acd:1m,,RP_VENDOR2,,,0,,, + +cgrates.org,ROUTE_ACNT_1003,*string:~*req.Account:1003,,*qos,*acd,vendor1,,,,,STATS_VENDOR_1,0,,, +cgrates.org,ROUTE_ACNT_1003,,,,,vendor2,,,,,STATS_VENDOR_2,0,,, + +cgrates.org,ROUTE_ACNT_1004,*string:~*req.Account:1004,,*reas,,vendor1,,,,RES_GRP1,,0,,, +cgrates.org,ROUTE_ACNT_1004,,,,,vendor2,,,,RES_GRP2,,0,,, + + +cgrates.org,ROUTE_ACNT_1005,*string:~*req.Account:1005,,*load,vendor1:3;vendor2:1;*default:2,vendor1,,,,,STATS_VENDOR_1:*sum#1,,,, +cgrates.org,ROUTE_ACNT_1005,,,,,vendor2,,,,,STATS_VENDOR_2:*sum#1,,,, diff --git a/data/tariffplans/tutroutes/Stats.csv b/data/tariffplans/tutroutes/Stats.csv new file mode 100644 index 000000000..2a24027e1 --- /dev/null +++ b/data/tariffplans/tutroutes/Stats.csv @@ -0,0 +1,3 @@ +#Tenant[0],Id[1],FilterIDs[2],ActivationInterval[3],QueueLength[4],TTL[5],MinItems[6],Metrics[7],MetricFilterIDs[8],Stored[9],Blocker[10],Weight[11],ThresholdIDs[12] +cgrates.org,STATS_VENDOR_1,*string:~*req.Category:vendor1,,100,-1,,*acd;*tcd;*acc;*tcc;*sum#1,,,,,*none +cgrates.org,STATS_VENDOR_2,*string:~*req.Category:vendor2,,100,-1,,*acd;*tcd;*acc;*tcc;*sum#1,,,,,*none