mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-16 13:49:53 +05:00
Added GetActionsCount API
This commit is contained in:
committed by
Dan Christian Bogos
parent
c9e643e2d9
commit
bc8265757f
@@ -216,6 +216,21 @@ func (apiv2 *APIerSv2) GetActions(attr AttrGetActions, reply *map[string]engine.
|
||||
return nil
|
||||
}
|
||||
|
||||
type AttrGetActionsCount struct{}
|
||||
|
||||
// GetActionsCount get
|
||||
func (apiv2 *APIerSv2) GetActionsCount(attr AttrGetActionsCount, reply *int) (err error) {
|
||||
var actionKeys []string
|
||||
if actionKeys, err = apiv2.DataManager.DataDB().GetKeysForPrefix(utils.ACTION_PREFIX); err != nil {
|
||||
return err
|
||||
}
|
||||
*reply = len(actionKeys)
|
||||
if len(actionKeys) == 0 {
|
||||
return utils.ErrNotFound
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type AttrGetDestinations struct {
|
||||
DestinationIDs []string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user