RIC-395: E2M new REST API: E2M Set Parameters
[ric-plt/e2mgr.git] / E2Manager / controllers / nodeb_controller.go
index d30db6b..49e821d 100644 (file)
@@ -51,6 +51,7 @@ type INodebController interface {
        GetNodeb(writer http.ResponseWriter, r *http.Request)
        UpdateGnb(writer http.ResponseWriter, r *http.Request)
        GetNodebIdList(writer http.ResponseWriter, r *http.Request)
+       SetGeneralConfiguration(writer http.ResponseWriter, r *http.Request)
 }
 
 type NodebController struct {
@@ -92,11 +93,22 @@ func (c *NodebController) UpdateGnb(writer http.ResponseWriter, r *http.Request)
                return
        }
 
-       request.Gnb = &gnb;
+       request.Gnb = &gnb
        request.RanName = ranName
        c.handleRequest(writer, &r.Header, httpmsghandlerprovider.UpdateGnbRequest, request, true)
 }
 
+func (c *NodebController) SetGeneralConfiguration(writer http.ResponseWriter, r *http.Request) {
+       c.logger.Infof("[Client -> E2 Manager] #NodebController.SetGeneralConfiguration - request: %v", c.prettifyRequest(r))
+
+       request := models.GeneralConfigurationRequest{}
+
+       if !c.extractJsonBody(r, &request, writer){
+               return
+       }
+       c.handleRequest(writer, &r.Header, httpmsghandlerprovider.SetGeneralConfigurationRequest, request, false)
+}
+
 func (c *NodebController) Shutdown(writer http.ResponseWriter, r *http.Request) {
        c.logger.Infof("[Client -> E2 Manager] #NodebController.Shutdown - request: %v", c.prettifyRequest(r))
        c.handleRequest(writer, &r.Header, httpmsghandlerprovider.ShutdownRequest, nil, false)