Permalink
Browse files

Finished integrating the endpoints changes.

  • Loading branch information...
1 parent 8fa3b6c commit 19f54836767176551cea75950d87f5bea6e5b469 @toastdriven toastdriven committed Jan 29, 2014
View
@@ -20,7 +20,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
-from boto.regioninfo import RegionInfo
+from boto.regioninfo import RegionInfo, get_regions
def regions():
@@ -31,31 +31,10 @@ def regions():
:return: A list of :class:`boto.regioninfo.RegionInfo`
"""
import boto.beanstalk.layer1
- return [RegionInfo(name='us-east-1',
- endpoint='elasticbeanstalk.us-east-1.amazonaws.com',
- connection_cls=boto.beanstalk.layer1.Layer1),
- RegionInfo(name='us-west-1',
- endpoint='elasticbeanstalk.us-west-1.amazonaws.com',
- connection_cls=boto.beanstalk.layer1.Layer1),
- RegionInfo(name='us-west-2',
- endpoint='elasticbeanstalk.us-west-2.amazonaws.com',
- connection_cls=boto.beanstalk.layer1.Layer1),
- RegionInfo(name='ap-northeast-1',
- endpoint='elasticbeanstalk.ap-northeast-1.amazonaws.com',
- connection_cls=boto.beanstalk.layer1.Layer1),
- RegionInfo(name='ap-southeast-1',
- endpoint='elasticbeanstalk.ap-southeast-1.amazonaws.com',
- connection_cls=boto.beanstalk.layer1.Layer1),
- RegionInfo(name='ap-southeast-2',
- endpoint='elasticbeanstalk.ap-southeast-2.amazonaws.com',
- connection_cls=boto.beanstalk.layer1.Layer1),
- RegionInfo(name='eu-west-1',
- endpoint='elasticbeanstalk.eu-west-1.amazonaws.com',
- connection_cls=boto.beanstalk.layer1.Layer1),
- RegionInfo(name='sa-east-1',
- endpoint='elasticbeanstalk.sa-east-1.amazonaws.com',
- connection_cls=boto.beanstalk.layer1.Layer1),
- ]
+ return get_regions(
+ 'elasticbeanstalk',
+ connection_cls=boto.beanstalk.layer1.Layer1
+ )
def connect_to_region(region_name, **kw_params):
@@ -21,19 +21,9 @@
# IN THE SOFTWARE.
from connection import CloudFormationConnection
-from boto.regioninfo import RegionInfo
+from boto.regioninfo import RegionInfo, get_regions, load_regions
-RegionData = {
- 'us-east-1': 'cloudformation.us-east-1.amazonaws.com',
- 'us-west-1': 'cloudformation.us-west-1.amazonaws.com',
- 'us-west-2': 'cloudformation.us-west-2.amazonaws.com',
- 'sa-east-1': 'cloudformation.sa-east-1.amazonaws.com',
- 'eu-west-1': 'cloudformation.eu-west-1.amazonaws.com',
- 'ap-northeast-1': 'cloudformation.ap-northeast-1.amazonaws.com',
- 'ap-southeast-1': 'cloudformation.ap-southeast-1.amazonaws.com',
- 'ap-southeast-2': 'cloudformation.ap-southeast-2.amazonaws.com',
- 'cn-north-1': 'cloudformation.cn-north-1.amazonaws.com.cn',
-}
+RegionData = load_regions().get('cloudformation')
def regions():
@@ -43,13 +33,10 @@ def regions():
:rtype: list
:return: A list of :class:`boto.RegionInfo` instances
"""
- regions = []
- for region_name in RegionData:
- region = RegionInfo(name=region_name,
- endpoint=RegionData[region_name],
- connection_cls=CloudFormationConnection)
- regions.append(region)
- return regions
+ return get_regions(
+ 'cloudformation',
+ connection_cls=CloudFormationConnection
+ )
def connect_to_region(region_name, **kw_params):
@@ -21,7 +21,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
-from boto.regioninfo import RegionInfo
+from boto.regioninfo import RegionInfo, get_regions
def regions():
@@ -32,23 +32,10 @@ def regions():
:return: A list of :class:`boto.regioninfo.RegionInfo`
"""
import boto.cloudsearch.layer1
- return [RegionInfo(name='us-east-1',
- endpoint='cloudsearch.us-east-1.amazonaws.com',
- connection_cls=boto.cloudsearch.layer1.Layer1),
- RegionInfo(name='eu-west-1',
- endpoint='cloudsearch.eu-west-1.amazonaws.com',
- connection_cls=boto.cloudsearch.layer1.Layer1),
- RegionInfo(name='us-west-1',
- endpoint='cloudsearch.us-west-1.amazonaws.com',
- connection_cls=boto.cloudsearch.layer1.Layer1),
- RegionInfo(name='us-west-2',
- endpoint='cloudsearch.us-west-2.amazonaws.com',
- connection_cls=boto.cloudsearch.layer1.Layer1),
- RegionInfo(name='ap-southeast-1',
- endpoint='cloudsearch.ap-southeast-1.amazonaws.com',
- connection_cls=boto.cloudsearch.layer1.Layer1),
-
- ]
+ return get_regions(
+ 'cloudsearch',
+ connection_cls=boto.cloudsearch.layer1.Layer1
+ )
def connect_to_region(region_name, **kw_params):
@@ -20,7 +20,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
-from boto.regioninfo import RegionInfo
+from boto.regioninfo import RegionInfo, get_regions
def regions():
@@ -31,14 +31,7 @@ def regions():
:return: A list of :class:`boto.regioninfo.RegionInfo`
"""
from boto.cloudtrail.layer1 import CloudTrailConnection
-
- return [RegionInfo(name='us-east-1',
- endpoint='cloudtrail.us-east-1.amazonaws.com',
- connection_cls=CloudTrailConnection),
- RegionInfo(name='us-west-2',
- endpoint='cloudtrail.us-west-2.amazonaws.com',
- connection_cls=CloudTrailConnection),
- ]
+ return get_regions('cloudtrail', connection_cls=CloudTrailConnection)
def connect_to_region(region_name, **kw_params):
@@ -20,7 +20,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
-from boto.regioninfo import RegionInfo
+from boto.regioninfo import RegionInfo, get_regions
def regions():
@@ -31,32 +31,7 @@ def regions():
:return: A list of :class:`boto.regioninfo.RegionInfo`
"""
from boto.directconnect.layer1 import DirectConnectConnection
-
- return [RegionInfo(name='us-east-1',
- endpoint='directconnect.us-east-1.amazonaws.com',
- connection_cls=DirectConnectConnection),
- RegionInfo(name='us-west-1',
- endpoint='directconnect.us-west-1.amazonaws.com',
- connection_cls=DirectConnectConnection),
- RegionInfo(name='us-west-2',
- endpoint='directconnect.us-west-2.amazonaws.com',
- connection_cls=DirectConnectConnection),
- RegionInfo(name='eu-west-1',
- endpoint='directconnect.eu-west-1.amazonaws.com',
- connection_cls=DirectConnectConnection),
- RegionInfo(name='ap-southeast-1',
- endpoint='directconnect.ap-southeast-1.amazonaws.com',
- connection_cls=DirectConnectConnection),
- RegionInfo(name='ap-southeast-2',
- endpoint='directconnect.ap-southeast-2.amazonaws.com',
- connection_cls=DirectConnectConnection),
- RegionInfo(name='ap-southeast-3',
- endpoint='directconnect.ap-southeast-3.amazonaws.com',
- connection_cls=DirectConnectConnection),
- RegionInfo(name='sa-east-1',
- endpoint='directconnect.sa-east-1.amazonaws.com',
- connection_cls=DirectConnectConnection),
- ]
+ return get_regions('directconnect', connection_cls=DirectConnectConnection)
def connect_to_region(region_name, **kw_params):
View
@@ -21,7 +21,7 @@
# IN THE SOFTWARE.
#
-from boto.regioninfo import RegionInfo
+from boto.regioninfo import RegionInfo, get_regions
def regions():
@@ -32,37 +32,7 @@ def regions():
:return: A list of :class:`boto.regioninfo.RegionInfo`
"""
import boto.dynamodb.layer2
- return [RegionInfo(name='us-east-1',
- endpoint='dynamodb.us-east-1.amazonaws.com',
- connection_cls=boto.dynamodb.layer2.Layer2),
- RegionInfo(name='us-gov-west-1',
- endpoint='dynamodb.us-gov-west-1.amazonaws.com',
- connection_cls=boto.dynamodb.layer2.Layer2),
- RegionInfo(name='us-west-1',
- endpoint='dynamodb.us-west-1.amazonaws.com',
- connection_cls=boto.dynamodb.layer2.Layer2),
- RegionInfo(name='us-west-2',
- endpoint='dynamodb.us-west-2.amazonaws.com',
- connection_cls=boto.dynamodb.layer2.Layer2),
- RegionInfo(name='ap-northeast-1',
- endpoint='dynamodb.ap-northeast-1.amazonaws.com',
- connection_cls=boto.dynamodb.layer2.Layer2),
- RegionInfo(name='ap-southeast-1',
- endpoint='dynamodb.ap-southeast-1.amazonaws.com',
- connection_cls=boto.dynamodb.layer2.Layer2),
- RegionInfo(name='ap-southeast-2',
- endpoint='dynamodb.ap-southeast-2.amazonaws.com',
- connection_cls=boto.dynamodb.layer2.Layer2),
- RegionInfo(name='eu-west-1',
- endpoint='dynamodb.eu-west-1.amazonaws.com',
- connection_cls=boto.dynamodb.layer2.Layer2),
- RegionInfo(name='sa-east-1',
- endpoint='dynamodb.sa-east-1.amazonaws.com',
- connection_cls=boto.dynamodb.layer2.Layer2),
- RegionInfo(name='cn-north-1',
- endpoint='dynamodb.cn-north-1.amazonaws.com.cn',
- connection_cls=boto.dynamodb.layer2.Layer2),
- ]
+ return get_regions('dynamodb', connection_cls=boto.dynamodb.layer2.Layer2)
def connect_to_region(region_name, **kw_params):
View
@@ -21,7 +21,7 @@
# IN THE SOFTWARE.
#
-from boto.regioninfo import RegionInfo
+from boto.regioninfo import RegionInfo, get_regions
def regions():
@@ -32,37 +32,7 @@ def regions():
:return: A list of :class:`boto.regioninfo.RegionInfo`
"""
from boto.dynamodb2.layer1 import DynamoDBConnection
- return [RegionInfo(name='us-east-1',
- endpoint='dynamodb.us-east-1.amazonaws.com',
- connection_cls=DynamoDBConnection),
- RegionInfo(name='us-gov-west-1',
- endpoint='dynamodb.us-gov-west-1.amazonaws.com',
- connection_cls=DynamoDBConnection),
- RegionInfo(name='us-west-1',
- endpoint='dynamodb.us-west-1.amazonaws.com',
- connection_cls=DynamoDBConnection),
- RegionInfo(name='us-west-2',
- endpoint='dynamodb.us-west-2.amazonaws.com',
- connection_cls=DynamoDBConnection),
- RegionInfo(name='eu-west-1',
- endpoint='dynamodb.eu-west-1.amazonaws.com',
- connection_cls=DynamoDBConnection),
- RegionInfo(name='ap-northeast-1',
- endpoint='dynamodb.ap-northeast-1.amazonaws.com',
- connection_cls=DynamoDBConnection),
- RegionInfo(name='ap-southeast-1',
- endpoint='dynamodb.ap-southeast-1.amazonaws.com',
- connection_cls=DynamoDBConnection),
- RegionInfo(name='ap-southeast-2',
- endpoint='dynamodb.ap-southeast-2.amazonaws.com',
- connection_cls=DynamoDBConnection),
- RegionInfo(name='sa-east-1',
- endpoint='dynamodb.sa-east-1.amazonaws.com',
- connection_cls=DynamoDBConnection),
- RegionInfo(name='cn-north-1',
- endpoint='dynamodb.cn-north-1.amazonaws.com.cn',
- connection_cls=DynamoDBConnection),
- ]
+ return get_regions('dynamodb', connection_cls=DynamoDBConnection)
def connect_to_region(region_name, **kw_params):
View
@@ -24,21 +24,10 @@
service from AWS.
"""
from boto.ec2.connection import EC2Connection
-from boto.regioninfo import RegionInfo
+from boto.regioninfo import RegionInfo, get_regions, load_regions
-RegionData = {
- 'us-east-1': 'ec2.us-east-1.amazonaws.com',
- 'us-gov-west-1': 'ec2.us-gov-west-1.amazonaws.com',
- 'us-west-1': 'ec2.us-west-1.amazonaws.com',
- 'us-west-2': 'ec2.us-west-2.amazonaws.com',
- 'sa-east-1': 'ec2.sa-east-1.amazonaws.com',
- 'eu-west-1': 'ec2.eu-west-1.amazonaws.com',
- 'ap-northeast-1': 'ec2.ap-northeast-1.amazonaws.com',
- 'ap-southeast-1': 'ec2.ap-southeast-1.amazonaws.com',
- 'ap-southeast-2': 'ec2.ap-southeast-2.amazonaws.com',
- 'cn-north-1': 'ec2.cn-north-1.amazonaws.com.cn',
-}
+RegionData = load_regions().get('ec2', {})
def regions(**kw_params):
@@ -51,13 +40,7 @@ def regions(**kw_params):
:rtype: list
:return: A list of :class:`boto.ec2.regioninfo.RegionInfo`
"""
- regions = []
- for region_name in RegionData:
- region = RegionInfo(name=region_name,
- endpoint=RegionData[region_name],
- connection_cls=EC2Connection)
- regions.append(region)
- return regions
+ return get_regions('ec2', connection_cls=EC2Connection)
def connect_to_region(region_name, **kw_params):
@@ -31,7 +31,7 @@
import boto
from boto.connection import AWSQueryConnection
-from boto.ec2.regioninfo import RegionInfo
+from boto.regioninfo import RegionInfo, get_regions, load_regions
from boto.ec2.autoscale.request import Request
from boto.ec2.autoscale.launchconfig import LaunchConfiguration
from boto.ec2.autoscale.group import AutoScalingGroup
@@ -46,18 +46,7 @@
from boto.ec2.autoscale.tag import Tag
from boto.ec2.autoscale.limits import AccountLimits
-RegionData = {
- 'us-east-1': 'autoscaling.us-east-1.amazonaws.com',
- 'us-gov-west-1': 'autoscaling.us-gov-west-1.amazonaws.com',
- 'us-west-1': 'autoscaling.us-west-1.amazonaws.com',
- 'us-west-2': 'autoscaling.us-west-2.amazonaws.com',
- 'sa-east-1': 'autoscaling.sa-east-1.amazonaws.com',
- 'eu-west-1': 'autoscaling.eu-west-1.amazonaws.com',
- 'ap-northeast-1': 'autoscaling.ap-northeast-1.amazonaws.com',
- 'ap-southeast-1': 'autoscaling.ap-southeast-1.amazonaws.com',
- 'ap-southeast-2': 'autoscaling.ap-southeast-2.amazonaws.com',
- 'cn-north-1': 'autoscaling.cn-north-1.amazonaws.com.cn',
-}
+RegionData = load_regions().get('autoscaling', {})
def regions():
@@ -67,13 +56,7 @@ def regions():
:rtype: list
:return: A list of :class:`boto.RegionInfo` instances
"""
- regions = []
- for region_name in RegionData:
- region = RegionInfo(name=region_name,
- endpoint=RegionData[region_name],
- connection_cls=AutoScaleConnection)
- regions.append(region)
- return regions
+ return get_regions('autoscaling', connection_cls=AutoScaleConnection)
def connect_to_region(region_name, **kw_params):
Oops, something went wrong.

0 comments on commit 19f5483

Please sign in to comment.