X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fnbi%2Fnbi.go;h=2b9fa994f0da7b4ac7870c9d89098d220d662be3;hb=refs%2Fchanges%2F55%2F1055%2F1;hp=cee3374686004e10855dcff66906c2e4d73a53a5;hpb=eb2ff0d217caf158dd15424bf70f8aa79c3742b1;p=ric-plt%2Frtmgr.git diff --git a/pkg/nbi/nbi.go b/pkg/nbi/nbi.go index cee3374..2b9fa99 100644 --- a/pkg/nbi/nbi.go +++ b/pkg/nbi/nbi.go @@ -38,15 +38,15 @@ import ( ) var ( - SupportedNbis = []*NbiEngineConfig{ - &NbiEngineConfig{ + SupportedNbis = []*EngineConfig{ + { Name: "httpGetter", Version: "v1", Protocol: "http", Instance: NewHttpGetter(), IsAvailable: true, }, - &NbiEngineConfig{ + { Name: "httpRESTful", Version: "v1", Protocol: "http", @@ -59,7 +59,7 @@ var ( type Nbi struct { } -func GetNbi(nbiName string) (NbiEngine, error) { +func GetNbi(nbiName string) (Engine, error) { for _, nbi := range SupportedNbis { if nbi.Name == nbiName && nbi.IsAvailable { return nbi.Instance, nil @@ -69,7 +69,7 @@ func GetNbi(nbiName string) (NbiEngine, error) { } func CreateSubReq(restUrl string, restPort string) *appmgr_model.SubscriptionRequest { - // TODO: parametize function + // TODO: parameterize function subReq := appmgr_model.SubscriptionRequest{ TargetURL: swag.String(restUrl + ":" + restPort + "/ric/v1/handles/xapp-handle/"), EventType: swag.String("all"), @@ -96,7 +96,7 @@ func PostSubReq(xmUrl string, nbiif string) error { client := apiclient.New(transport, strfmt.Default) addSubParams := operations.NewAddSubscriptionParamsWithTimeout(10 * time.Second) // create sub req with rest url and port - subReq := CreateSubReq(string(nbiifUrl.Scheme+"://"+nbiifUrl.Hostname()), nbiifUrl.Port()) + subReq := CreateSubReq(nbiifUrl.Scheme+"://"+nbiifUrl.Hostname(), nbiifUrl.Port()) resp, postErr := client.Operations.AddSubscription(addSubParams.WithSubscriptionRequest(subReq)) if postErr != nil { rtmgr.Logger.Error("POST unsuccessful:" + postErr.Error())