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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/boto/boto/ec2/elb/attributes.py
===================================================================
--- third_party/boto/boto/ec2/elb/attributes.py (revision 33376)
+++ third_party/boto/boto/ec2/elb/attributes.py (working copy)
@@ -40,6 +40,66 @@
else:
self.enabled = False
+class AccessLogAttribute(object):
+ """
+ Represents the AccessLog segment of ELB attributes.
+ """
+ def __init__(self, connection=None):
+ self.enabled = None
+ self.s3_bucket_name = None
+ self.s3_bucket_prefix = None
+ self.emit_interval = None
+
+ def __repr__(self):
+ return 'AccessLog(%s, %s, %s, %s)' % (
+ self.enabled,
+ self.s3_bucket_name,
+ self.s3_bucket_prefix,
+ self.emit_interval
+ )
+
+ def startElement(self, name, attrs, connection):
+ pass
+
+ def endElement(self, name, value, connection):
+ if name == 'Enabled':
+ if value.lower() == 'true':
+ self.enabled = True
+ else:
+ self.enabled = False
+ elif name == 'S3BucketName':
+ self.s3_bucket_name = value
+ elif name == 'S3BucketPrefix':
+ self.s3_bucket_prefix = value
+ elif name == 'EmitInterval':
+ self.emit_interval = int(value)
+
+class ConnectionDrainingAttribute(object):
+ """
+ Represents the ConnectionDraining segment of ELB attributes.
+ """
+ def __init__(self, connection=None):
+ self.enabled = None
+ self.timeout = None
+
+ def __repr__(self):
+ return 'ConnectionDraining(%s, %s)' % (
+ self.enabled,
+ self.timeout
+ )
+
+ def startElement(self, name, attrs, connection):
+ pass
+
+ def endElement(self, name, value, connection):
+ if name == 'Enabled':
+ if value.lower() == 'true':
+ self.enabled = True
+ else:
+ self.enabled = False
+ elif name == 'Timeout':
+ self.timeout = int(value)
+
class LbAttributes(object):
"""
Represents the Attributes of an Elastic Load Balancer.
@@ -48,14 +108,22 @@
self.connection = connection
self.cross_zone_load_balancing = CrossZoneLoadBalancingAttribute(
self.connection)
+ self.access_log = AccessLogAttribute(self.connection)
+ self.connection_draining = ConnectionDrainingAttribute(self.connection)
def __repr__(self):
- return 'LbAttributes(%s)' % (
- repr(self.cross_zone_load_balancing))
+ return 'LbAttributes(%s, %s, %s)' % (
+ repr(self.cross_zone_load_balancing),
+ repr(self.access_log),
+ repr(self.connection_draining))
def startElement(self, name, attrs, connection):
if name == 'CrossZoneLoadBalancing':
return self.cross_zone_load_balancing
-
+ if name == 'AccessLog':
+ return self.access_log
+ if name == 'ConnectionDraining':
+ return self.connection_draining
+
def endElement(self, name, value, connection):
pass
« 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