Closed aviweit closed 1 year ago
Hi @tim-ywliu , Can you please review this PR? Thanks.
I suggest to create a different PR to support delete, since it is more complex (e.g. release pdu session(s) of the deleted upf, terminate its heartbeat thread (if exists), ensure topology is consistent after upf is deleted, etc..). What do you think?
@aviweit
Why not use one api to new upNodes & links together?
Why not use one api to new upNodes & links together?
@tim-ywliu , thanks, I am looking into it.
Update PR to use single API for GET/POST
List list_user_plane_information upNodes and links
curl -H "Content-type: application/json" -X GET http://<smf_ip_address>:<smf_port>/upi/v1/upNodesLinks
REST path:
smf_ip_address - ipaddress of SMF service
smf_port - the service port
Return:
status - 200
list of upNode and link elements (json)
Add upNodes and links to user_plane_information
curl -H "Content-type: application/json" -X POST -d '{ "upNodes": {...}, "links": [] }' http://<smf_ip_address>:<smf_port>/upi/v1/upNodesLinks
REST path:
smf_ip_address - ipaddress of SMF service
smf_port - the service port
Data payload:
list of upNode and link elements (json)
Return:
status - 200
Example:
curl -X POST \
http://127.0.0.1:8000/upi/v1/upNodesLinks \
-H 'content-type: application/json' \
-d '{
"upNodes": {
"UPF-2": {
"type": "UPF",
"nodeID": "upf-2.free5gc.org",
"sNssaiUpfInfos": [
{
"sNssai": {"sst": 1, "sd": "010203"},
"dnnUpfInfoList": [
{
"dnn": "internet",
"pools": [{"cidr": "10.62.0.0/16"}]
}
]
}
],
"interfaces": [
{
"interfaceType": "N3",
"endpoints": ["upf-2.free5gc.org"],
"networkInstance": "internet"
}
]
}
},
"links": [
{
"A": "gNB",
"B": "UPF-2"
}
]
}'
Hi @tim-ywliu , I have unified REST APIs into a single one and added checks to ignore existing SMF links. Can you please review? Thanks.
LGTM, thanks.
This PR addresses the task item mentioned in pkg/factory/factory.go ("Support configuration update from REST api") It introduces the below REST APIs:
Get upNodes
List list_user_plane_information upNodes
REST path:
Return:
Post upNodes
Add upNodes to user_plane_information
REST path:
Data payload:
Return:
Example:
Get links
List list_user_plane_information links
REST path:
Return:
Post links
Add links to user_plane_information
REST path:
Data payload:
Return:
Example: