Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Side by Side Diff: third_party/boto/boto/ec2/elb/attributes.py

Issue 698893003: Update checked in version of gsutil to version 4.6 (Closed) Base URL: http://dart.googlecode.com/svn/third_party/gsutil/
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Permission is hereby granted, free of charge, to any person obtaining a 1 # Permission is hereby granted, free of charge, to any person obtaining a
2 # copy of this software and associated documentation files (the 2 # copy of this software and associated documentation files (the
3 # "Software"), to deal in the Software without restriction, including 3 # "Software"), to deal in the Software without restriction, including
4 # without limitation the rights to use, copy, modify, merge, publish, dis- 4 # without limitation the rights to use, copy, modify, merge, publish, dis-
5 # tribute, sublicense, and/or sell copies of the Software, and to permit 5 # tribute, sublicense, and/or sell copies of the Software, and to permit
6 # persons to whom the Software is furnished to do so, subject to the fol- 6 # persons to whom the Software is furnished to do so, subject to the fol-
7 # lowing conditions: 7 # lowing conditions:
8 # 8 #
9 # The above copyright notice and this permission notice shall be included 9 # The above copyright notice and this permission notice shall be included
10 # in all copies or substantial portions of the Software. 10 # in all copies or substantial portions of the Software.
(...skipping 22 matching lines...) Expand all
33 def startElement(self, name, attrs, connection): 33 def startElement(self, name, attrs, connection):
34 pass 34 pass
35 35
36 def endElement(self, name, value, connection): 36 def endElement(self, name, value, connection):
37 if name == 'Enabled': 37 if name == 'Enabled':
38 if value.lower() == 'true': 38 if value.lower() == 'true':
39 self.enabled = True 39 self.enabled = True
40 else: 40 else:
41 self.enabled = False 41 self.enabled = False
42 42
43 class AccessLogAttribute(object):
44 """
45 Represents the AccessLog segment of ELB attributes.
46 """
47 def __init__(self, connection=None):
48 self.enabled = None
49 self.s3_bucket_name = None
50 self.s3_bucket_prefix = None
51 self.emit_interval = None
52
53 def __repr__(self):
54 return 'AccessLog(%s, %s, %s, %s)' % (
55 self.enabled,
56 self.s3_bucket_name,
57 self.s3_bucket_prefix,
58 self.emit_interval
59 )
60
61 def startElement(self, name, attrs, connection):
62 pass
63
64 def endElement(self, name, value, connection):
65 if name == 'Enabled':
66 if value.lower() == 'true':
67 self.enabled = True
68 else:
69 self.enabled = False
70 elif name == 'S3BucketName':
71 self.s3_bucket_name = value
72 elif name == 'S3BucketPrefix':
73 self.s3_bucket_prefix = value
74 elif name == 'EmitInterval':
75 self.emit_interval = int(value)
76
77 class ConnectionDrainingAttribute(object):
78 """
79 Represents the ConnectionDraining segment of ELB attributes.
80 """
81 def __init__(self, connection=None):
82 self.enabled = None
83 self.timeout = None
84
85 def __repr__(self):
86 return 'ConnectionDraining(%s, %s)' % (
87 self.enabled,
88 self.timeout
89 )
90
91 def startElement(self, name, attrs, connection):
92 pass
93
94 def endElement(self, name, value, connection):
95 if name == 'Enabled':
96 if value.lower() == 'true':
97 self.enabled = True
98 else:
99 self.enabled = False
100 elif name == 'Timeout':
101 self.timeout = int(value)
102
43 class LbAttributes(object): 103 class LbAttributes(object):
44 """ 104 """
45 Represents the Attributes of an Elastic Load Balancer. 105 Represents the Attributes of an Elastic Load Balancer.
46 """ 106 """
47 def __init__(self, connection=None): 107 def __init__(self, connection=None):
48 self.connection = connection 108 self.connection = connection
49 self.cross_zone_load_balancing = CrossZoneLoadBalancingAttribute( 109 self.cross_zone_load_balancing = CrossZoneLoadBalancingAttribute(
50 self.connection) 110 self.connection)
111 self.access_log = AccessLogAttribute(self.connection)
112 self.connection_draining = ConnectionDrainingAttribute(self.connection)
51 113
52 def __repr__(self): 114 def __repr__(self):
53 return 'LbAttributes(%s)' % ( 115 return 'LbAttributes(%s, %s, %s)' % (
54 repr(self.cross_zone_load_balancing)) 116 repr(self.cross_zone_load_balancing),
117 repr(self.access_log),
118 repr(self.connection_draining))
55 119
56 def startElement(self, name, attrs, connection): 120 def startElement(self, name, attrs, connection):
57 if name == 'CrossZoneLoadBalancing': 121 if name == 'CrossZoneLoadBalancing':
58 return self.cross_zone_load_balancing 122 return self.cross_zone_load_balancing
59 123 if name == 'AccessLog':
124 return self.access_log
125 if name == 'ConnectionDraining':
126 return self.connection_draining
127
60 def endElement(self, name, value, connection): 128 def endElement(self, name, value, connection):
61 pass 129 pass
OLDNEW
« no previous file with comments | « third_party/boto/boto/ec2/elb/__init__.py ('k') | third_party/boto/boto/ec2/elb/loadbalancer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698