diff --git a/internal/sbi/api_communication.go b/internal/sbi/api_communication.go index 69c241a..f5c4c8f 100644 --- a/internal/sbi/api_communication.go +++ b/internal/sbi/api_communication.go @@ -67,6 +67,18 @@ func (s *Server) getCommunicationRoutes() []Route { Pattern: "/ue-contexts/:ueContextId/transfer", APIFunc: s.HTTPUEContextTransfer, }, + { + Name: "RelocateUEContext", + Method: http.MethodPost, + Pattern: "/ue-contexts/:ueContextId/relocate", + APIFunc: s.HTTPRelocateUEContext, + }, + { + Name: "CancelRelocateUEContext", + Method: http.MethodPost, + Pattern: "/ue-contexts/:ueContextId/cancel-relocate", + APIFunc: s.HTTPCancelRelocateUEContext, + }, { Name: "N1N2MessageUnSubscribe", Method: http.MethodDelete, @@ -334,6 +346,14 @@ func (s *Server) HTTPUEContextTransfer(c *gin.Context) { s.Processor().HandleUEContextTransferRequest(c, ueContextTransferRequest) } +func (s *Server) HTTPRelocateUEContext(c *gin.Context) { + c.JSON(http.StatusNotImplemented, gin.H{}) +} + +func (s *Server) HTTPCancelRelocateUEContext(c *gin.Context) { + c.JSON(http.StatusNotImplemented, gin.H{}) +} + func (s *Server) HTTPN1N2MessageUnSubscribe(c *gin.Context) { s.Processor().HandleN1N2MessageUnSubscribeRequest(c) } diff --git a/internal/sbi/api_eventexposure.go b/internal/sbi/api_eventexposure.go index 1f019f8..908ba74 100644 --- a/internal/sbi/api_eventexposure.go +++ b/internal/sbi/api_eventexposure.go @@ -20,16 +20,19 @@ func (s *Server) getEventexposureRoutes() []Route { }, }, { + Name: "DeleteSubscription", Method: http.MethodDelete, Pattern: "/subscriptions/:subscriptionId", APIFunc: s.HTTPDeleteSubscription, }, { + Name: "ModifySubscription", Method: http.MethodPatch, Pattern: "/subscriptions/:subscriptionId", APIFunc: s.HTTPModifySubscription, }, { + Name: "CreateSubscription", Method: http.MethodPost, Pattern: "/subscriptions", APIFunc: s.HTTPCreateSubscription, diff --git a/internal/sbi/api_httpcallback.go b/internal/sbi/api_httpcallback.go index 0e7fa1a..8dc526c 100644 --- a/internal/sbi/api_httpcallback.go +++ b/internal/sbi/api_httpcallback.go @@ -14,6 +14,7 @@ import ( func (s *Server) getHttpCallBackRoutes() []Route { return []Route{ { + Method: http.MethodGet, Pattern: "/", APIFunc: func(c *gin.Context) { @@ -21,21 +22,25 @@ func (s *Server) getHttpCallBackRoutes() []Route { }, }, { + Name: "AmPolicyControlUpdateNotifyUpdate", Method: http.MethodPost, Pattern: "/am-policy/:polAssoId/update", APIFunc: s.HTTPAmPolicyControlUpdateNotifyUpdate, }, { + Name: "AmPolicyControlUpdateNotifyTerminate", Method: http.MethodPost, Pattern: "/am-policy/:polAssoId/terminate", APIFunc: s.HTTPAmPolicyControlUpdateNotifyTerminate, }, { + Name: "N1MessageNotify", Method: http.MethodPost, Pattern: "/n1-message-notify", APIFunc: s.HTTPN1MessageNotify, }, { + Name: "HandleDeregistrationNotification", Method: http.MethodPost, Pattern: "/deregistration/:ueid", APIFunc: s.HTTPHandleDeregistrationNotification, @@ -76,7 +81,6 @@ func (s *Server) HTTPAmPolicyControlUpdateNotifyUpdate(c *gin.Context) { func (s *Server) HTTPAmPolicyControlUpdateNotifyTerminate(c *gin.Context) { var terminationNotification models.PcfAmPolicyControlTerminationNotification - requestBody, err := c.GetRawData() if err != nil { diff --git a/internal/sbi/api_location.go b/internal/sbi/api_location.go index c5d455a..1f00fe9 100644 --- a/internal/sbi/api_location.go +++ b/internal/sbi/api_location.go @@ -29,15 +29,23 @@ func (s *Server) getLocationRoutes() []Route { }, }, { + Name: "ProvideLocationInfo", Method: http.MethodPost, Pattern: "/:ueContextId/provide-loc-info", APIFunc: s.HTTPProvideLocationInfo, }, { + Name: "ProvidePositioningInfo", Method: http.MethodPost, Pattern: "/:ueContextId/provide-pos-info", APIFunc: s.HTTPProvidePositioningInfo, }, + { + Name: "CancelLocation", + Method: http.MethodPost, + Pattern: "/:ueContextId/cancel-loc-info", + APIFunc: s.HTTPCancelLocation, + }, } } @@ -78,3 +86,7 @@ func (s *Server) HTTPProvidePositioningInfo(c *gin.Context) { logger.LocationLog.Warnf("Handle Provide Positioning Info is not implemented.") c.JSON(http.StatusNotImplemented, gin.H{}) } + +func (s *Server) HTTPCancelLocation(c *gin.Context) { + c.JSON(http.StatusNotImplemented, gin.H{}) +} diff --git a/internal/sbi/api_mbsbroadcast.go b/internal/sbi/api_mbsbroadcast.go new file mode 100644 index 0000000..05ac370 --- /dev/null +++ b/internal/sbi/api_mbsbroadcast.go @@ -0,0 +1,49 @@ +package sbi + +import ( + "net/http" + + "github.com/gin-gonic/gin" +) + +func (s *Server) getMbsBroadcastRoutes() []Route { + return []Route{ + { + Method: http.MethodGet, + Pattern: "/", + APIFunc: func(c *gin.Context) { + c.String(http.StatusOK, "Hello World!") + }, + }, + { + Name: "ContextCreate", + Method: http.MethodPost, + Pattern: "/mbs-contexts", + APIFunc: s.HTTPContextCreate, + }, + { + Name: "ContextUpdate", + Method: http.MethodPost, + Pattern: "/mbs-contexts/:mbsContextRef/update", + APIFunc: s.HTTPContextUpdate, + }, + { + Name: "ContextReleas", + Method: http.MethodDelete, + Pattern: "/mbs-contexts/:mbsContextRef", + APIFunc: s.HTTPContextRelease, + }, + } +} + +func (s *Server) HTTPContextCreate(c *gin.Context) { + c.JSON(http.StatusNotImplemented, gin.H{}) +} + +func (s *Server) HTTPContextUpdate(c *gin.Context) { + c.JSON(http.StatusNotImplemented, gin.H{}) +} + +func (s *Server) HTTPContextRelease(c *gin.Context) { + c.JSON(http.StatusNotImplemented, gin.H{}) +} diff --git a/internal/sbi/api_mbscommunication.go b/internal/sbi/api_mbscommunication.go new file mode 100644 index 0000000..4af620b --- /dev/null +++ b/internal/sbi/api_mbscommunication.go @@ -0,0 +1,29 @@ +package sbi + +import ( + "net/http" + + "github.com/gin-gonic/gin" +) + +func (s *Server) getMbsCommunicationRoutes() []Route { + return []Route{ + { + Method: http.MethodGet, + Pattern: "/", + APIFunc: func(c *gin.Context) { + c.String(http.StatusOK, "Hello World!") + }, + }, + { + Name: "N2MessageTransfer", + Method: http.MethodPost, + Pattern: "/n2-messages/transfer", + APIFunc: s.HTTPN2MessageTransfer, + }, + } +} + +func (s *Server) HTTPN2MessageTransfer(c *gin.Context) { + c.JSON(http.StatusNotImplemented, gin.H{}) +} diff --git a/internal/sbi/api_mt.go b/internal/sbi/api_mt.go index 54cbf8c..829d35c 100644 --- a/internal/sbi/api_mt.go +++ b/internal/sbi/api_mt.go @@ -18,15 +18,23 @@ func (s *Server) getMTRoutes() []Route { }, }, { + Name: "ProvideDomainSelectionInfo", Method: http.MethodGet, Pattern: "/ue-contexts/:ueContextId", APIFunc: s.HTTPProvideDomainSelectionInfo, }, { - Method: http.MethodPost, + Name: "EnableUeReachability", + Method: http.MethodPut, Pattern: "/ue-contexts/:ueContextId/ue-reachind", APIFunc: s.HTTPEnableUeReachability, }, + { + Name: "EnableGroupReachability", + Method: http.MethodPost, + Pattern: "/ue-contexts/enable-group-reachability", + APIFunc: s.HTTPEnableGroupReachability, + }, } } @@ -39,3 +47,7 @@ func (s *Server) HTTPEnableUeReachability(c *gin.Context) { logger.MtLog.Warnf("Handle Enable Ue Reachability is not implemented.") c.JSON(http.StatusNotImplemented, gin.H{}) } + +func (s *Server) HTTPEnableGroupReachability(c *gin.Context) { + c.JSON(http.StatusNotImplemented, gin.H{}) +} diff --git a/internal/sbi/api_oam.go b/internal/sbi/api_oam.go index 1fcc9a0..c6ca5de 100644 --- a/internal/sbi/api_oam.go +++ b/internal/sbi/api_oam.go @@ -16,11 +16,13 @@ func (s *Server) getOAMRoutes() []Route { }, }, { + Name: "RegisteredUEContext", Method: http.MethodGet, Pattern: "/registered-ue-context", APIFunc: s.HTTPRegisteredUEContext, }, { + Name: "RegisteredUEContext", Method: http.MethodGet, Pattern: "/registered-ue-context/:supi", APIFunc: s.HTTPRegisteredUEContext, diff --git a/internal/sbi/server.go b/internal/sbi/server.go index 1df7e00..76e928f 100644 --- a/internal/sbi/server.go +++ b/internal/sbi/server.go @@ -113,6 +113,22 @@ func newRouter(s *Server) *gin.Engine { routerAuthorizationCheck.Check(c, amf_context.GetSelf()) }) applyRoutes(amfOAMGroup, amfOAMRoutes) + case models.ServiceName_NAMF_MBS_COMM: + amfMbsComGroup := router.Group(factory.AmfMbsComResUriPrefix) + amfMbsComRoutes := s.getMbsCommunicationRoutes() + routerAuthorizationCheck := util_oauth.NewRouterAuthorizationCheck(models.ServiceName_NAMF_MBS_COMM) + amfMbsComGroup.Use(func(c *gin.Context) { + routerAuthorizationCheck.Check(c, amf_context.GetSelf()) + }) + applyRoutes(amfMbsComGroup, amfMbsComRoutes) + case models.ServiceName_NAMF_MBS_BC: + amfMbsBCGroup := router.Group(factory.AmfMbsBCResUriPrefix) + amfMbsBCRoutes := s.getMbsBroadcastRoutes() + routerAuthorizationCheck := util_oauth.NewRouterAuthorizationCheck(models.ServiceName_NAMF_MBS_BC) + amfMbsBCGroup.Use(func(c *gin.Context) { + routerAuthorizationCheck.Check(c, amf_context.GetSelf()) + }) + applyRoutes(amfMbsBCGroup, amfMbsBCRoutes) } } diff --git a/pkg/factory/config.go b/pkg/factory/config.go index ad70f4d..5cd9e3c 100644 --- a/pkg/factory/config.go +++ b/pkg/factory/config.go @@ -38,6 +38,8 @@ const ( AmfLocResUriPrefix = "/namf-loc/v1" AmfMtResUriPrefix = "/namf-mt/v1" AmfOamResUriPrefix = "/namf-oam/v1" + AmfMbsComResUriPrefix = "/namf-mbs-comm/v1" + AmfMbsBCResUriPrefix = "/namf-mbs-bc/v1" ) type Config struct {