comparison env/lib/python3.9/site-packages/boto/ec2/autoscale/instance.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) 2009 Reza Lotun http://reza.lotun.name/
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 class Instance(object):
24 def __init__(self, connection=None):
25 self.connection = connection
26 self.instance_id = None
27 self.health_status = None
28 self.launch_config_name = None
29 self.lifecycle_state = None
30 self.availability_zone = None
31 self.group_name = None
32
33 def __repr__(self):
34 r = 'Instance<id:%s, state:%s, health:%s' % (self.instance_id,
35 self.lifecycle_state,
36 self.health_status)
37 if self.group_name:
38 r += ' group:%s' % self.group_name
39 r += '>'
40 return r
41
42 def startElement(self, name, attrs, connection):
43 return None
44
45 def endElement(self, name, value, connection):
46 if name == 'InstanceId':
47 self.instance_id = value
48 elif name == 'HealthStatus':
49 self.health_status = value
50 elif name == 'LaunchConfigurationName':
51 self.launch_config_name = value
52 elif name == 'LifecycleState':
53 self.lifecycle_state = value
54 elif name == 'AvailabilityZone':
55 self.availability_zone = value
56 elif name == 'AutoScalingGroupName':
57 self.group_name = value
58 else:
59 setattr(self, name, value)