First commit
This commit is contained in:
25
setup/e2mgr/tools/RoutingManagerSimulator/go/README.md
Executable file
25
setup/e2mgr/tools/RoutingManagerSimulator/go/README.md
Executable file
@@ -0,0 +1,25 @@
|
||||
# Go API Server for swagger
|
||||
|
||||
This is the Swagger/OpenAPI 2.0 definition of Routing Manager's Northbound API.
|
||||
|
||||
## Overview
|
||||
This server was generated by the [swagger-codegen]
|
||||
(https://github.com/swagger-api/swagger-codegen) project.
|
||||
By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub.
|
||||
-
|
||||
|
||||
To see how to make this your own, look here:
|
||||
|
||||
[README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md)
|
||||
|
||||
- API version: 0.4.0
|
||||
- Build date: 2019-12-30T10:52:31.803Z
|
||||
|
||||
|
||||
### Running the server
|
||||
To run the server, follow these simple steps:
|
||||
|
||||
```
|
||||
go run main.go
|
||||
```
|
||||
|
79
setup/e2mgr/tools/RoutingManagerSimulator/go/api_handle.go
Executable file
79
setup/e2mgr/tools/RoutingManagerSimulator/go/api_handle.go
Executable file
@@ -0,0 +1,79 @@
|
||||
//
|
||||
// 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).
|
||||
|
||||
|
||||
/*
|
||||
* Routing Manager
|
||||
*
|
||||
* This is the Swagger/OpenAPI 2.0 definition of Routing Manager's Northbound API.
|
||||
*
|
||||
* API version: 0.4.0
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
*/
|
||||
|
||||
package swagger
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func AssociateRanToE2tHandle(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
}
|
||||
|
||||
func CreateNewE2tHandle(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
}
|
||||
|
||||
func DeleteE2tHandle(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
}
|
||||
|
||||
func DeleteXappSubscriptionHandle(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
}
|
||||
|
||||
func DissociateRan(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
}
|
||||
|
||||
func GetHandles(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
}
|
||||
|
||||
func ProvideXappHandle(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
}
|
||||
|
||||
func ProvideXappSubscriptionHandle(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
}
|
||||
|
||||
func UpdateXappSubscriptionHandle(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
}
|
38
setup/e2mgr/tools/RoutingManagerSimulator/go/api_health.go
Executable file
38
setup/e2mgr/tools/RoutingManagerSimulator/go/api_health.go
Executable file
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// 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).
|
||||
|
||||
/*
|
||||
* Routing Manager
|
||||
*
|
||||
* This is the Swagger/OpenAPI 2.0 definition of Routing Manager's Northbound API.
|
||||
*
|
||||
* API version: 0.4.0
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
*/
|
||||
|
||||
package swagger
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func GetHealth(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
}
|
64
setup/e2mgr/tools/RoutingManagerSimulator/go/logger.go
Executable file
64
setup/e2mgr/tools/RoutingManagerSimulator/go/logger.go
Executable file
@@ -0,0 +1,64 @@
|
||||
//
|
||||
// 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).
|
||||
|
||||
/*
|
||||
* Routing Manager
|
||||
*
|
||||
* This is the Swagger/OpenAPI 2.0 definition of Routing Manager's Northbound API.
|
||||
*
|
||||
* API version: 0.4.0
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
*/
|
||||
|
||||
package swagger
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
func Logger(inner http.Handler, name string) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
start := time.Now()
|
||||
|
||||
inner.ServeHTTP(w, r)
|
||||
|
||||
body, err := ioutil.ReadAll(r.Body)
|
||||
if err != nil {
|
||||
log.Printf("Error reading body: %v", err)
|
||||
http.Error(w, "can't read body", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
buffer := new(bytes.Buffer)
|
||||
_ =json.Compact(buffer, body)
|
||||
|
||||
log.Printf(
|
||||
"%s %s body: %s elapsed: %s",
|
||||
r.Method,
|
||||
r.RequestURI,
|
||||
buffer,
|
||||
time.Since(start),
|
||||
)
|
||||
})
|
||||
}
|
36
setup/e2mgr/tools/RoutingManagerSimulator/go/model_e2t_data.go
Executable file
36
setup/e2mgr/tools/RoutingManagerSimulator/go/model_e2t_data.go
Executable file
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// 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).
|
||||
|
||||
/*
|
||||
* Routing Manager
|
||||
*
|
||||
* This is the Swagger/OpenAPI 2.0 definition of Routing Manager's Northbound API.
|
||||
*
|
||||
* API version: 0.4.0
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
*/
|
||||
|
||||
package swagger
|
||||
|
||||
type E2tData struct {
|
||||
|
||||
E2TAddress string `json:"E2TAddress"`
|
||||
|
||||
RanNamelist *RanNamelist `json:"ranNamelist,omitempty"`
|
||||
}
|
38
setup/e2mgr/tools/RoutingManagerSimulator/go/model_e2t_delete_data.go
Executable file
38
setup/e2mgr/tools/RoutingManagerSimulator/go/model_e2t_delete_data.go
Executable file
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// 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).
|
||||
|
||||
/*
|
||||
* Routing Manager
|
||||
*
|
||||
* This is the Swagger/OpenAPI 2.0 definition of Routing Manager's Northbound API.
|
||||
*
|
||||
* API version: 0.4.0
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
*/
|
||||
|
||||
package swagger
|
||||
|
||||
type E2tDeleteData struct {
|
||||
|
||||
E2TAddress string `json:"E2TAddress"`
|
||||
|
||||
RanNamelistTobeDissociated *RanNamelist `json:"ranNamelistTobeDissociated,omitempty"`
|
||||
|
||||
RanAssocList *RanE2tMap `json:"ranAssocList,omitempty"`
|
||||
}
|
34
setup/e2mgr/tools/RoutingManagerSimulator/go/model_health_status.go
Executable file
34
setup/e2mgr/tools/RoutingManagerSimulator/go/model_health_status.go
Executable file
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// 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).
|
||||
|
||||
/*
|
||||
* Routing Manager
|
||||
*
|
||||
* This is the Swagger/OpenAPI 2.0 definition of Routing Manager's Northbound API.
|
||||
*
|
||||
* API version: 0.4.0
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
*/
|
||||
|
||||
package swagger
|
||||
|
||||
type HealthStatus struct {
|
||||
|
||||
Status string `json:"status,omitempty"`
|
||||
}
|
36
setup/e2mgr/tools/RoutingManagerSimulator/go/model_ran_e2t_element.go
Executable file
36
setup/e2mgr/tools/RoutingManagerSimulator/go/model_ran_e2t_element.go
Executable file
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// 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).
|
||||
|
||||
/*
|
||||
* Routing Manager
|
||||
*
|
||||
* This is the Swagger/OpenAPI 2.0 definition of Routing Manager's Northbound API.
|
||||
*
|
||||
* API version: 0.4.0
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
*/
|
||||
|
||||
package swagger
|
||||
|
||||
type RanE2tElement struct {
|
||||
|
||||
E2TAddress string `json:"E2TAddress"`
|
||||
|
||||
RanNamelist *RanNamelist `json:"ranNamelist,omitempty"`
|
||||
}
|
32
setup/e2mgr/tools/RoutingManagerSimulator/go/model_ran_e2t_map.go
Executable file
32
setup/e2mgr/tools/RoutingManagerSimulator/go/model_ran_e2t_map.go
Executable file
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// 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).
|
||||
|
||||
/*
|
||||
* Routing Manager
|
||||
*
|
||||
* This is the Swagger/OpenAPI 2.0 definition of Routing Manager's Northbound API.
|
||||
*
|
||||
* API version: 0.4.0
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
*/
|
||||
|
||||
package swagger
|
||||
|
||||
type RanE2tMap struct {
|
||||
}
|
32
setup/e2mgr/tools/RoutingManagerSimulator/go/model_ran_namelist.go
Executable file
32
setup/e2mgr/tools/RoutingManagerSimulator/go/model_ran_namelist.go
Executable file
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// 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).
|
||||
|
||||
/*
|
||||
* Routing Manager
|
||||
*
|
||||
* This is the Swagger/OpenAPI 2.0 definition of Routing Manager's Northbound API.
|
||||
*
|
||||
* API version: 0.4.0
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
*/
|
||||
|
||||
package swagger
|
||||
|
||||
type RanNamelist struct {
|
||||
}
|
40
setup/e2mgr/tools/RoutingManagerSimulator/go/model_xapp_callback_data.go
Executable file
40
setup/e2mgr/tools/RoutingManagerSimulator/go/model_xapp_callback_data.go
Executable file
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// 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).
|
||||
|
||||
/*
|
||||
* Routing Manager
|
||||
*
|
||||
* This is the Swagger/OpenAPI 2.0 definition of Routing Manager's Northbound API.
|
||||
*
|
||||
* API version: 0.4.0
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
*/
|
||||
|
||||
package swagger
|
||||
|
||||
type XappCallbackData struct {
|
||||
|
||||
Id string `json:"id,omitempty"`
|
||||
|
||||
Event string `json:"event,omitempty"`
|
||||
|
||||
Version int64 `json:"version,omitempty"`
|
||||
|
||||
XApps string `json:"xApps,omitempty"`
|
||||
}
|
36
setup/e2mgr/tools/RoutingManagerSimulator/go/model_xapp_element.go
Executable file
36
setup/e2mgr/tools/RoutingManagerSimulator/go/model_xapp_element.go
Executable file
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// 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).
|
||||
|
||||
/*
|
||||
* Routing Manager
|
||||
*
|
||||
* This is the Swagger/OpenAPI 2.0 definition of Routing Manager's Northbound API.
|
||||
*
|
||||
* API version: 0.4.0
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
*/
|
||||
|
||||
package swagger
|
||||
|
||||
type XappElement struct {
|
||||
|
||||
Address string `json:"address"`
|
||||
|
||||
Port int32 `json:"port"`
|
||||
}
|
32
setup/e2mgr/tools/RoutingManagerSimulator/go/model_xapp_list.go
Executable file
32
setup/e2mgr/tools/RoutingManagerSimulator/go/model_xapp_list.go
Executable file
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// 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).
|
||||
|
||||
/*
|
||||
* Routing Manager
|
||||
*
|
||||
* This is the Swagger/OpenAPI 2.0 definition of Routing Manager's Northbound API.
|
||||
*
|
||||
* API version: 0.4.0
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
*/
|
||||
|
||||
package swagger
|
||||
|
||||
type XappList struct {
|
||||
}
|
38
setup/e2mgr/tools/RoutingManagerSimulator/go/model_xapp_subscription_data.go
Executable file
38
setup/e2mgr/tools/RoutingManagerSimulator/go/model_xapp_subscription_data.go
Executable file
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// 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).
|
||||
|
||||
/*
|
||||
* Routing Manager
|
||||
*
|
||||
* This is the Swagger/OpenAPI 2.0 definition of Routing Manager's Northbound API.
|
||||
*
|
||||
* API version: 0.4.0
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
*/
|
||||
|
||||
package swagger
|
||||
|
||||
type XappSubscriptionData struct {
|
||||
|
||||
Address string `json:"address"`
|
||||
|
||||
Port int32 `json:"port"`
|
||||
|
||||
SubscriptionId int32 `json:"subscription_id"`
|
||||
}
|
146
setup/e2mgr/tools/RoutingManagerSimulator/go/routers.go
Executable file
146
setup/e2mgr/tools/RoutingManagerSimulator/go/routers.go
Executable file
@@ -0,0 +1,146 @@
|
||||
//
|
||||
// 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).
|
||||
|
||||
/*
|
||||
* Routing Manager
|
||||
*
|
||||
* This is the Swagger/OpenAPI 2.0 definition of Routing Manager's Northbound API.
|
||||
*
|
||||
* API version: 0.4.0
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
*/
|
||||
|
||||
package swagger
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
)
|
||||
|
||||
type Route struct {
|
||||
Name string
|
||||
Method string
|
||||
Pattern string
|
||||
HandlerFunc http.HandlerFunc
|
||||
}
|
||||
|
||||
type Routes []Route
|
||||
|
||||
func NewRouter() *mux.Router {
|
||||
router := mux.NewRouter().StrictSlash(true)
|
||||
for _, route := range routes {
|
||||
var handler http.Handler
|
||||
handler = route.HandlerFunc
|
||||
handler = Logger(handler, route.Name)
|
||||
|
||||
router.
|
||||
Methods(route.Method).
|
||||
Path(route.Pattern).
|
||||
Name(route.Name).
|
||||
Handler(handler)
|
||||
}
|
||||
|
||||
return router
|
||||
}
|
||||
|
||||
func Index(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprintf(w, "Hello World!")
|
||||
}
|
||||
|
||||
var routes = Routes{
|
||||
Route{
|
||||
"Index",
|
||||
"GET",
|
||||
"/ric/v1/",
|
||||
Index,
|
||||
},
|
||||
|
||||
Route{
|
||||
"AssociateRanToE2tHandle",
|
||||
strings.ToUpper("Post"),
|
||||
"/ric/v1/handles/associate-ran-to-e2t",
|
||||
AssociateRanToE2tHandle,
|
||||
},
|
||||
|
||||
Route{
|
||||
"CreateNewE2tHandle",
|
||||
strings.ToUpper("Post"),
|
||||
"/ric/v1/handles/e2t",
|
||||
CreateNewE2tHandle,
|
||||
},
|
||||
|
||||
Route{
|
||||
"DeleteE2tHandle",
|
||||
strings.ToUpper("Delete"),
|
||||
"/ric/v1/handles/e2t",
|
||||
DeleteE2tHandle,
|
||||
},
|
||||
|
||||
Route{
|
||||
"DeleteXappSubscriptionHandle",
|
||||
strings.ToUpper("Delete"),
|
||||
"/ric/v1/handles/xapp-subscription-handle",
|
||||
DeleteXappSubscriptionHandle,
|
||||
},
|
||||
|
||||
Route{
|
||||
"DissociateRan",
|
||||
strings.ToUpper("Post"),
|
||||
"/ric/v1/handles/dissociate-ran",
|
||||
DissociateRan,
|
||||
},
|
||||
|
||||
Route{
|
||||
"GetHandles",
|
||||
strings.ToUpper("Get"),
|
||||
"/ric/v1/handles",
|
||||
GetHandles,
|
||||
},
|
||||
|
||||
Route{
|
||||
"ProvideXappHandle",
|
||||
strings.ToUpper("Post"),
|
||||
"/ric/v1/handles/xapp-handle",
|
||||
ProvideXappHandle,
|
||||
},
|
||||
|
||||
Route{
|
||||
"ProvideXappSubscriptionHandle",
|
||||
strings.ToUpper("Post"),
|
||||
"/ric/v1/handles/xapp-subscription-handle",
|
||||
ProvideXappSubscriptionHandle,
|
||||
},
|
||||
|
||||
Route{
|
||||
"UpdateXappSubscriptionHandle",
|
||||
strings.ToUpper("Put"),
|
||||
"/ric/v1/handles/xapp-subscription-handle/{subscription_id}",
|
||||
UpdateXappSubscriptionHandle,
|
||||
},
|
||||
|
||||
Route{
|
||||
"GetHealth",
|
||||
strings.ToUpper("Get"),
|
||||
"/ric/v1/health",
|
||||
GetHealth,
|
||||
},
|
||||
}
|
Reference in New Issue
Block a user