Updated ping method to accept all strings format

This commit is contained in:
Anevo
2018-04-20 07:38:05 -04:00
committed by Dan Christian Bogos
parent 1703277205
commit 76dd752e06
2 changed files with 21 additions and 9 deletions

View File

@@ -48,22 +48,22 @@ func (self *CmdApierPing) Name() string {
}
func (self *CmdApierPing) RpcMethod() string {
switch self.rpcParams.Item {
case strings.ToLower(utils.SupplierS):
switch strings.ToLower(self.rpcParams.Item) {
case utils.LowerSuppliers:
return utils.SupplierSv1Ping
case strings.ToLower(utils.AttributeS):
case utils.LowerAttributes:
return utils.AttributeSv1Ping
case strings.ToLower(utils.ResourceS):
case utils.LowerResources:
return utils.ResourceSv1Ping
case strings.ToLower(utils.StatService):
case utils.LowerStatService:
return utils.StatSv1Ping
case strings.ToLower(utils.ThresholdS):
case utils.LowerThresholds:
return utils.ThresholdSv1Ping
case strings.ToLower(utils.SessionS):
case utils.LowerSessions:
return utils.SessionSv1Ping
case strings.ToLower(utils.LoaderS):
case utils.LowerLoader:
return utils.LoaderSv1Ping
case strings.ToLower(utils.DispatcherS):
case utils.LowerDispatchers:
return utils.DispatcherSv1Ping
default:
}

View File

@@ -563,6 +563,18 @@ const (
DispatcherS = "DispatcherS"
)
// Lower service names
const (
LowerSessions = "sessions"
LowerAttributes = "attributes"
LowerSuppliers = "suppliers"
LowerResources = "resources"
LowerStatService = "stats"
LowerThresholds = "thresholds"
LowerDispatchers = "dispatchers"
LowerLoader = "loader"
)
//Migrator Metas
const (
MetaSetVersions = "*set_versions"