comparison env/lib/python3.9/site-packages/boto/ec2/instancetype.py @ 0:4f3585e2f14b draft default tip

"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author shellac
date Mon, 22 Mar 2021 18:12:50 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4f3585e2f14b
1 # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
2 #
3 # Permission is hereby granted, free of charge, to any person obtaining a
4 # copy of this software and associated documentation files (the
5 # "Software"), to deal in the Software without restriction, including
6 # without limitation the rights to use, copy, modify, merge, publish, dis-
7 # tribute, sublicense, and/or sell copies of the Software, and to permit
8 # persons to whom the Software is furnished to do so, subject to the fol-
9 # lowing conditions:
10 #
11 # The above copyright notice and this permission notice shall be included
12 # in all copies or substantial portions of the Software.
13 #
14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
16 # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
17 # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18 # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 # IN THE SOFTWARE.
21
22
23 from boto.ec2.ec2object import EC2Object
24
25
26 class InstanceType(EC2Object):
27 """
28 Represents an EC2 VM Type
29
30 :ivar name: The name of the vm type
31 :ivar cores: The number of cpu cores for this vm type
32 :ivar memory: The amount of memory in megabytes for this vm type
33 :ivar disk: The amount of disk space in gigabytes for this vm type
34 """
35
36 def __init__(self, connection=None, name=None, cores=None,
37 memory=None, disk=None):
38 super(InstanceType, self).__init__(connection)
39 self.connection = connection
40 self.name = name
41 self.cores = cores
42 self.memory = memory
43 self.disk = disk
44
45 def __repr__(self):
46 return 'InstanceType:%s-%s,%s,%s' % (self.name, self.cores,
47 self.memory, self.disk)
48
49 def endElement(self, name, value, connection):
50 if name == 'name':
51 self.name = value
52 elif name == 'cpu':
53 self.cores = value
54 elif name == 'disk':
55 self.disk = value
56 elif name == 'memory':
57 self.memory = value
58 else:
59 setattr(self, name, value)