23
23
# this is here for backward compatibility
24
24
# originally, the SNSConnection class was defined here
25
25
from connection import SNSConnection
26
from boto.regioninfo import RegionInfo
30
Get all available regions for the SNS service.
33
:return: A list of :class:`boto.regioninfo.RegionInfo` instances
35
return [RegionInfo(name='us-east-1',
36
endpoint='sns.us-east-1.amazonaws.com',
37
connection_cls=SNSConnection),
38
RegionInfo(name='eu-west-1',
39
endpoint='sns.eu-west-1.amazonaws.com',
40
connection_cls=SNSConnection),
41
RegionInfo(name='us-west-1',
42
endpoint='sns.us-west-1.amazonaws.com',
43
connection_cls=SNSConnection),
44
RegionInfo(name='sa-east-1',
45
endpoint='sns.sa-east-1.amazonaws.com',
46
connection_cls=SNSConnection),
47
RegionInfo(name='us-west-2',
48
endpoint='sns.us-west-2.amazonaws.com',
49
connection_cls=SNSConnection),
50
RegionInfo(name='ap-northeast-1',
51
endpoint='sns.ap-northeast-1.amazonaws.com',
52
connection_cls=SNSConnection),
53
RegionInfo(name='ap-southeast-1',
54
endpoint='sns.ap-southeast-1.amazonaws.com',
55
connection_cls=SNSConnection),
58
def connect_to_region(region_name, **kw_params):
60
Given a valid region name, return a
61
:class:`boto.sns.connection.SNSConnection`.
64
:param region_name: The name of the region to connect to.
66
:rtype: :class:`boto.sns.connection.SNSConnection` or ``None``
67
:return: A connection to the given region, or None if an invalid region
70
for region in regions():
71
if region.name == region_name:
72
return region.connect(**kw_params)
75
def get_region(region_name, **kw_params):
77
Find and return a :class:`boto.regioninfo.RegionInfo` object
81
:param: The name of the region.
83
:rtype: :class:`boto.regioninfo.RegionInfo`
84
:return: The RegionInfo object for the given region or None if
85
an invalid region name is provided.
87
for region in regions(**kw_params):
88
if region.name == region_name: