mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Add backwards compatible with ApierV1 and ApierV2 prefix when calling API's
This commit is contained in:
committed by
Dan Christian Bogos
parent
6f067845a1
commit
3c4c39b66c
@@ -115,13 +115,14 @@ func (apiService *APIerSv1Service) Start() (err error) {
|
||||
|
||||
if !apiService.cfg.DispatcherSCfg().Enabled {
|
||||
apiService.server.RpcRegister(apiService.api)
|
||||
apiService.server.RpcRegisterName(utils.ApierV1, apiService.api)
|
||||
apiService.server.RpcRegister(v1.NewReplicatorSv1(datadb))
|
||||
}
|
||||
|
||||
utils.RegisterRpcParams("", &v1.CDRsV1{})
|
||||
utils.RegisterRpcParams("", &v1.SMGenericV1{})
|
||||
utils.RegisterRpcParams("", apiService.api)
|
||||
utils.RegisterRpcParams("ApierV1", apiService.api)
|
||||
utils.RegisterRpcParams(utils.ApierV1, apiService.api)
|
||||
//backwards compatible
|
||||
|
||||
apiService.connChan <- apiService.api
|
||||
|
||||
@@ -71,11 +71,12 @@ func (api *APIerSv2Service) Start() (err error) {
|
||||
|
||||
if !api.cfg.DispatcherSCfg().Enabled {
|
||||
api.server.RpcRegister(api.api)
|
||||
api.server.RpcRegisterName(utils.ApierV2, api.api)
|
||||
}
|
||||
|
||||
utils.RegisterRpcParams("", &v2.CDRsV2{})
|
||||
utils.RegisterRpcParams("", api.api)
|
||||
utils.RegisterRpcParams("ApierV2", api.api)
|
||||
utils.RegisterRpcParams(utils.ApierV2, api.api)
|
||||
|
||||
api.connChan <- api.api
|
||||
return
|
||||
|
||||
@@ -968,6 +968,8 @@ const (
|
||||
|
||||
// APIerSv1 APIs
|
||||
const (
|
||||
ApierV1 = "ApierV1"
|
||||
ApierV2 = "ApierV2"
|
||||
APIerSv1 = "APIerSv1"
|
||||
APIerSv1ComputeFilterIndexes = "APIerSv1.ComputeFilterIndexes"
|
||||
APIerSv1ComputeFilterIndexIDs = "APIerSv1.ComputeFilterIndexIDs"
|
||||
|
||||
Reference in New Issue
Block a user