OLD | NEW |
1 # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ | 1 # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ |
2 # | 2 # |
3 # Permission is hereby granted, free of charge, to any person obtaining a | 3 # Permission is hereby granted, free of charge, to any person obtaining a |
4 # copy of this software and associated documentation files (the | 4 # copy of this software and associated documentation files (the |
5 # "Software"), to deal in the Software without restriction, including | 5 # "Software"), to deal in the Software without restriction, including |
6 # without limitation the rights to use, copy, modify, merge, publish, dis- | 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 | 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- | 8 # persons to whom the Software is furnished to do so, subject to the fol- |
9 # lowing conditions: | 9 # lowing conditions: |
10 # | 10 # |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 :rtype: list | 29 :rtype: list |
30 :return: A list of :class:`boto.sdb.regioninfo.RegionInfo` instances | 30 :return: A list of :class:`boto.sdb.regioninfo.RegionInfo` instances |
31 """ | 31 """ |
32 return [SDBRegionInfo(name='us-east-1', | 32 return [SDBRegionInfo(name='us-east-1', |
33 endpoint='sdb.amazonaws.com'), | 33 endpoint='sdb.amazonaws.com'), |
34 SDBRegionInfo(name='eu-west-1', | 34 SDBRegionInfo(name='eu-west-1', |
35 endpoint='sdb.eu-west-1.amazonaws.com'), | 35 endpoint='sdb.eu-west-1.amazonaws.com'), |
36 SDBRegionInfo(name='us-west-1', | 36 SDBRegionInfo(name='us-west-1', |
37 endpoint='sdb.us-west-1.amazonaws.com'), | 37 endpoint='sdb.us-west-1.amazonaws.com'), |
| 38 SDBRegionInfo(name='us-west-2', |
| 39 endpoint='sdb.us-west-2.amazonaws.com'), |
38 SDBRegionInfo(name='ap-northeast-1', | 40 SDBRegionInfo(name='ap-northeast-1', |
39 endpoint='sdb.ap-northeast-1.amazonaws.com'), | 41 endpoint='sdb.ap-northeast-1.amazonaws.com'), |
40 SDBRegionInfo(name='ap-southeast-1', | 42 SDBRegionInfo(name='ap-southeast-1', |
41 endpoint='sdb.ap-southeast-1.amazonaws.com') | 43 endpoint='sdb.ap-southeast-1.amazonaws.com') |
42 ] | 44 ] |
43 | 45 |
44 def connect_to_region(region_name, **kw_params): | 46 def connect_to_region(region_name, **kw_params): |
45 """ | 47 """ |
46 Given a valid region name, return a | 48 Given a valid region name, return a |
47 :class:`boto.sdb.connection.SDBConnection`. | 49 :class:`boto.sdb.connection.SDBConnection`. |
(...skipping 19 matching lines...) Expand all Loading... |
67 :param: The name of the region. | 69 :param: The name of the region. |
68 | 70 |
69 :rtype: :class:`boto.sdb.regioninfo.RegionInfo` | 71 :rtype: :class:`boto.sdb.regioninfo.RegionInfo` |
70 :return: The RegionInfo object for the given region or None if | 72 :return: The RegionInfo object for the given region or None if |
71 an invalid region name is provided. | 73 an invalid region name is provided. |
72 """ | 74 """ |
73 for region in regions(**kw_params): | 75 for region in regions(**kw_params): |
74 if region.name == region_name: | 76 if region.name == region_name: |
75 return region | 77 return region |
76 return None | 78 return None |
OLD | NEW |