Implement feature to create a policy via the SMPolicyControl API
- Use generated open API and connect it with service layer
- Allow creation of SM policy association (POST npcf-smpolicycontrol/v1)
- Use hardcoded policy decisions as reply based on SNSSAI, DNN and SUPI
Sample CURL request
Create the file 'test_request.json':
{
"supi": "imsi-208950000000032",
"pduSessionType": "IPV4",
"pduSessionId": 42,
"dnn": "default",
"notificationUri": "not_supported_right_now",
"sliceInfo": {
"sst": 222,
"sd": "123"
}
}
Send this CURL request:
curl -X POST http://host:port/npcf-smpolicycontrol/v1/sm-policies/ -H 'Content-Type: application/json' -d @test_request.json
Sample response:
{
"pccRules": {
"supi-rule-edge": {
"flowInfos": [
{
"flowDescription": "permit out ip from 8.8.8.8 to assigned"
}
],
"pccRuleId": "supi-rule-edge",
"precedence": 9,
"refTcData": [
"edge-traffic"
]
},
"supi-rule-internet": {
"flowInfos": [
{
"flowDescription": "permit out ip from any to assigned"
}
],
"pccRuleId": "supi-rule-internet",
"precedence": 10,
"refTcData": [
"default-traffic"
]
}
},
"traffContDecs": {
"default-traffic": {
"routeToLocs": [
{
"dnai": "internet-dn",
"routeProfId": "route-internet"
}
],
"tcId": "default-traffic"
},
"edge-traffic": {
"routeToLocs": [
{
"dnai": "edge-dn",
"routeProfId": "route-edge1"
}
],
"tcId": "edge-traffic"
}
}
}
Note: the "notificationUri" is currently not supported, but it is mandatory, thus set to "not_supported_right_now".
Policy Selection
Currently, the policy is decided based on 4 criteria:
- supi: Hardcoded supi is "imsi-208950000000032"
- dnn: Hardcoded dnn is "default"
- slice: Hardcoded slice is "sst: 222, sd: 123"
- default: currently provisioned, used when none of the above match.
In the current (hardcoded) configuration the supi replies with an edge scenario and the others with a default internet DN scenario.
The hardcoded configuration shall be exchanged with a file based configuration (see issue #1 (closed))
Edited by Stefan Spettel