Package Products :: Package ZenModel :: Module DeviceManagerBase
[hide private]
[frames] | no frames]

Source Code for Module Products.ZenModel.DeviceManagerBase

 1  ########################################################################### 
 2  # 
 3  # This program is part of Zenoss Core, an open source monitoring platform. 
 4  # Copyright (C) 2007, Zenoss Inc. 
 5  # 
 6  # This program is free software; you can redistribute it and/or modify it 
 7  # under the terms of the GNU General Public License version 2 or (at your 
 8  # option) any later version as published by the Free Software Foundation. 
 9  # 
10  # For complete information please visit: http://www.zenoss.com/oss/ 
11  # 
12  ########################################################################### 
13   
14  from ZenossSecurity import ZEN_VIEW 
15   
16 -class DeviceManagerBase:
17 """ 18 Default implementation of IDeviceManager interface. This interface 19 is implemented by classes that have a device relationship to allow them 20 to manage their device relations. 21 """ 22
23 - def getDevices(self):
24 return [ dev for dev in self.devices() 25 if self.checkRemotePerm(ZEN_VIEW, dev)]
26
27 - def deviceMoveTargets(self):
28 """see IManageDevice""" 29 raise NotImplementedError
30
31 - def removeDevices(self, deviceNames=None, deleteStatus=False, 32 deleteHistory=False, deletePerf=False,REQUEST=None):
33 """see IManageDevice""" 34 from Products.ZenUtils.Utils import unused 35 unused(deleteHistory, deletePerf, deleteStatus) 36 if not deviceNames: return self() 37 if isinstance(deviceNames, basestring): deviceNames = (deviceNames,) 38 for devname in deviceNames: 39 self.devices._delObject(devname) 40 if REQUEST: 41 return self()
42