Added initial cache service for groups, hosts, applications and

items caching on client side.
This commit is contained in:
Alexander Zobnin
2016-01-11 21:53:53 +03:00
parent e0b1978fa6
commit dc00766458
3 changed files with 115 additions and 1 deletions

View File

@@ -113,6 +113,55 @@ function (angular, _) {
});
};
//////////////////////////
// High-level functions //
//////////////////////////
p.getGroups = function() {
var params = {
output: ['name'],
sortfield: 'name',
selectHosts: []
};
return this.performZabbixAPIRequest('hostgroup.get', params);
};
p.getHosts = function() {
var params = {
output: ['name', 'host'],
sortfield: 'name'
};
return this.performZabbixAPIRequest('host.get', params);
};
p.getApplications = function() {
var params = {
output: ['name'],
sortfield: 'name'
};
return this.performZabbixAPIRequest('application.get', params);
};
p.getItems = function() {
var params = {
output: ['name', 'key_', 'value_type'],
sortfield: 'name',
//Include web items in the result
webitems: true,
// Return only numeric items
filter: {
value_type: [0, 3]
},
// Return only enabled items
monitored: true
};
return this.performZabbixAPIRequest('item.get', params);
};
/////////////////////////
// API method wrappers //
/////////////////////////