- version 0.3.2 updated
Change-Id: I3c99c9d3f48d2f74ba829a53e0f9a1391ea2661b
Signed-off-by: 1000044 <gergo.mocsi@nokia.com>
WORKDIR /go/src/routing-manager
RUN git clone "https://gerrit.o-ran-sc.org/r/ric-plt/appmgr" \
WORKDIR /go/src/routing-manager
RUN git clone "https://gerrit.o-ran-sc.org/r/ric-plt/appmgr" \
- && cp appmgr/api/appmgr_rest_api.json api/ \
+ && cp appmgr/api/appmgr_rest_api.yaml api/ \
&& rm -rf appmgr
RUN swagger generate server -f api/routing_manager.yaml -t pkg/ --exclude-main -r LICENSE
&& rm -rf appmgr
RUN swagger generate server -f api/routing_manager.yaml -t pkg/ --exclude-main -r LICENSE
-RUN swagger generate client -f api/appmgr_rest_api.json -t pkg/ -m appmgr_model -c appmgr_client -r LICENSE
+RUN swagger generate client -f api/appmgr_rest_api.yaml -t pkg/ -m appmgr_model -c appmgr_client -r LICENSE
RUN glide install --strip-vendor
RUN glide install --strip-vendor
go build cmd/rtmgr.go
```
go build cmd/rtmgr.go
```
+**NOTE:** before doing a docker build it is advised to remove any generated files and vendor packages:
+```bash
+# assuming that you stand in project root dir
+rm -rf appmgr vendor pkg/appmgr_* pkg/models pkg/restapi
+```
+
### Installing Routing Manager
#### Preparing environment
Tag the `rtmgr` container according to the project release and push it to a registry accessible from all minions of the Kubernetes cluster.
### Installing Routing Manager
#### Preparing environment
Tag the `rtmgr` container according to the project release and push it to a registry accessible from all minions of the Kubernetes cluster.
+### v0.3.2
+* Minor code changes due to appmgr/rtmgr api differences
+* Doc update
+* UT fixes
+
+### v0.3.1
+* Removed "rte" route types and made all routes to construct of "mse" literal.
+
### v0.3.0
* Introduced platform-specific routes: basic components (e2term, ueman, subman, e2man) are stored in a json file (example in manifests/rtmgr/rtmgr-cfg.yaml)
* Introduced subscription add functionality: /ric/v1/xapp-subscriptions endpoint is active, on a POST method it generates endpoint specific mse routing table entries
### v0.3.0
* Introduced platform-specific routes: basic components (e2term, ueman, subman, e2man) are stored in a json file (example in manifests/rtmgr/rtmgr-cfg.yaml)
* Introduced subscription add functionality: /ric/v1/xapp-subscriptions endpoint is active, on a POST method it generates endpoint specific mse routing table entries
name: "Apache 2.0"
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
host: "rtmgr"
name: "Apache 2.0"
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
host: "rtmgr"
tags:
- name: "handle"
description: "Available handles"
tags:
- name: "handle"
description: "Available handles"
format: "int64"
event:
type: "string"
format: "int64"
event:
type: "string"
type: "integer"
format: "int64"
type: "integer"
format: "int64"
type: "string" #This should be a JSON object, array of xapps
xapp-subscription-data:
type: "object"
type: "string" #This should be a JSON object, array of xapps
xapp-subscription-data:
type: "object"
# By default this file is in the docker build directory,
# but the location can configured in the JJB template.
---
# By default this file is in the docker build directory,
# but the location can configured in the JJB template.
---
- name: NBI
value: "httpRESTful"
- name: NBIURL
- name: NBI
value: "httpRESTful"
- name: NBIURL
- value: "http://0.0.0.0:8888"
+ value: "http://rtmgr:8888"
- name: CFGFILE
value: "/cfg/rtmgr-config.json"
- name: LOGLEVEL
- name: CFGFILE
value: "/cfg/rtmgr-config.json"
- name: LOGLEVEL
}
if nil != xappData {
var xapps []rtmgr.XApp
}
if nil != xappData {
var xapps []rtmgr.XApp
- err := json.Unmarshal([]byte(xappData.Data), &xapps)
+ err := json.Unmarshal([]byte(xappData.XApps), &xapps)
return &xapps, err
} else {
rtmgr.Logger.Info("No data")
return &xapps, err
} else {
rtmgr.Logger.Info("No data")
}
func validateXappCallbackData(callbackData *models.XappCallbackData) error {
}
func validateXappCallbackData(callbackData *models.XappCallbackData) error {
- if len(callbackData.Data) == 0 {
- return fmt.Errorf("Invalid Data field: \"%s\"", callbackData.Data)
+ if len(callbackData.XApps) == 0 {
+ return fmt.Errorf("Invalid Data field: \"%s\"", callbackData.XApps)
- err := json.Unmarshal([]byte(callbackData.Data), &xapps)
+ err := json.Unmarshal([]byte(callbackData.XApps), &xapps)
if err != nil {
return fmt.Errorf("Unmarshal failed: \"%s\"", err.Error())
}
if err != nil {
return fmt.Errorf("Unmarshal failed: \"%s\"", err.Error())
}
func TestRecvXappCallbackData(t *testing.T) {
data := models.XappCallbackData {
func TestRecvXappCallbackData(t *testing.T) {
data := models.XappCallbackData {
- Data: *swag.String("[]"),
- DataVersion: *swag.Int64(1),
+ XApps: *swag.String("[]"),
+ Version: *swag.Int64(1),
Event: *swag.String("any"),
ID: *swag.Int64(123456),
}
Event: *swag.String("any"),
ID: *swag.Int64(123456),
}
datach := make(chan *models.XappCallbackData, 10)
defer close(datach)
data := models.XappCallbackData{
datach := make(chan *models.XappCallbackData, 10)
defer close(datach)
data := models.XappCallbackData{
- Data: *swag.String("[]"),
- DataVersion: *swag.Int64(1),
+ XApps: *swag.String("[]"),
+ Version: *swag.Int64(1),
Event: *swag.String("someevent"),
ID: *swag.Int64(123456)}
var httpRestful, _ = GetNbi("httpRESTful")
Event: *swag.String("someevent"),
ID: *swag.Int64(123456)}
var httpRestful, _ = GetNbi("httpRESTful")
func TestValidateXappCallbackData(t *testing.T) {
data := models.XappCallbackData{
func TestValidateXappCallbackData(t *testing.T) {
data := models.XappCallbackData{
- Data: *swag.String("[]"),
- DataVersion: *swag.Int64(1),
+ XApps: *swag.String("[]"),
+ Version: *swag.Int64(1),
Event: *swag.String("someevent"),
ID: *swag.Int64(123456)}
Event: *swag.String("someevent"),
ID: *swag.Int64(123456)}
func TestValidateXappCallbackDataWithInvalidData(t *testing.T) {
data := models.XappCallbackData{
func TestValidateXappCallbackDataWithInvalidData(t *testing.T) {
data := models.XappCallbackData{
- Data: *swag.String("{}"),
- DataVersion: *swag.Int64(1),
+ XApps: *swag.String("{}"),
+ Version: *swag.Int64(1),
Event: *swag.String("someevent"),
ID: *swag.Int64(123456)}
Event: *swag.String("someevent"),
ID: *swag.Int64(123456)}
client := apiclient.New(transport, strfmt.Default)
addSubParams := operations.NewAddSubscriptionParamsWithTimeout(10 * time.Second)
// create sub req with rest url and port
client := apiclient.New(transport, strfmt.Default)
addSubParams := operations.NewAddSubscriptionParamsWithTimeout(10 * time.Second)
// create sub req with rest url and port
- subReq := CreateSubReq(nbiifUrl.Hostname(), nbiifUrl.Port())
+ subReq := CreateSubReq(string(nbiifUrl.Scheme+"://"+nbiifUrl.Hostname()), nbiifUrl.Port())
resp, postErr := client.Operations.AddSubscription(addSubParams.WithSubscriptionRequest(subReq))
if postErr != nil {
rtmgr.Logger.Error("POST unsuccessful:"+postErr.Error())
resp, postErr := client.Operations.AddSubscription(addSubParams.WithSubscriptionRequest(subReq))
if postErr != nil {
rtmgr.Logger.Error("POST unsuccessful:"+postErr.Error())
rawrt := []string{key + "newrt|start\n"}
rt := r.getRouteTable(eps)
for _, rte := range *rt {
rawrt := []string{key + "newrt|start\n"}
rt := r.getRouteTable(eps)
for _, rte := range *rt {
- rawrte := key //+ "rte|" + rte.MessageType
- if rte.SubID == -1 {
- rawrte += "rte|"
- } else {
- rawrte += "mse|"
- }
- rawrte += rte.MessageType
+ rawrte := key + "mse|" + rte.MessageType
for _, tx := range rte.TxList {
rawrte += "," + tx.Ip + ":" + strconv.Itoa(int(tx.Port))
}
for _, tx := range rte.TxList {
rawrte += "," + tx.Ip + ":" + strconv.Itoa(int(tx.Port))
}