From 3bd40c6dbe65d4737993ee8f6140848033f57206 Mon Sep 17 00:00:00 2001 From: DanB Date: Sat, 12 Sep 2015 20:50:34 +0200 Subject: [PATCH] Console cdre_config_reload command --- console/cdre_config_reload.go | 64 +++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 console/cdre_config_reload.go diff --git a/console/cdre_config_reload.go b/console/cdre_config_reload.go new file mode 100644 index 000000000..6639a5562 --- /dev/null +++ b/console/cdre_config_reload.go @@ -0,0 +1,64 @@ +/* +Rating system designed to be used in VoIP Carriers World +Copyright (C) 2012-2015 ITsysCOM + +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 ( + "github.com/cgrates/cgrates/apier/v1" +) + +func init() { + c := &CmdCdreConfigReload{ + name: "cdre_config_reload", + rpcMethod: "ApierV1.ReloadCdreConfig", + } + commands[c.Name()] = c + c.CommandExecuter = &CommandExecuter{c} +} + +// Commander implementation +type CmdCdreConfigReload struct { + name string + rpcMethod string + rpcParams *v1.AttrReloadConfig + *CommandExecuter +} + +func (self *CmdCdreConfigReload) Name() string { + return self.name +} + +func (self *CmdCdreConfigReload) RpcMethod() string { + return self.rpcMethod +} + +func (self *CmdCdreConfigReload) RpcParams(reset bool) interface{} { + if reset || self.rpcParams == nil { + self.rpcParams = new(v1.AttrReloadConfig) + } + return self.rpcParams +} + +func (self *CmdCdreConfigReload) PostprocessRpcParams() error { + return nil +} + +func (self *CmdCdreConfigReload) RpcResult() interface{} { + var s string + return &s +}