forked from getmoto/moto
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request getmoto#292 from mfulleratlassian/adding_rds2_support
Adding rds2 support
- Loading branch information
Showing
10 changed files
with
1,957 additions
and
0 deletions.
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
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,12 @@ | ||
from __future__ import unicode_literals | ||
from .models import rds2_backends | ||
from ..core.models import MockAWS | ||
|
||
rds2_backend = rds2_backends['us-west-1'] | ||
|
||
|
||
def mock_rds2(func=None): | ||
if func: | ||
return MockAWS(rds2_backends)(func) | ||
else: | ||
return MockAWS(rds2_backends) |
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,39 @@ | ||
from __future__ import unicode_literals | ||
|
||
import json | ||
from werkzeug.exceptions import BadRequest | ||
|
||
|
||
class RDSClientError(BadRequest): | ||
def __init__(self, code, message): | ||
super(RDSClientError, self).__init__() | ||
self.description = json.dumps({ | ||
"Error": { | ||
"Code": code, | ||
"Message": message, | ||
'Type': 'Sender', | ||
}, | ||
'RequestId': '6876f774-7273-11e4-85dc-39e55ca848d1', | ||
}) | ||
|
||
|
||
class DBInstanceNotFoundError(RDSClientError): | ||
def __init__(self, database_identifier): | ||
super(DBInstanceNotFoundError, self).__init__( | ||
'DBInstanceNotFound', | ||
"Database {0} not found.".format(database_identifier)) | ||
|
||
|
||
class DBSecurityGroupNotFoundError(RDSClientError): | ||
def __init__(self, security_group_name): | ||
super(DBSecurityGroupNotFoundError, self).__init__( | ||
'DBSecurityGroupNotFound', | ||
"Security Group {0} not found.".format(security_group_name)) | ||
|
||
|
||
class DBSubnetGroupNotFoundError(RDSClientError): | ||
def __init__(self, subnet_group_name): | ||
super(DBSubnetGroupNotFoundError, self).__init__( | ||
'DBSubnetGroupNotFound', | ||
"Subnet Group {0} not found.".format(subnet_group_name)) | ||
|
Oops, something went wrong.