Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aada5d3
commit 10774a9
Showing
14 changed files
with
4,561 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Oops, something went wrong.