From 753c8dca99037dc49baab96cccfae08302e4ac1c Mon Sep 17 00:00:00 2001 From: "CTFang@WireLab" Date: Tue, 2 Apr 2024 09:11:09 +0000 Subject: [PATCH] feat: UserPlanInfo OAM service --- internal/sbi/oam/api_get_smf_config.go | 13 +++++++++++++ internal/sbi/oam/routers.go | 6 ++++++ internal/sbi/producer/oam.go | 10 ++++++++++ 3 files changed, 29 insertions(+) create mode 100644 internal/sbi/oam/api_get_smf_config.go diff --git a/internal/sbi/oam/api_get_smf_config.go b/internal/sbi/oam/api_get_smf_config.go new file mode 100644 index 00000000..9afc1db6 --- /dev/null +++ b/internal/sbi/oam/api_get_smf_config.go @@ -0,0 +1,13 @@ +package oam + +import ( + "github.com/gin-gonic/gin" + + "github.com/free5gc/smf/internal/sbi/producer" +) + +func HTTPGetSMFUserPlaneInfo(c *gin.Context) { + HTTPResponse := producer.HandleGetSMFUserPlaneInfo() + + c.JSON(HTTPResponse.Status, HTTPResponse.Body) +} diff --git a/internal/sbi/oam/routers.go b/internal/sbi/oam/routers.go index 4ec639fa..782ba96c 100644 --- a/internal/sbi/oam/routers.go +++ b/internal/sbi/oam/routers.go @@ -62,4 +62,10 @@ var routes = Routes{ "/ue-pdu-session-info/:smContextRef", HTTPGetUEPDUSessionInfo, }, + { + "Get SMF Userplane Information", + "GET", + "/user-plane-info/", + HTTPGetSMFUserPlaneInfo, + }, } diff --git a/internal/sbi/producer/oam.go b/internal/sbi/producer/oam.go index ee7da81f..4e2dd673 100644 --- a/internal/sbi/producer/oam.go +++ b/internal/sbi/producer/oam.go @@ -6,6 +6,7 @@ import ( "github.com/free5gc/openapi/models" "github.com/free5gc/smf/internal/context" + "github.com/free5gc/smf/pkg/factory" "github.com/free5gc/util/httpwrapper" ) @@ -54,3 +55,12 @@ func HandleOAMGetUEPDUSessionInfo(smContextRef string) *httpwrapper.Response { } return httpResponse } + +func HandleGetSMFUserPlaneInfo() *httpwrapper.Response { + httpResponse := &httpwrapper.Response{ + Header: nil, + Status: http.StatusOK, + Body: factory.SmfConfig.Configuration.UserPlaneInformation, + } + return httpResponse +}