// This can be used to remove all subscriptions db from
if s == "emptydb" {
xapp.Logger.Debug("RemoveAllSubscriptionsFromSdl() called")
- c.RemoveAllSubscriptionsFromSdl()
- c.RemoveAllRESTSubscriptionsFromSdl()
+ err := c.RemoveAllSubscriptionsFromSdl()
+ if err != nil {
+ xapp.Logger.Error("RemoveAllSubscriptionsFromSdl() RemoveAllSubscriptionsFromSdl() failure: %s", err.Error())
+ }
+ err = c.RemoveAllRESTSubscriptionsFromSdl()
+ if err != nil {
+ xapp.Logger.Error("RemoveAllRESTSubscriptionsFromSdl() RemoveAllSubscriptionsFromSdl() failure: %s", err.Error())
+ }
return
}
// Get all REST Subscriptions in subscription manager
xapp.Logger.Debug("GetAllRestSubscriptions() called")
- w.Write(c.registry.GetAllRestSubscriptionsJson())
+ _, err := w.Write(c.registry.GetAllRestSubscriptionsJson())
+ if err != nil {
+ xapp.Logger.Error("GetAllRestSubscriptions() w.Write failure: %s", err.Error())
+ }
}
func (c *Control) GetAllE2Nodes(w http.ResponseWriter, r *http.Request) {
ranName := pathParams["ranName"]
xapp.Logger.Debug("GetAllE2NodeRestSubscriptions() ranName=%s", ranName)
if ranName != "" {
- w.Write(c.registry.GetAllE2NodeRestSubscriptionsJson(ranName))
+ _, err := w.Write(c.registry.GetAllE2NodeRestSubscriptionsJson(ranName))
+ if err != nil {
+ xapp.Logger.Error("GetAllE2NodeRestSubscriptions() w.Write failure: %s", err.Error())
+ }
} else {
xapp.Logger.Debug("GetAllE2NodeRestSubscriptions() Invalid path %s", ranName)
w.WriteHeader(400) // Bad request
// Get all xApps in subscription manager
xapp.Logger.Debug("GetAllXapps() called: Req= %v", r.URL.Path)
- w.Write(c.registry.GetAllXappsJson())
+ _, err := w.Write(c.registry.GetAllXappsJson())
+ if err != nil {
+ xapp.Logger.Error("GetAllXapps() w.Write failure: %s", err.Error())
+ }
}
func (c *Control) GetAllXappRestSubscriptions(w http.ResponseWriter, r *http.Request) {
xappServiceName := pathParams["xappServiceName"]
xapp.Logger.Debug("GetAllXappRestSubscriptions() xappServiceName=%s", xappServiceName)
if xappServiceName != "" {
- w.Write(c.registry.GetAllXappRestSubscriptionsJson(xappServiceName))
+ _, err := w.Write(c.registry.GetAllXappRestSubscriptionsJson(xappServiceName))
+ if err != nil {
+ xapp.Logger.Error("GetAllXappRestSubscriptions() w.Write failure: %s", err.Error())
+ }
} else {
xapp.Logger.Debug("GetAllXappRestSubscriptions() Invalid path %s", xappServiceName)
w.WriteHeader(400) // Bad request
if err != nil {
w.WriteHeader(404) // Not found
} else {
- w.Write(e2Subscriptions)
+ _, err := w.Write(e2Subscriptions)
+ if err != nil {
+ xapp.Logger.Error("GetE2Subscriptions() w.Write failure: %s", err.Error())
+ }
}
}