moto/moto/backends.py

35 lines
1.0 KiB
Python
Raw Normal View History

2013-07-27 16:24:38 -04:00
from moto.autoscaling import autoscaling_backend
2013-07-26 15:14:34 -04:00
from moto.dynamodb import dynamodb_backend
2013-12-05 13:16:56 +02:00
from moto.dynamodb2 import dynamodb_backend2
2013-07-26 15:14:34 -04:00
from moto.ec2 import ec2_backend
from moto.elb import elb_backend
2013-08-07 20:36:58 -04:00
from moto.emr import emr_backend
2013-07-26 15:14:34 -04:00
from moto.s3 import s3_backend
from moto.s3bucket_path import s3bucket_path_backend
2013-07-26 15:14:34 -04:00
from moto.ses import ses_backend
from moto.sqs import sqs_backend
from moto.sts import sts_backend
2013-11-14 11:14:14 -08:00
from moto.route53 import route53_backend
2013-07-26 15:14:34 -04:00
BACKENDS = {
2013-07-27 16:24:38 -04:00
'autoscaling': autoscaling_backend,
2013-07-26 15:14:34 -04:00
'dynamodb': dynamodb_backend,
2013-12-05 13:16:56 +02:00
'dynamodb2': dynamodb_backend2,
2013-07-26 15:14:34 -04:00
'ec2': ec2_backend,
'elb': elb_backend,
2013-08-07 20:36:58 -04:00
'emr': emr_backend,
2013-07-26 15:14:34 -04:00
's3': s3_backend,
's3bucket_path': s3bucket_path_backend,
2013-07-26 15:14:34 -04:00
'ses': ses_backend,
'sqs': sqs_backend,
'sts': sts_backend,
2013-11-14 11:14:14 -08:00
'route53': route53_backend
2013-07-26 15:14:34 -04:00
}
def get_model(name):
for backend in BACKENDS.values():
models = getattr(backend.__class__, '__models__', {})
if name in models:
return getattr(backend, models[name])()