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

Source Code for Module ZenModel.CPU

 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__="""CPU 
15   
16  CPU is a collection of devices and subsystems that make 
17  up a business function 
18   
19  $Id: CPU.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 InitializeClass 
24   
25  from Products.ZenRelations.RelSchema import * 
26   
27  from HWComponent import HWComponent 
28   
29  from Products.ZenModel.ZenossSecurity import * 
30   
31 -class CPU(HWComponent):
32 """CPU object""" 33 34 portal_type = meta_type = 'CPU' 35 36 socket = 0 37 clockspeed = 0 38 extspeed = 0 39 voltage = 0 40 cacheSizeL1 = 0 41 cacheSizeL2 = 0 42 43 _properties = ( 44 {'id':'socket', 'type':'int', 'mode':'w'}, 45 {'id':'clockspeed', 'type':'int', 'mode':'w'}, #MHz 46 {'id':'extspeed', 'type':'int', 'mode':'w'}, #MHz 47 {'id':'voltage', 'type':'int', 'mode':'w'}, #Millivolts 48 {'id':'cacheSizeL1', 'type':'int', 'mode':'w'}, #KBytes 49 {'id':'cacheSizeL2', 'type':'int', 'mode':'w'}, #KBytes 50 ) 51 52 _relations = HWComponent._relations + ( 53 ("hw", ToOne(ToManyCont, "Products.ZenModel.DeviceHW", "cpus")), 54 ) 55 56 57 factory_type_information = ( 58 { 59 'id' : 'CPU', 60 'meta_type' : 'CPU', 61 'description' : """Arbitrary device grouping class""", 62 'icon' : 'CPU_icon.gif', 63 'product' : 'ZenModel', 64 'factory' : 'manage_addCPU', 65 'immediate_view' : 'viewCPU', 66 'actions' : 67 ( 68 { 'id' : 'status' 69 , 'name' : 'Status' 70 , 'action' : 'viewCPU' 71 , 'permissions' : ('View',) 72 }, 73 { 'id' : 'viewHistory' 74 , 'name' : 'Modifications' 75 , 'action' : 'viewHistory' 76 , 'permissions' : (ZEN_VIEW_MODIFICATIONS,) 77 }, 78 ) 79 }, 80 )
81 82 InitializeClass(CPU) 83