iss #33 - Add searchGroup() method.

This commit is contained in:
Alexander Zobnin
2015-06-29 13:46:01 +03:00
parent 73eb57ef56
commit fca214ad44
2 changed files with 19 additions and 1 deletions

View File

@@ -286,7 +286,7 @@ function (angular, _, kbn) {
} }
// Get groups // Get groups
else if (parts.length === 1) { 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 _.map(result, function (hostgroup) {
return { return {
text: hostgroup.name, text: hostgroup.name,

View File

@@ -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 * Get hosts by names
* *