Ejemplo n.º 1
0
def connect_to_region(region_name, **kw_params):
    """
    Given a valid region name, return a
    :class:`fcu_boto.ec2.elb.ELBConnection`.

    :param str region_name: The name of the region to connect to.

    :rtype: :class:`fcu_boto.ec2.ELBConnection` or ``None``
    :return: A connection to the given region, or None if an invalid region
        name is given
    """
    return connect('elasticloadbalancing', region_name,
                   connection_cls=ELBConnection, **kw_params)
Ejemplo n.º 2
0
def connect_to_region(region_name, **kw_params):
    """
    Given a valid region name, return a
    :class:`fcu_boto.sdb.connection.SDBConnection`.

    :type: str
    :param region_name: The name of the region to connect to.

    :rtype: :class:`fcu_boto.sdb.connection.SDBConnection` or ``None``
    :return: A connection to the given region, or None if an invalid region
             name is given
    """
    return connect('sdb', region_name, region_cls=SDBRegionInfo, **kw_params)
Ejemplo n.º 3
0
def connect_to_region(region_name, **kw_params):
    from fcu_boto.s3.connection import S3Connection
    if 'host' in kw_params:
        host = kw_params.pop('host')
        if host not in ['', None]:
            region = S3RegionInfo(
                name='custom',
                endpoint=host,
                connection_cls=S3Connection
            )
            return region.connect(**kw_params)

    return connect('s3', region_name, region_cls=S3RegionInfo,
                   connection_cls=S3Connection, **kw_params)
Ejemplo n.º 4
0
def connect_to_region(region_name, **kw_params):
    """
    Given a valid region name, return a
    :class:`fcu_boto.ec2.autoscale.AutoScaleConnection`.

    :param str region_name: The name of the region to connect to.

    :rtype: :class:`fcu_boto.ec2.AutoScaleConnection` or ``None``
    :return: A connection to the given region, or None if an invalid region
        name is given
    """
    return connect('autoscaling',
                   region_name,
                   connection_cls=AutoScaleConnection,
                   **kw_params)
Ejemplo n.º 5
0
def connect_to_region(region_name, **kw_params):
    """
    Given a valid region name, return a
    :class:`fcu_boto.ec2.cloudwatch.CloudWatchConnection`.

    :param str region_name: The name of the region to connect to.

    :rtype: :class:`fcu_boto.ec2.CloudWatchConnection` or ``None``
    :return: A connection to the given region, or None if an invalid region
        name is given
    """
    return connect('cloudwatch',
                   region_name,
                   connection_cls=CloudWatchConnection,
                   **kw_params)
Ejemplo n.º 6
0
def connect_to_region(region_name, **kw_params):
    """
    Given a valid region name, return a
    :class:`fcu_boto.rds2.layer1.RDSConnection`.
    Any additional parameters after the region_name are passed on to
    the connect method of the region object.

    :type: str
    :param region_name: The name of the region to connect to.

    :rtype: :class:`fcu_boto.rds2.layer1.RDSConnection` or ``None``
    :return: A connection to the given region, or None if an invalid region
             name is given
    """
    from fcu_boto.rds2.layer1 import RDSConnection
    return connect('rds',
                   region_name,
                   connection_cls=RDSConnection,
                   **kw_params)
Ejemplo n.º 7
0
def connect_to_region(region_name, **kw_params):
    """
    Given a valid region name, return a
    :class:`fcu_boto.ec2.connection.EC2Connection`.
    Any additional parameters after the region_name are passed on to
    the connect method of the region object.

    :type: str
    :param region_name: The name of the region to connect to.

    :rtype: :class:`fcu_boto.ec2.connection.EC2Connection` or ``None``
    :return: A connection to the given region, or None if an invalid region
             name is given
    """
    if 'region' in kw_params and isinstance(kw_params['region'], RegionInfo)\
       and region_name == kw_params['region'].name:
        return EC2Connection(**kw_params)

    return connect('fcu',
                   region_name,
                   connection_cls=EC2Connection,
                   **kw_params)
Ejemplo n.º 8
0
def connect_to_region(region_name, **kw_params):
    """
    Given a valid region name, return a
    :class:`fcu_boto.iam.connection.IAMConnection`.

    :type: str
    :param region_name: The name of the region to connect to.

    :rtype: :class:`fcu_boto.iam.connection.IAMConnection` or ``None``
    :return: A connection to the given region, or None if an invalid region
             name is given
    """
    if region_name == 'universal':
        region = IAMRegionInfo(
            name='universal',
            endpoint='iam.amazonaws.com',
            connection_cls=IAMConnection
        )
        return region.connect(**kw_params)

    return connect('iam', region_name, region_cls=IAMRegionInfo,
                   connection_cls=IAMConnection, **kw_params)
Ejemplo n.º 9
0
def connect_to_region(region_name, **kw_params):
    from fcu_boto.codedeploy.layer1 import CodeDeployConnection
    return connect('codedeploy', region_name,
                   connection_cls=CodeDeployConnection, **kw_params)
Ejemplo n.º 10
0
def connect_to_region(region_name, **kw_params):
    from fcu_boto.support.layer1 import SupportConnection
    return connect('support',
                   region_name,
                   connection_cls=SupportConnection,
                   **kw_params)
