diff --git a/apier/v1/versions.go b/apier/v1/versions.go
index 39fd60be2..7ef82970d 100644
--- a/apier/v1/versions.go
+++ b/apier/v1/versions.go
@@ -46,3 +46,32 @@ func (self *ApierV1) GetStorDBVersions(ign string, reply *engine.Versions) error
}
return nil
}
+
+type SetVersionsArg struct {
+ Versions engine.Versions
+ Overwrite bool
+}
+
+// Queries all versions from dataDB
+func (self *ApierV1) SetDataDBVersions(arg SetVersionsArg, reply *string) error {
+ if arg.Versions == nil {
+ arg.Versions = engine.CurrentDataDBVersions()
+ }
+ if err := self.DataManager.DataDB().SetVersions(arg.Versions, arg.Overwrite); err != nil {
+ return utils.NewErrServerError(err)
+ }
+ *reply = utils.OK
+ return nil
+}
+
+// Queries all versions from stordb
+func (self *ApierV1) SetStorDBVersions(arg SetVersionsArg, reply *string) error {
+ if arg.Versions == nil {
+ arg.Versions = engine.CurrentDataDBVersions()
+ }
+ if err := self.StorDb.SetVersions(arg.Versions, arg.Overwrite); err != nil {
+ return utils.NewErrServerError(err)
+ }
+ *reply = utils.OK
+ return nil
+}
diff --git a/console/set_datadb_versions.go b/console/set_datadb_versions.go
new file mode 100644
index 000000000..fc566b02a
--- /dev/null
+++ b/console/set_datadb_versions.go
@@ -0,0 +1,65 @@
+/*
+Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments
+Copyright (C) ITsysCOM GmbH
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see
+*/
+
+package console
+
+import (
+ v1 "github.com/cgrates/cgrates/apier/v1"
+ "github.com/cgrates/cgrates/utils"
+)
+
+func init() {
+ c := &CmdSetDataDBVersions{
+ name: "set_datadb_versions",
+ rpcMethod: utils.ApierV1SetDataDBVersions,
+ rpcParams: &v1.SetVersionsArg{},
+ }
+ commands[c.Name()] = c
+ c.CommandExecuter = &CommandExecuter{c}
+}
+
+type CmdSetDataDBVersions struct {
+ name string
+ rpcMethod string
+ rpcParams *v1.SetVersionsArg
+ *CommandExecuter
+}
+
+func (self *CmdSetDataDBVersions) Name() string {
+ return self.name
+}
+
+func (self *CmdSetDataDBVersions) RpcMethod() string {
+ return self.rpcMethod
+}
+
+func (self *CmdSetDataDBVersions) RpcParams(reset bool) interface{} {
+ if reset || self.rpcParams == nil {
+ self.rpcParams = &v1.SetVersionsArg{}
+ }
+ return self.rpcParams
+}
+
+func (self *CmdSetDataDBVersions) PostprocessRpcParams() error {
+ return nil
+}
+
+func (self *CmdSetDataDBVersions) RpcResult() interface{} {
+ var atr string
+ return &atr
+}
diff --git a/console/set_stordb_versions.go b/console/set_stordb_versions.go
new file mode 100644
index 000000000..7ba062223
--- /dev/null
+++ b/console/set_stordb_versions.go
@@ -0,0 +1,65 @@
+/*
+Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments
+Copyright (C) ITsysCOM GmbH
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see
+*/
+
+package console
+
+import (
+ v1 "github.com/cgrates/cgrates/apier/v1"
+ "github.com/cgrates/cgrates/utils"
+)
+
+func init() {
+ c := &CmdSetStorDBVersions{
+ name: "set_stordb_versions",
+ rpcMethod: utils.ApierV1SetStorDBVersions,
+ rpcParams: &v1.SetVersionsArg{},
+ }
+ commands[c.Name()] = c
+ c.CommandExecuter = &CommandExecuter{c}
+}
+
+type CmdSetStorDBVersions struct {
+ name string
+ rpcMethod string
+ rpcParams *v1.SetVersionsArg
+ *CommandExecuter
+}
+
+func (self *CmdSetStorDBVersions) Name() string {
+ return self.name
+}
+
+func (self *CmdSetStorDBVersions) RpcMethod() string {
+ return self.rpcMethod
+}
+
+func (self *CmdSetStorDBVersions) RpcParams(reset bool) interface{} {
+ if reset || self.rpcParams == nil {
+ self.rpcParams = &v1.SetVersionsArg{}
+ }
+ return self.rpcParams
+}
+
+func (self *CmdSetStorDBVersions) PostprocessRpcParams() error {
+ return nil
+}
+
+func (self *CmdSetStorDBVersions) RpcResult() interface{} {
+ var atr string
+ return &atr
+}
diff --git a/utils/consts.go b/utils/consts.go
index 9fe465b48..5a187b7b5 100755
--- a/utils/consts.go
+++ b/utils/consts.go
@@ -784,6 +784,8 @@ const (
ApierV1RemoveRatingProfile = "ApierV1.RemoveRatingProfile"
ApierV1SetRatingProfile = "ApierV1.SetRatingProfile"
ApierV1GetRatingProfileIDs = "ApierV1.GetRatingProfileIDs"
+ ApierV1SetDataDBVersions = "ApierV1.SetDataDBVersions"
+ ApierV1SetStorDBVersions = "ApierV1.SetStorDBVersions"
)
const (