Skip to content

Commit

Permalink
Added boto.rds2.
Browse files Browse the repository at this point in the history
  • Loading branch information
toastdriven committed Feb 12, 2014
1 parent aada5d3 commit 10774a9
Show file tree
Hide file tree
Showing 14 changed files with 4,561 additions and 1 deletion.
15 changes: 15 additions & 0 deletions boto/__init__.py
Expand Up @@ -312,6 +312,21 @@ def connect_rds(aws_access_key_id=None, aws_secret_access_key=None, **kwargs):
return RDSConnection(aws_access_key_id, aws_secret_access_key, **kwargs)


def connect_rds2(aws_access_key_id=None, aws_secret_access_key=None, **kwargs):
"""
:type aws_access_key_id: string
:param aws_access_key_id: Your AWS Access Key ID
:type aws_secret_access_key: string
:param aws_secret_access_key: Your AWS Secret Access Key
:rtype: :class:`boto.rds2.layer1.RDSConnection`
:return: A connection to RDS
"""
from boto.rds2.layer1 import RDSConnection
return RDSConnection(aws_access_key_id, aws_secret_access_key, **kwargs)


def connect_emr(aws_access_key_id=None, aws_secret_access_key=None, **kwargs):
"""
:type aws_access_key_id: string
Expand Down
53 changes: 53 additions & 0 deletions boto/rds2/__init__.py
@@ -0,0 +1,53 @@
# Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish, dis-
# tribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the fol-
# lowing conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
# ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
from boto.regioninfo import get_regions


def regions():
"""
Get all available regions for the RDS service.
:rtype: list
:return: A list of :class:`boto.regioninfo.RegionInfo`
"""
from boto.rds2.layer1 import RDSConnection
return get_regions('rds', connection_cls=RDSConnection)


def connect_to_region(region_name, **kw_params):
"""
Given a valid region name, return a
:class:`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:`boto.rds2.layer1.RDSConnection` or ``None``
:return: A connection to the given region, or None if an invalid region
name is given
"""
for region in regions():
if region.name == region_name:
return region.connect(**kw_params)
return None
234 changes: 234 additions & 0 deletions boto/rds2/exceptions.py
@@ -0,0 +1,234 @@
# Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish, dis-
# tribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the fol-
# lowing conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
# ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
from boto.exception import JSONResponseError


class InvalidSubnet(JSONResponseError):
pass


class DBParameterGroupQuotaExceeded(JSONResponseError):
pass


class DBSubnetGroupAlreadyExists(JSONResponseError):
pass


class DBSubnetGroupQuotaExceeded(JSONResponseError):
pass


class InstanceQuotaExceeded(JSONResponseError):
pass


class InvalidRestore(JSONResponseError):
pass


class InvalidDBParameterGroupState(JSONResponseError):
pass


class AuthorizationQuotaExceeded(JSONResponseError):
pass


class DBSecurityGroupAlreadyExists(JSONResponseError):
pass


class InsufficientDBInstanceCapacity(JSONResponseError):
pass


class ReservedDBInstanceQuotaExceeded(JSONResponseError):
pass


class DBSecurityGroupNotFound(JSONResponseError):
pass


class DBInstanceAlreadyExists(JSONResponseError):
pass


class ReservedDBInstanceNotFound(JSONResponseError):
pass


class DBSubnetGroupDoesNotCoverEnoughAZs(JSONResponseError):
pass


class InvalidDBSecurityGroupState(JSONResponseError):
pass


class InvalidVPCNetworkState(JSONResponseError):
pass


class ReservedDBInstancesOfferingNotFound(JSONResponseError):
pass


class SNSTopicArnNotFound(JSONResponseError):
pass


class SNSNoAuthorization(JSONResponseError):
pass


class SnapshotQuotaExceeded(JSONResponseError):
pass


class OptionGroupQuotaExceeded(JSONResponseError):
pass


class DBParameterGroupNotFound(JSONResponseError):
pass


class SNSInvalidTopic(JSONResponseError):
pass


class InvalidDBSubnetGroupState(JSONResponseError):
pass


class DBSubnetGroupNotFound(JSONResponseError):
pass


class InvalidOptionGroupState(JSONResponseError):
pass


class SourceNotFound(JSONResponseError):
pass


class SubscriptionCategoryNotFound(JSONResponseError):
pass


class EventSubscriptionQuotaExceeded(JSONResponseError):
pass


class DBSecurityGroupNotSupported(JSONResponseError):
pass


class InvalidEventSubscriptionState(JSONResponseError):
pass


class InvalidDBSubnetState(JSONResponseError):
pass


class InvalidDBSnapshotState(JSONResponseError):
pass


class SubscriptionAlreadyExist(JSONResponseError):
pass


class DBSecurityGroupQuotaExceeded(JSONResponseError):
pass


class ProvisionedIopsNotAvailableInAZ(JSONResponseError):
pass


class AuthorizationNotFound(JSONResponseError):
pass


class OptionGroupAlreadyExists(JSONResponseError):
pass


class SubscriptionNotFound(JSONResponseError):
pass


class DBUpgradeDependencyFailure(JSONResponseError):
pass


class PointInTimeRestoreNotEnabled(JSONResponseError):
pass


class AuthorizationAlreadyExists(JSONResponseError):
pass


class DBSubnetQuotaExceeded(JSONResponseError):
pass


class OptionGroupNotFound(JSONResponseError):
pass


class DBParameterGroupAlreadyExists(JSONResponseError):
pass


class DBInstanceNotFound(JSONResponseError):
pass


class ReservedDBInstanceAlreadyExists(JSONResponseError):
pass


class InvalidDBInstanceState(JSONResponseError):
pass


class DBSnapshotNotFound(JSONResponseError):
pass


class DBSnapshotAlreadyExists(JSONResponseError):
pass


class StorageQuotaExceeded(JSONResponseError):
pass


class SubnetAlreadyInUse(JSONResponseError):
pass

0 comments on commit 10774a9

Please sign in to comment.