- _, postErr := rc.rtClient.Handle.ProvideXappSubscriptionHandle(rc.xappHandleParams.WithXappSubscriptionData(&xappSubReq))
- if postErr != nil && !(strings.Contains(postErr.Error(), "status 200")) {
- xapp.Logger.Error("Updating routing manager about subscription id = %d failed with error: %v", subID, postErr)
- return postErr
- } else {
- xapp.Logger.Info("Succesfully updated routing manager about the subscription: %d", subID)
- return nil
+ createData := rtmgr_models.XappSubscriptionData{&subRouteAction.EpList.Endpoints[0].Addr, &subRouteAction.EpList.Endpoints[0].Port, &subID}
+ createHandle := rtmgrhandle.NewProvideXappSubscriptionHandleParamsWithTimeout(10 * time.Second)
+ createHandle.WithXappSubscriptionData(&createData)
+ _, err = rc.rtClient.Handle.ProvideXappSubscriptionHandle(createHandle)
+ case DELETE:
+ deleteData := rtmgr_models.XappSubscriptionData{&subRouteAction.EpList.Endpoints[0].Addr, &subRouteAction.EpList.Endpoints[0].Port, &subID}
+ deleteHandle := rtmgrhandle.NewDeleteXappSubscriptionHandleParamsWithTimeout(10 * time.Second)
+ deleteHandle.WithXappSubscriptionData(&deleteData)
+ _, _, err = rc.rtClient.Handle.DeleteXappSubscriptionHandle(deleteHandle)
+ case UPDATE:
+ updateData := rtmgr_models.XappList{}
+ for i := range subRouteAction.EpList.Endpoints {
+ updateData[i] = &rtmgr_models.XappElement{Address: &subRouteAction.EpList.Endpoints[i].Addr, Port: &subRouteAction.EpList.Endpoints[i].Port}