X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fcontrol%2Fclient.go;h=b62044e60f18cd87333c279a760a061780f4395c;hb=de457a14f98c546fdb009e9915745ef398388ddd;hp=d26bbd0fda966b652706156b8ff68c9af4a9a6a6;hpb=b31b13f2e2603404d57c2f81260a6e2727aaeb97;p=ric-plt%2Fsubmgr.git diff --git a/pkg/control/client.go b/pkg/control/client.go index d26bbd0..b62044e 100644 --- a/pkg/control/client.go +++ b/pkg/control/client.go @@ -21,21 +21,21 @@ package control import ( "fmt" + "strconv" + "strings" + "time" + rtmgrclient "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/rtmgr_client" rtmgrhandle "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/rtmgr_client/handle" "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/rtmgr_models" - "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/xapptweaks" "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp" - "strconv" - "strings" - "time" ) //----------------------------------------------------------------------------- // //----------------------------------------------------------------------------- type SubRouteInfo struct { - EpList xapptweaks.RmrEndpointList + EpList xapp.RmrEndpointList SubID uint16 } @@ -54,7 +54,7 @@ func (rc *RtmgrClient) SubscriptionRequestCreate(subRouteAction SubRouteInfo) er subID := int32(subRouteAction.SubID) xapp.Logger.Debug("CREATE %s ongoing", subRouteAction.String()) createData := rtmgr_models.XappSubscriptionData{&subRouteAction.EpList.Endpoints[0].Addr, &subRouteAction.EpList.Endpoints[0].Port, &subID} - createHandle := rtmgrhandle.NewProvideXappSubscriptionHandleParamsWithTimeout(10 * time.Second) + createHandle := rtmgrhandle.NewProvideXappSubscriptionHandleParamsWithTimeout(2 * time.Second) createHandle.WithXappSubscriptionData(&createData) _, err := rc.rtClient.Handle.ProvideXappSubscriptionHandle(createHandle) if err != nil && !(strings.Contains(err.Error(), "status 200")) { @@ -70,7 +70,7 @@ func (rc *RtmgrClient) SubscriptionRequestUpdate(subRouteAction SubRouteInfo) er for i := range subRouteAction.EpList.Endpoints { updateData = append(updateData, &rtmgr_models.XappElement{Address: &subRouteAction.EpList.Endpoints[i].Addr, Port: &subRouteAction.EpList.Endpoints[i].Port}) } - updateHandle := rtmgrhandle.NewUpdateXappSubscriptionHandleParamsWithTimeout(10 * time.Second) + updateHandle := rtmgrhandle.NewUpdateXappSubscriptionHandleParamsWithTimeout(2 * time.Second) updateHandle.WithSubscriptionID(subRouteAction.SubID) updateHandle.WithXappList(updateData) _, err := rc.rtClient.Handle.UpdateXappSubscriptionHandle(updateHandle) @@ -86,7 +86,7 @@ func (rc *RtmgrClient) SubscriptionRequestDelete(subRouteAction SubRouteInfo) er subID := int32(subRouteAction.SubID) xapp.Logger.Debug("DELETE %s ongoing", subRouteAction.String()) deleteData := rtmgr_models.XappSubscriptionData{&subRouteAction.EpList.Endpoints[0].Addr, &subRouteAction.EpList.Endpoints[0].Port, &subID} - deleteHandle := rtmgrhandle.NewDeleteXappSubscriptionHandleParamsWithTimeout(10 * time.Second) + deleteHandle := rtmgrhandle.NewDeleteXappSubscriptionHandleParamsWithTimeout(2 * time.Second) deleteHandle.WithXappSubscriptionData(&deleteData) _, _, err := rc.rtClient.Handle.DeleteXappSubscriptionHandle(deleteHandle) if err != nil && !(strings.Contains(err.Error(), "status 200")) {