Code Review
/
ric-plt
/
rtmgr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Multiple E2T instance feature - Introduced APIs Delete E2T Instance and associate...
[ric-plt/rtmgr.git]
/
pkg
/
nbi
/
httpgetter.go
diff --git
a/pkg/nbi/httpgetter.go
b/pkg/nbi/httpgetter.go
index
0bf05bc
..
5d7b818
100644
(file)
--- a/
pkg/nbi/httpgetter.go
+++ b/
pkg/nbi/httpgetter.go
@@
-32,11
+32,13
@@
package nbi
import (
"encoding/json"
import (
"encoding/json"
+ "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
"net/http"
"routing-manager/pkg/rpe"
"routing-manager/pkg/rtmgr"
"routing-manager/pkg/sdl"
"time"
"net/http"
"routing-manager/pkg/rpe"
"routing-manager/pkg/rtmgr"
"routing-manager/pkg/sdl"
"time"
+ "sync"
)
type HttpGetter struct {
)
type HttpGetter struct {
@@
-53,7
+55,7
@@
func NewHttpGetter() *HttpGetter {
var myClient = &http.Client{Timeout: 5 * time.Second}
func fetchAllXApps(xmurl string) (*[]rtmgr.XApp, error) {
var myClient = &http.Client{Timeout: 5 * time.Second}
func fetchAllXApps(xmurl string) (*[]rtmgr.XApp, error) {
-
rtmgr
.Logger.Info("Invoked httpGetter.fetchXappList: " + xmurl)
+
xapp
.Logger.Info("Invoked httpGetter.fetchXappList: " + xmurl)
r, err := myClient.Get(xmurl)
if err != nil {
return nil, err
r, err := myClient.Get(xmurl)
if err != nil {
return nil, err
@@
-61,22
+63,22
@@
func fetchAllXApps(xmurl string) (*[]rtmgr.XApp, error) {
defer r.Body.Close()
if r.StatusCode == 200 {
defer r.Body.Close()
if r.StatusCode == 200 {
-
rtmgr
.Logger.Debug("http client raw response: %v", r)
+
xapp
.Logger.Debug("http client raw response: %v", r)
var xApps []rtmgr.XApp
err = json.NewDecoder(r.Body).Decode(&xApps)
if err != nil {
var xApps []rtmgr.XApp
err = json.NewDecoder(r.Body).Decode(&xApps)
if err != nil {
-
rtmgr
.Logger.Warn("Json decode failed: " + err.Error())
+
xapp
.Logger.Warn("Json decode failed: " + err.Error())
}
}
-
rtmgr
.Logger.Info("HTTP GET: OK")
-
rtmgr
.Logger.Debug("httpGetter.fetchXappList returns: %v", xApps)
+
xapp
.Logger.Info("HTTP GET: OK")
+
xapp
.Logger.Debug("httpGetter.fetchXappList returns: %v", xApps)
return &xApps, err
}
return &xApps, err
}
-
rtmgr
.Logger.Warn("httpGetter got an unexpected http status code: %v", r.StatusCode)
+
xapp
.Logger.Warn("httpGetter got an unexpected http status code: %v", r.StatusCode)
return nil, nil
}
func (g *HttpGetter) Initialize(xmurl string, nbiif string, fileName string, configfile string,
return nil, nil
}
func (g *HttpGetter) Initialize(xmurl string, nbiif string, fileName string, configfile string,
- sdlEngine sdl.Engine, rpeEngine rpe.Engine, triggerSBI chan<- bool) error {
+ sdlEngine sdl.Engine, rpeEngine rpe.Engine, triggerSBI chan<- bool
, m *sync.Mutex
) error {
return nil
}
return nil
}