iss #33 - Add searchGroup() method.
This commit is contained in:
@@ -286,7 +286,7 @@ function (angular, _, kbn) {
|
||||
}
|
||||
// Get groups
|
||||
else if (parts.length === 1) {
|
||||
return zabbix.findZabbixGroup(template.group).then(function (result) {
|
||||
return zabbix.getGroupByName(template.group).then(function (result) {
|
||||
return _.map(result, function (hostgroup) {
|
||||
return {
|
||||
text: hostgroup.name,
|
||||
|
||||
@@ -307,6 +307,24 @@ function (angular, _) {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Search group by name.
|
||||
*
|
||||
* @param {string} group group name
|
||||
* @return {array} groups
|
||||
*/
|
||||
this.searchGroup = function (group) {
|
||||
var params = {
|
||||
output: ['name'],
|
||||
search: {
|
||||
name: group
|
||||
},
|
||||
searchWildcardsEnabled: true
|
||||
};
|
||||
return this.performZabbixAPIRequest('hostgroup.get', params);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Get hosts by names
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user