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

Source Code for Module Products.ZenModel.HardDisk

 1  ############################################################################## 
 2  #  
 3  # Copyright (C) Zenoss, Inc. 2007, all rights reserved. 
 4  #  
 5  # This content is made available according to terms specified in 
 6  # License.zenoss under the directory where your Zenoss product is installed. 
 7  #  
 8  ############################################################################## 
 9   
10   
11  __doc__="""HardDisk 
12   
13  HardDisk is a collection of devices and subsystems that make 
14  up a business function 
15   
16  $Id: HardDisk.py,v 1.7 2004/04/06 22:33:24 edahl Exp $""" 
17   
18  __version__ = "$Revision: 1.7 $"[11:-2] 
19   
20  from Globals import DTMLFile 
21  from Globals import InitializeClass 
22   
23  from Products.ZenRelations.RelSchema import * 
24   
25  from HWComponent import HWComponent 
26   
27  from Products.ZenModel.ZenossSecurity import * 
28   
29 -def manage_addHardDisk(context, id, title = None, REQUEST = None):
30 """make a filesystem""" 31 hd = HardDisk(id, title) 32 context._setObject(id, hd) 33 hd = context._getOb(id) 34 35 if REQUEST is not None: 36 REQUEST['RESPONSE'].redirect(context.absolute_url() 37 +'/manage_main')
38 39 addHardDisk = DTMLFile('dtml/addHardDisk',globals()) 40 41
42 -class HardDisk(HWComponent):
43 """HardDisk object""" 44 45 portal_type = meta_type = 'HardDisk' 46 47 manage_editHardDiskForm = DTMLFile('dtml/manageEditHardDisk',globals()) 48 49 description = "" 50 hostresindex = 0 51 52 _properties = HWComponent._properties + ( 53 {'id':'description', 'type':'string', 'mode':'w'}, 54 {'id':'hostresindex', 'type':'int', 'mode':'w'}, 55 ) 56 57 _relations = HWComponent._relations + ( 58 ("hw", ToOne(ToManyCont, "Products.ZenModel.DeviceHW", "harddisks")), 59 ) 60 61 62 factory_type_information = ( 63 { 64 'id' : 'HardDisk', 65 'meta_type' : 'HardDisk', 66 'description' : """Arbitrary device grouping class""", 67 'icon' : 'HardDisk_icon.gif', 68 'product' : 'ZenModel', 69 'factory' : 'manage_addHardDisk', 70 'immediate_view' : 'viewHardDisk', 71 'actions' : 72 ( 73 { 'id' : 'status' 74 , 'name' : 'Status' 75 , 'action' : 'viewHardDisk' 76 , 'permissions' : ('View',) 77 }, 78 { 'id' : 'perfConf' 79 , 'name' : 'Template' 80 , 'action' : 'objTemplates' 81 , 'permissions' : ("Change Device", ) 82 }, 83 ) 84 }, 85 ) 86
87 - def viewName(self): return self.description
88 89 90 InitializeClass(HardDisk) 91