Ejemplo n.º 11
0
def connect_to_region(region_name, **kw_params):
    from fcu_boto.awslambda.layer1 import AWSLambdaConnection
    return connect('awslambda', region_name,
                   connection_cls=AWSLambdaConnection, **kw_params)
Ejemplo n.º 12
0
def connect_to_region(region_name, **kw_params):
    from fcu_boto.cloudsearch.layer1 import Layer1
    return connect('cloudsearch',
                   region_name,
                   connection_cls=Layer1,
                   **kw_params)
Ejemplo n.º 13
0
def connect_to_region(region_name, **kw_params):
    from fcu_boto.kinesis.layer1 import KinesisConnection
    return connect('kinesis',
                   region_name,
                   connection_cls=KinesisConnection,
                   **kw_params)
Ejemplo n.º 14
0
def connect_to_region(region_name, **kw_params):
    from fcu_boto.route53.domains.layer1 import Route53DomainsConnection
    return connect('route53domains',
                   region_name,
                   connection_cls=Route53DomainsConnection,
                   **kw_params)
Ejemplo n.º 15
0
def connect_to_region(region_name, **kw_params):
    from fcu_boto.datapipeline.layer1 import DataPipelineConnection
    return connect('datapipeline',
                   region_name,
                   connection_cls=DataPipelineConnection,
                   **kw_params)
Ejemplo n.º 16
0
def connect_to_region(region_name, **kw_params):
    from fcu_boto.cloudtrail.layer1 import CloudTrailConnection
    return connect('cloudtrail',
                   region_name,
                   connection_cls=CloudTrailConnection,
                   **kw_params)
Ejemplo n.º 17
0
def connect_to_region(region_name, **kw_params):
    from fcu_boto.machinelearning.layer1 import MachineLearningConnection
    return connect('machinelearning',
                   region_name,
                   connection_cls=MachineLearningConnection,
                   **kw_params)
Ejemplo n.º 18
0
def connect_to_region(region_name, **kw_params):
    from fcu_boto.configservice.layer1 import ConfigServiceConnection
    return connect('configservice', region_name,
                   connection_cls=ConfigServiceConnection, **kw_params)
Ejemplo n.º 19
0
def connect_to_region(region_name, **kw_params):
    return connect('swf',
                   region_name,
                   connection_cls=fcu_boto.swf.layer1.Layer1,
                   **kw_params)
Ejemplo n.º 20
0
def connect_to_region(region_name, **kw_params):
    from fcu_boto.redshift.layer1 import RedshiftConnection
    return connect('redshift',
                   region_name,
                   connection_cls=RedshiftConnection,
                   **kw_params)
Ejemplo n.º 21
0
def connect_to_region(region_name, **kw_params):
    from fcu_boto.directconnect.layer1 import DirectConnectConnection
    return connect('directconnect',
                   region_name,
                   connection_cls=DirectConnectConnection,
                   **kw_params)
Ejemplo n.º 22
0
def connect_to_region(region_name, **kw_params):
    from fcu_boto.beanstalk.layer1 import Layer1
    return connect('elasticbeanstalk', region_name, connection_cls=Layer1,
                   **kw_params)
Ejemplo n.º 23
0
def connect_to_region(region_name, **kw_params):
    from fcu_boto.elasticache.layer1 import ElastiCacheConnection
    return connect('elasticache',
                   region_name,
                   connection_cls=ElastiCacheConnection,
                   **kw_params)
Ejemplo n.º 24
0
def connect_to_region(region_name, **kw_params):
    from fcu_boto.glacier.layer2 import Layer2
    return connect('glacier', region_name, connection_cls=Layer2, **kw_params)
Ejemplo n.º 25
0
def connect_to_region(region_name, **kw_params):
    from fcu_boto.ec2containerservice.layer1 import EC2ContainerServiceConnection
    return connect('ec2containerservice',
                   region_name,
                   connection_cls=EC2ContainerServiceConnection,
                   **kw_params)
Ejemplo n.º 26
0
def connect_to_region(region_name, **kw_params):
    from fcu_boto.cloudsearchdomain.layer1 import CloudSearchDomainConnection
    return connect('cloudsearchdomain',
                   region_name,
                   connection_cls=CloudSearchDomainConnection,
                   **kw_params)
Ejemplo n.º 27
0
def connect_to_region(region_name, **kw_params):
    from fcu_boto.cloudhsm.layer1 import CloudHSMConnection
    return connect('cloudhsm',
                   region_name,
                   connection_cls=CloudHSMConnection,
                   **kw_params)
Ejemplo n.º 28
0
def connect_to_region(region_name, **kw_params):
    from fcu_boto.elastictranscoder.layer1 import ElasticTranscoderConnection
    return connect('elastictranscoder',
                   region_name,
                   connection_cls=ElasticTranscoderConnection,
                   **kw_params)
Ejemplo n.º 29
0
def connect_to_region(region_name, **kw_params):
    from fcu_boto.opsworks.layer1 import OpsWorksConnection
    return connect('opsworks',
                   region_name,
                   connection_cls=OpsWorksConnection,
                   **kw_params)
Ejemplo n.º 30
0
def connect_to_region(region_name, **kw_params):
    from fcu_boto.cognito.sync.layer1 import CognitoSyncConnection
    return connect('cognito-sync', region_name,
                   connection_cls=CognitoSyncConnection, **kw_params)