Skip to content

Commit

Permalink
Merge pull request getmoto#292 from mfulleratlassian/adding_rds2_support
Browse files Browse the repository at this point in the history
Adding rds2 support
  • Loading branch information
spulec committed Feb 4, 2015
2 parents 96394ae + 41507e4 commit ea07dd1
Show file tree
Hide file tree
Showing 10 changed files with 1,957 additions and 0 deletions.
2 changes: 2 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ Moto is written by Steve Pulec with contributions from:
* [Peter](https://github.com/pvbouwel)
* [Tyler Sanders](https://github.com/tsanders)
* [Gary Dalton](https://github.com/gary-dalton)
* [Chris Henry](https://github.com/chrishenry)
* [Mike Fuller](https://github.com/mfulleratlassian)
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ It gets even better! Moto isn't just S3. Here's the status of the other AWS serv
|------------------------------------------------------------------------------|
| RDS | @mock_rds | core endpoints done |
|------------------------------------------------------------------------------|
| RDS2 | @mock_rds2 | core endpoints done |
|------------------------------------------------------------------------------|
| Route53 | @mock_route53 | core endpoints done |
|------------------------------------------------------------------------------|
| S3 | @mock_s3 | core endpoints done |
Expand Down
1 change: 1 addition & 0 deletions moto/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from .iam import mock_iam # flake8: noqa
from .kinesis import mock_kinesis # flake8: noqa
from .rds import mock_rds # flake8: noqa
from .rds2 import mock_rds2 # flake8: noqa
from .redshift import mock_redshift # flake8: noqa
from .s3 import mock_s3 # flake8: noqa
from .s3bucket_path import mock_s3bucket_path # flake8: noqa
Expand Down
12 changes: 12 additions & 0 deletions moto/rds2/__init__.py
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)
39 changes: 39 additions & 0 deletions moto/rds2/exceptions.py
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))

Loading

0 comments on commit ea07dd1

Please sign in to comment.