[RIC-297] Update GNB Request REST API - Validation
Change-Id: I6ed0e435af31dbc6aaeee67653277525ad930020
Signed-off-by: idanshal <idan.shalom@intl.att.com>
diff --git a/E2Manager/models/update_gnb_request.go b/E2Manager/models/update_gnb_request.go
new file mode 100644
index 0000000..7c039d6
--- /dev/null
+++ b/E2Manager/models/update_gnb_request.go
@@ -0,0 +1,27 @@
+//
+// Copyright 2019 AT&T Intellectual Property
+// Copyright 2019 Nokia
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// This source code is part of the near-RT RIC (RAN Intelligent Controller)
+// platform project (RICP).
+
+package models
+
+import "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
+
+type UpdateGnbRequest struct {
+ RanName string
+ *entities.Gnb
+}
diff --git a/E2Manager/models/update_gnb_response.go b/E2Manager/models/update_gnb_response.go
new file mode 100644
index 0000000..59131e5
--- /dev/null
+++ b/E2Manager/models/update_gnb_response.go
@@ -0,0 +1,48 @@
+//
+// Copyright 2019 AT&T Intellectual Property
+// Copyright 2019 Nokia
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// This source code is part of the near-RT RIC (RAN Intelligent Controller)
+// platform project (RICP).
+
+package models
+
+import (
+ "e2mgr/e2managererrors"
+ "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
+ "github.com/golang/protobuf/jsonpb"
+)
+
+type UpdateGnbResponse struct {
+ nodebInfo *entities.NodebInfo
+}
+
+func NewUpdateGnbResponse(nodebInfo *entities.NodebInfo) *UpdateGnbResponse {
+ return &UpdateGnbResponse{
+ nodebInfo: nodebInfo,
+ }
+}
+
+func (response *UpdateGnbResponse) Marshal() ([]byte, error) {
+ m := jsonpb.Marshaler{}
+ result, err := m.MarshalToString(response.nodebInfo)
+
+ if err != nil {
+ return nil, e2managererrors.NewInternalError()
+ }
+
+ return []byte(result), nil
+
+}