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 +}