1
2
3
4
5
6
7
8
9
10
11
12
13
14 from Globals import DTMLFile
15 from Globals import InitializeClass
16
17 from AccessControl import Permissions
18 from AccessControl import ClassSecurityInfo
19 from Products.ZenModel.ZenossSecurity import *
20
21 from Products.ZenRelations.RelSchema import *
22
23 from ServiceClass import ServiceClass
24
25
33
34
35 addIpServiceClass = DTMLFile('dtml/addIpServiceClass',globals())
36
38 """IpServiceClass object.
39 """
40 __pychecker__='no-override'
41
42 port = 0
43 sendString = ""
44 expectRegex = ""
45
46 portal_type = meta_type = 'IpServiceClass'
47
48 _properties = ServiceClass._properties + (
49 {'id':'port', 'type':'int', 'mode':'w'},
50 {'id':'sendString', 'type':'string', 'mode':'w'},
51 {'id':'expectRegex', 'type':'string', 'mode':'w'},
52 )
53
54 factory_type_information = (
55 {
56 'immediate_view' : 'ipServiceClassStatus',
57 'actions' :
58 (
59 { 'id' : 'status'
60 , 'name' : 'Status'
61 , 'action' : 'ipServiceClassStatus'
62 , 'permissions' : (
63 Permissions.view, )
64 },
65 { 'id' : 'edit'
66 , 'name' : 'Edit'
67 , 'action' : 'ipServiceClassEdit'
68 , 'permissions' : ("Manage DMD", )
69 },
70 { 'id' : 'manage'
71 , 'name' : 'Administration'
72 , 'action' : 'ipServiceClassManage'
73 , 'permissions' : ("Manage DMD",)
74 },
75 { 'id' : 'zproperties'
76 , 'name' : 'zProperties'
77 , 'action' : 'zPropertyEdit'
78 , 'permissions' : ("Change Device",)
79 },
80 { 'id' : 'viewHistory'
81 , 'name' : 'Modifications'
82 , 'action' : 'viewHistory'
83 , 'permissions' : (ZEN_VIEW_MODIFICATIONS,)
84 },
85 )
86 },
87 )
88
89 security = ClassSecurityInfo()
90
91 - def __init__(self, id, serviceKeys=(), description="", port=0):
94
95
96 security.declareProtected('Manage DMD', 'manage_editServiceClass')
97 - def manage_editServiceClass(self, name="", monitor=False, serviceKeys="",
98 port=0, description="", sendString="",
99 expectRegex="", REQUEST=None):
108
109
110
111 InitializeClass(IpServiceClass)
112