-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathEC2InstanceType.py
71 lines (58 loc) · 2.18 KB
/
EC2InstanceType.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
##############################################################################
#
# Copyright (C) Zenoss, Inc. 2009, all rights reserved.
#
# This content is made available according to terms specified in
# License.zenoss under the directory where your Zenoss product is installed.
#
##############################################################################
from Products.ZenModel.ManagedEntity import ManagedEntity
from Products.ZenModel.DeviceComponent import DeviceComponent
from Products.ZenRelations.RelSchema import ToOne, ToMany, ToManyCont
from Products.ZenModel.ZenossSecurity import ZEN_VIEW
class EC2InstanceType(DeviceComponent, ManagedEntity):
"""
A DMD Device that represents a group of VMware hosts
that can run virtual devices.
"""
meta_type = "EC2InstanceType"
instLink = ""
_properties = (
{'id':'instLink', 'type':'string', 'mode':'w'},
)
_relations = (
('instances', ToMany(ToOne,
"ZenPacks.zenoss.ZenAWS.EC2Instance", "instanceType")),
('manager', ToOne(ToManyCont,
"ZenPacks.zenoss.ZenAWS.EC2Manager", "instanceTypes")),
)
factory_type_information = (
{
'immediate_view' : 'ec2InstanceTypeStatus',
'actions' :
(
{ 'id' : 'status'
, 'name' : 'Status'
, 'action' : 'ec2InstanceTypeStatus'
, 'permissions' : (ZEN_VIEW, )
},
{ 'id' : 'events'
, 'name' : 'Events'
, 'action' : 'viewEvents'
, 'permissions' : (ZEN_VIEW, )
},
{ 'id' : 'perfConf'
, 'name' : 'Template'
, 'action' : 'objTemplates'
, 'permissions' : ("Change Device", )
},
)
},
)
def device(self):
return self.manager()
def name(self):
return self.getId()
def updateFromDict(self, propDict):
for k, v in propDict.items():
setattr(self, k, v)