Index: boto/sdb/__init__.py |
diff --git a/boto/sdb/__init__.py b/boto/sdb/__init__.py |
index f5642c1419336de1ce286e31677992ab4cca6932..ef2b9ceda12bd298fe52ba62a3e2e8d4c4f82445 100644 |
--- a/boto/sdb/__init__.py |
+++ b/boto/sdb/__init__.py |
@@ -35,22 +35,42 @@ def regions(): |
endpoint='sdb.eu-west-1.amazonaws.com'), |
SDBRegionInfo(name='us-west-1', |
endpoint='sdb.us-west-1.amazonaws.com'), |
+ SDBRegionInfo(name='ap-northeast-1', |
+ endpoint='sdb.ap-northeast-1.amazonaws.com'), |
SDBRegionInfo(name='ap-southeast-1', |
endpoint='sdb.ap-southeast-1.amazonaws.com') |
] |
-def connect_to_region(region_name): |
+def connect_to_region(region_name, **kw_params): |
""" |
Given a valid region name, return a |
:class:`boto.sdb.connection.SDBConnection`. |
- |
- :param str region_name: The name of the region to connect to. |
+ |
+ :type: str |
+ :param region_name: The name of the region to connect to. |
:rtype: :class:`boto.sdb.connection.SDBConnection` or ``None`` |
:return: A connection to the given region, or None if an invalid region |
- name is given |
+ name is given |
""" |
for region in regions(): |
if region.name == region_name: |
- return region.connect() |
+ return region.connect(**kw_params) |
+ return None |
+ |
+def get_region(region_name, **kw_params): |
+ """ |
+ Find and return a :class:`boto.sdb.regioninfo.RegionInfo` object |
+ given a region name. |
+ |
+ :type: str |
+ :param: The name of the region. |
+ |
+ :rtype: :class:`boto.sdb.regioninfo.RegionInfo` |
+ :return: The RegionInfo object for the given region or None if |
+ an invalid region name is provided. |
+ """ |
+ for region in regions(**kw_params): |
+ if region.name == region_name: |
+ return region |
return None |