mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-21 07:08:45 +05:00
Clean up DispatcherS
This commit is contained in:
committed by
Dan Christian Bogos
parent
e23759b4a8
commit
7db65ca62c
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
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 <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package console
|
||||
|
||||
import (
|
||||
"github.com/cgrates/cgrates/engine"
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
)
|
||||
|
||||
func init() {
|
||||
c := &CmdGetDispatcherHost{
|
||||
name: "dispatcher_host",
|
||||
rpcMethod: utils.AdminSv1GetDispatcherHost,
|
||||
rpcParams: &utils.TenantIDWithAPIOpts{},
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
}
|
||||
|
||||
// Commander implementation
|
||||
type CmdGetDispatcherHost struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams *utils.TenantIDWithAPIOpts
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
func (self *CmdGetDispatcherHost) Name() string {
|
||||
return self.name
|
||||
}
|
||||
|
||||
func (self *CmdGetDispatcherHost) RpcMethod() string {
|
||||
return self.rpcMethod
|
||||
}
|
||||
|
||||
func (self *CmdGetDispatcherHost) RpcParams(reset bool) any {
|
||||
if reset || self.rpcParams == nil {
|
||||
self.rpcParams = new(utils.TenantIDWithAPIOpts)
|
||||
}
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
func (self *CmdGetDispatcherHost) PostprocessRpcParams() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (self *CmdGetDispatcherHost) RpcResult() any {
|
||||
var s engine.DispatcherHost
|
||||
return &s
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
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 <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package console
|
||||
|
||||
import (
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
)
|
||||
|
||||
func init() {
|
||||
c := &CmdGetDispatcherHostIDs{
|
||||
name: "dispatcher_host_ids",
|
||||
rpcMethod: utils.AdminSv1GetDispatcherHostIDs,
|
||||
rpcParams: &utils.ArgsItemIDs{},
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
}
|
||||
|
||||
// Commander implementation
|
||||
type CmdGetDispatcherHostIDs struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams *utils.ArgsItemIDs
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
func (self *CmdGetDispatcherHostIDs) Name() string {
|
||||
return self.name
|
||||
}
|
||||
|
||||
func (self *CmdGetDispatcherHostIDs) RpcMethod() string {
|
||||
return self.rpcMethod
|
||||
}
|
||||
|
||||
func (self *CmdGetDispatcherHostIDs) RpcParams(reset bool) any {
|
||||
if reset || self.rpcParams == nil {
|
||||
self.rpcParams = new(utils.ArgsItemIDs)
|
||||
}
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
func (self *CmdGetDispatcherHostIDs) PostprocessRpcParams() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (self *CmdGetDispatcherHostIDs) RpcResult() any {
|
||||
var s []string
|
||||
return &s
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
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 <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package console
|
||||
|
||||
import (
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
)
|
||||
|
||||
func init() {
|
||||
c := &CmdRemoveDispatcherHost{
|
||||
name: "dispatcher_host_remove",
|
||||
rpcMethod: utils.AdminSv1RemoveDispatcherHost,
|
||||
rpcParams: &utils.TenantIDWithAPIOpts{},
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
}
|
||||
|
||||
// Commander implementation
|
||||
type CmdRemoveDispatcherHost struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams *utils.TenantIDWithAPIOpts
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
func (self *CmdRemoveDispatcherHost) Name() string {
|
||||
return self.name
|
||||
}
|
||||
|
||||
func (self *CmdRemoveDispatcherHost) RpcMethod() string {
|
||||
return self.rpcMethod
|
||||
}
|
||||
|
||||
func (self *CmdRemoveDispatcherHost) RpcParams(reset bool) any {
|
||||
if reset || self.rpcParams == nil {
|
||||
self.rpcParams = &utils.TenantIDWithAPIOpts{APIOpts: make(map[string]any)}
|
||||
}
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
func (self *CmdRemoveDispatcherHost) PostprocessRpcParams() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (self *CmdRemoveDispatcherHost) RpcResult() any {
|
||||
var s string
|
||||
return &s
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
/*
|
||||
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 <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package console
|
||||
|
||||
import (
|
||||
"github.com/cgrates/cgrates/engine"
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
)
|
||||
|
||||
func init() {
|
||||
c := &CmdSetDispatcherHost{
|
||||
name: "dispatcher_host_set",
|
||||
rpcMethod: utils.AdminSv1SetDispatcherHost,
|
||||
rpcParams: &engine.DispatcherHostWithAPIOpts{},
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
}
|
||||
|
||||
// Commander implementation
|
||||
type CmdSetDispatcherHost struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams *engine.DispatcherHostWithAPIOpts
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
func (self *CmdSetDispatcherHost) Name() string {
|
||||
return self.name
|
||||
}
|
||||
|
||||
func (self *CmdSetDispatcherHost) RpcMethod() string {
|
||||
return self.rpcMethod
|
||||
}
|
||||
|
||||
func (self *CmdSetDispatcherHost) RpcParams(reset bool) any {
|
||||
if reset || self.rpcParams == nil {
|
||||
self.rpcParams = &engine.DispatcherHostWithAPIOpts{
|
||||
DispatcherHost: new(engine.DispatcherHost),
|
||||
APIOpts: make(map[string]any),
|
||||
}
|
||||
}
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
func (self *CmdSetDispatcherHost) PostprocessRpcParams() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (self *CmdSetDispatcherHost) RpcResult() any {
|
||||
var s string
|
||||
return &s
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
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 <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package console
|
||||
|
||||
import (
|
||||
"github.com/cgrates/cgrates/engine"
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
)
|
||||
|
||||
func init() {
|
||||
c := &CmdGetDispatcherHosts{
|
||||
name: "dispatcher_hosts",
|
||||
rpcMethod: utils.AdminSv1GetDispatcherHosts,
|
||||
rpcParams: &utils.ArgsItemIDs{},
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
}
|
||||
|
||||
// Commander implementation
|
||||
type CmdGetDispatcherHosts struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams *utils.ArgsItemIDs
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
func (self *CmdGetDispatcherHosts) Name() string {
|
||||
return self.name
|
||||
}
|
||||
|
||||
func (self *CmdGetDispatcherHosts) RpcMethod() string {
|
||||
return self.rpcMethod
|
||||
}
|
||||
|
||||
func (self *CmdGetDispatcherHosts) RpcParams(reset bool) any {
|
||||
if reset || self.rpcParams == nil {
|
||||
self.rpcParams = new(utils.ArgsItemIDs)
|
||||
}
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
func (self *CmdGetDispatcherHosts) PostprocessRpcParams() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (self *CmdGetDispatcherHosts) RpcResult() any {
|
||||
var s []*engine.DispatcherHost
|
||||
return &s
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
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 <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package console
|
||||
|
||||
import (
|
||||
"github.com/cgrates/cgrates/engine"
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
)
|
||||
|
||||
func init() {
|
||||
c := &CmdGetDispatcherProfile{
|
||||
name: "dispatcher_profile",
|
||||
rpcMethod: utils.AdminSv1GetDispatcherProfile,
|
||||
rpcParams: &utils.TenantIDWithAPIOpts{},
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
}
|
||||
|
||||
// Commander implementation
|
||||
type CmdGetDispatcherProfile struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams *utils.TenantIDWithAPIOpts
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
func (self *CmdGetDispatcherProfile) Name() string {
|
||||
return self.name
|
||||
}
|
||||
|
||||
func (self *CmdGetDispatcherProfile) RpcMethod() string {
|
||||
return self.rpcMethod
|
||||
}
|
||||
|
||||
func (self *CmdGetDispatcherProfile) RpcParams(reset bool) any {
|
||||
if reset || self.rpcParams == nil {
|
||||
self.rpcParams = new(utils.TenantIDWithAPIOpts)
|
||||
}
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
func (self *CmdGetDispatcherProfile) PostprocessRpcParams() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (self *CmdGetDispatcherProfile) RpcResult() any {
|
||||
var s engine.DispatcherProfile
|
||||
return &s
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
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 <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package console
|
||||
|
||||
import (
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
)
|
||||
|
||||
func init() {
|
||||
c := &CmdGetDispatcherProfileIDs{
|
||||
name: "dispatcher_profile_ids",
|
||||
rpcMethod: utils.AdminSv1GetDispatcherProfileIDs,
|
||||
rpcParams: &utils.ArgsItemIDs{},
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
}
|
||||
|
||||
// Commander implementation
|
||||
type CmdGetDispatcherProfileIDs struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams *utils.ArgsItemIDs
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
func (self *CmdGetDispatcherProfileIDs) Name() string {
|
||||
return self.name
|
||||
}
|
||||
|
||||
func (self *CmdGetDispatcherProfileIDs) RpcMethod() string {
|
||||
return self.rpcMethod
|
||||
}
|
||||
|
||||
func (self *CmdGetDispatcherProfileIDs) RpcParams(reset bool) any {
|
||||
if reset || self.rpcParams == nil {
|
||||
self.rpcParams = new(utils.ArgsItemIDs)
|
||||
}
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
func (self *CmdGetDispatcherProfileIDs) PostprocessRpcParams() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (self *CmdGetDispatcherProfileIDs) RpcResult() any {
|
||||
var s []string
|
||||
return &s
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
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 <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package console
|
||||
|
||||
import (
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
)
|
||||
|
||||
func init() {
|
||||
c := &CmdRemoveDispatcherProfile{
|
||||
name: "dispatcher_profile_remove",
|
||||
rpcMethod: utils.AdminSv1RemoveDispatcherProfile,
|
||||
rpcParams: &utils.TenantIDWithAPIOpts{},
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
}
|
||||
|
||||
// Commander implementation
|
||||
type CmdRemoveDispatcherProfile struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams *utils.TenantIDWithAPIOpts
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
func (self *CmdRemoveDispatcherProfile) Name() string {
|
||||
return self.name
|
||||
}
|
||||
|
||||
func (self *CmdRemoveDispatcherProfile) RpcMethod() string {
|
||||
return self.rpcMethod
|
||||
}
|
||||
|
||||
func (self *CmdRemoveDispatcherProfile) RpcParams(reset bool) any {
|
||||
if reset || self.rpcParams == nil {
|
||||
self.rpcParams = &utils.TenantIDWithAPIOpts{APIOpts: make(map[string]any)}
|
||||
}
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
func (self *CmdRemoveDispatcherProfile) PostprocessRpcParams() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (self *CmdRemoveDispatcherProfile) RpcResult() any {
|
||||
var s string
|
||||
return &s
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
/*
|
||||
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 <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package console
|
||||
|
||||
import (
|
||||
"github.com/cgrates/cgrates/apis"
|
||||
"github.com/cgrates/cgrates/engine"
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
)
|
||||
|
||||
func init() {
|
||||
c := &CmdSetDispatcherProfile{
|
||||
name: "dispatcher_profile_set",
|
||||
rpcMethod: utils.AdminSv1SetDispatcherProfile,
|
||||
rpcParams: &apis.DispatcherWithAPIOpts{},
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
}
|
||||
|
||||
// Commander implementation
|
||||
type CmdSetDispatcherProfile struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams *apis.DispatcherWithAPIOpts
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
func (self *CmdSetDispatcherProfile) Name() string {
|
||||
return self.name
|
||||
}
|
||||
|
||||
func (self *CmdSetDispatcherProfile) RpcMethod() string {
|
||||
return self.rpcMethod
|
||||
}
|
||||
|
||||
func (self *CmdSetDispatcherProfile) RpcParams(reset bool) any {
|
||||
if reset || self.rpcParams == nil {
|
||||
self.rpcParams = &apis.DispatcherWithAPIOpts{
|
||||
DispatcherProfile: new(engine.DispatcherProfile),
|
||||
APIOpts: make(map[string]any),
|
||||
}
|
||||
}
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
func (self *CmdSetDispatcherProfile) PostprocessRpcParams() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (self *CmdSetDispatcherProfile) RpcResult() any {
|
||||
var s string
|
||||
return &s
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
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 <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package console
|
||||
|
||||
import (
|
||||
"github.com/cgrates/cgrates/engine"
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
)
|
||||
|
||||
func init() {
|
||||
c := &CmdGetDispatcherProfiles{
|
||||
name: "dispatcher_profiles",
|
||||
rpcMethod: utils.AdminSv1GetDispatcherProfiles,
|
||||
rpcParams: &utils.ArgsItemIDs{},
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
}
|
||||
|
||||
// Commander implementation
|
||||
type CmdGetDispatcherProfiles struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams *utils.ArgsItemIDs
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
func (self *CmdGetDispatcherProfiles) Name() string {
|
||||
return self.name
|
||||
}
|
||||
|
||||
func (self *CmdGetDispatcherProfiles) RpcMethod() string {
|
||||
return self.rpcMethod
|
||||
}
|
||||
|
||||
func (self *CmdGetDispatcherProfiles) RpcParams(reset bool) any {
|
||||
if reset || self.rpcParams == nil {
|
||||
self.rpcParams = new(utils.ArgsItemIDs)
|
||||
}
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
func (self *CmdGetDispatcherProfiles) PostprocessRpcParams() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (self *CmdGetDispatcherProfiles) RpcResult() any {
|
||||
var s []*engine.DispatcherProfile
|
||||
return &s
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
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 <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package console
|
||||
|
||||
import (
|
||||
"github.com/cgrates/cgrates/engine"
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
)
|
||||
|
||||
func init() {
|
||||
c := &CmdDispatcherProfile{
|
||||
name: "dispatchers_for_event",
|
||||
rpcMethod: utils.DispatcherSv1GetProfilesForEvent,
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
}
|
||||
|
||||
// Commander implementation
|
||||
type CmdDispatcherProfile struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams *utils.CGREvent
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
func (self *CmdDispatcherProfile) Name() string {
|
||||
return self.name
|
||||
}
|
||||
|
||||
func (self *CmdDispatcherProfile) RpcMethod() string {
|
||||
return self.rpcMethod
|
||||
}
|
||||
|
||||
func (self *CmdDispatcherProfile) RpcParams(reset bool) any {
|
||||
if reset || self.rpcParams == nil {
|
||||
self.rpcParams = new(utils.CGREvent)
|
||||
}
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
func (self *CmdDispatcherProfile) PostprocessRpcParams() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (self *CmdDispatcherProfile) RpcResult() any {
|
||||
var s engine.DispatcherProfiles
|
||||
return &s
|
||||
}
|
||||
@@ -67,8 +67,6 @@ func (self *CmdApierPing) RpcMethod() string {
|
||||
return utils.SessionSv1Ping
|
||||
case utils.LoaderSLow:
|
||||
return utils.LoaderSv1Ping
|
||||
case utils.DispatcherSLow:
|
||||
return utils.DispatcherSv1Ping
|
||||
case utils.AnalyzerSLow:
|
||||
return utils.AnalyzerSv1Ping
|
||||
case utils.ReplicatorLow:
|
||||
|
||||
Reference in New Issue
Block a user