X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Frestapi%2Foperations%2Fxapp_framework_api.go;h=5c85580b5327d56e3bc3804f0848e3b3704f357d;hb=9568a2d73b96516b27f54650e309f0d157fb97d9;hp=28f71f259b6bdfd1a568f8136fbfd908da3c3385;hpb=b4c7039b6a720c2b35deb79b3018472243677c70;p=ric-plt%2Fxapp-frame.git diff --git a/pkg/restapi/operations/xapp_framework_api.go b/pkg/restapi/operations/xapp_framework_api.go index 28f71f2..5c85580 100644 --- a/pkg/restapi/operations/xapp_framework_api.go +++ b/pkg/restapi/operations/xapp_framework_api.go @@ -22,6 +22,7 @@ import ( "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/restapi/operations/common" "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/restapi/operations/control" "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/restapi/operations/policy" + "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/restapi/operations/query" "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/restapi/operations/report" ) @@ -45,6 +46,9 @@ func NewXappFrameworkAPI(spec *loads.Document) *XappFrameworkAPI { CommonUnsubscribeHandler: common.UnsubscribeHandlerFunc(func(params common.UnsubscribeParams) middleware.Responder { return middleware.NotImplemented("operation CommonUnsubscribe has not yet been implemented") }), + QueryGetAllSubscriptionsHandler: query.GetAllSubscriptionsHandlerFunc(func(params query.GetAllSubscriptionsParams) middleware.Responder { + return middleware.NotImplemented("operation QueryGetAllSubscriptions has not yet been implemented") + }), ControlSubscribeControlHandler: control.SubscribeControlHandlerFunc(func(params control.SubscribeControlParams) middleware.Responder { return middleware.NotImplemented("operation ControlSubscribeControl has not yet been implemented") }), @@ -87,6 +91,8 @@ type XappFrameworkAPI struct { // CommonUnsubscribeHandler sets the operation handler for the unsubscribe operation CommonUnsubscribeHandler common.UnsubscribeHandler + // QueryGetAllSubscriptionsHandler sets the operation handler for the get all subscriptions operation + QueryGetAllSubscriptionsHandler query.GetAllSubscriptionsHandler // ControlSubscribeControlHandler sets the operation handler for the subscribe control operation ControlSubscribeControlHandler control.SubscribeControlHandler // PolicySubscribePolicyHandler sets the operation handler for the subscribe policy operation @@ -160,6 +166,10 @@ func (o *XappFrameworkAPI) Validate() error { unregistered = append(unregistered, "common.UnsubscribeHandler") } + if o.QueryGetAllSubscriptionsHandler == nil { + unregistered = append(unregistered, "query.GetAllSubscriptionsHandler") + } + if o.ControlSubscribeControlHandler == nil { unregistered = append(unregistered, "control.SubscribeControlHandler") } @@ -275,6 +285,11 @@ func (o *XappFrameworkAPI) initHandlerCache() { } o.handlers["DELETE"]["/subscriptions/{subscriptionId}"] = common.NewUnsubscribe(o.context, o.CommonUnsubscribeHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/subscriptions"] = query.NewGetAllSubscriptions(o.context, o.QueryGetAllSubscriptionsHandler) + if o.handlers["POST"] == nil { o.handlers["POST"] = make(map[string]http.Handler) }