1
# Copyright (c) 2006-2008 Mitch Garnaat http://garnaat.org/
1
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
2
# Copyright (c) 2010, Eucalyptus Systems, Inc.
3
5
# Permission is hereby granted, free of charge, to any person obtaining a
4
6
# copy of this software and associated documentation files (the
19
21
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22
class RegionInfo(object):
24
from boto.regioninfo import RegionInfo
26
class EC2RegionInfo(RegionInfo):
24
28
Represents an EC2 Region
27
31
def __init__(self, connection=None, name=None, endpoint=None):
28
self.connection = connection
30
self.endpoint = endpoint
33
return 'RegionInfo:%s' % self.name
35
def startElement(self, name, attrs, connection):
38
def endElement(self, name, value, connection):
39
if name == 'regionName':
41
elif name == 'regionEndpoint':
44
setattr(self, name, value)
46
def connect(self, **kw_params):
48
Connect to this Region's endpoint. Returns an EC2Connection
49
object pointing to the endpoint associated with this region.
50
You may pass any of the arguments accepted by the EC2Connection
51
object's constructor as keyword arguments and they will be
52
passed along to the EC2Connection object.
54
:rtype: :class:`boto.ec2.connection.EC2Connection`
55
:return: The connection to this regions endpoint
57
32
from boto.ec2.connection import EC2Connection
58
return EC2Connection(region=self, **kw_params)
33
RegionInfo.__init__(self, connection, name, endpoint,