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

Source Code for Module ZenModel.HardDisk

 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 as published by 
 8  # the Free Software Foundation. 
 9  # 
10  # For complete information please visit: http://www.zenoss.com/oss/ 
11  # 
12  ########################################################################### 
13   
14  __doc__="""HardDisk 
15   
16  HardDisk is a collection of devices and subsystems that make 
17  up a business function 
18   
19  $Id: HardDisk.py,v 1.7 2004/04/06 22:33:24 edahl Exp $""" 
20   
21  __version__ = "$Revision: 1.7 $"[11:-2] 
22   
23  from Globals import DTMLFile 
24  from Globals import InitializeClass 
25   
26  from Products.ZenRelations.RelSchema import * 
27   
28  from HWComponent import HWComponent 
29   
30 -def manage_addHardDisk(context, id, title = None, REQUEST = None):
31 """make a filesystem""" 32 hd = HardDisk(id, title) 33 context._setObject(id, hd) 34 hd = context._getOb(id) 35 36 if REQUEST is not None: 37 REQUEST['RESPONSE'].redirect(context.absolute_url() 38 +'/manage_main')
39 40 addHardDisk = DTMLFile('dtml/addHardDisk',globals()) 41 42
43 -class HardDisk(HWComponent):
44 """HardDisk object""" 45 46 portal_type = meta_type = 'HardDisk' 47 48 manage_editHardDiskForm = DTMLFile('dtml/manageEditHardDisk',globals()) 49 50 description = "" 51 hostresindex = 0 52 53 _properties = HWComponent._properties + ( 54 {'id':'description', 'type':'string', 'mode':'w'}, 55 {'id':'hostresindex', 'type':'int', 'mode':'w'}, 56 ) 57 58 _relations = HWComponent._relations + ( 59 ("hw", ToOne(ToManyCont, "Products.ZenModel.DeviceHW", "harddisks")), 60 ) 61 62 63 factory_type_information = ( 64 { 65 'id' : 'HardDisk', 66 'meta_type' : 'HardDisk', 67 'description' : """Arbitrary device grouping class""", 68 'icon' : 'HardDisk_icon.gif', 69 'product' : 'ZenModel', 70 'factory' : 'manage_addHardDisk', 71 'immediate_view' : 'viewHardDisk', 72 'actions' : 73 ( 74 { 'id' : 'status' 75 , 'name' : 'Status' 76 , 'action' : 'viewHardDisk' 77 , 'permissions' : ('View',) 78 }, 79 # { 'id' : 'perfConf' 80 # , 'name' : 'PerfConf' 81 # , 'action' : 'objTemplates' 82 # , 'permissions' : ("Change Device", ) 83 # }, 84 { 'id' : 'viewHistory' 85 , 'name' : 'Modifications' 86 , 'action' : 'viewHistory' 87 , 'permissions' : ('View',) 88 }, 89 ) 90 }, 91 ) 92
93 - def viewName(self): return self.description
94 95 96 InitializeClass(HardDisk) 97