moto/moto/backends.py

38 lines
1.1 KiB
Python
Raw Normal View History

from __future__ import unicode_literals
2013-07-27 20:24:38 +00:00
from moto.autoscaling import autoscaling_backend
2014-10-31 03:51:09 +00:00
from moto.cloudwatch import cloudwatch_backend
2013-07-26 19:14:34 +00:00
from moto.dynamodb import dynamodb_backend
2013-12-05 11:16:56 +00:00
from moto.dynamodb2 import dynamodb_backend2
2013-07-26 19:14:34 +00:00
from moto.ec2 import ec2_backend
from moto.elb import elb_backend
2013-08-08 00:36:58 +00:00
from moto.emr import emr_backend
2013-07-26 19:14:34 +00:00
from moto.s3 import s3_backend
from moto.s3bucket_path import s3bucket_path_backend
2013-07-26 19:14:34 +00:00
from moto.ses import ses_backend
from moto.sqs import sqs_backend
from moto.sts import sts_backend
2013-11-14 19:14:14 +00:00
from moto.route53 import route53_backend
2013-07-26 19:14:34 +00:00
BACKENDS = {
2013-07-27 20:24:38 +00:00
'autoscaling': autoscaling_backend,
2014-10-31 03:51:09 +00:00
'cloudwatch': cloudwatch_backend,
2013-07-26 19:14:34 +00:00
'dynamodb': dynamodb_backend,
2013-12-05 11:16:56 +00:00
'dynamodb2': dynamodb_backend2,
2013-07-26 19:14:34 +00:00
'ec2': ec2_backend,
'elb': elb_backend,
2013-08-08 00:36:58 +00:00
'emr': emr_backend,
2013-07-26 19:14:34 +00:00
's3': s3_backend,
's3bucket_path': s3bucket_path_backend,
2013-07-26 19:14:34 +00:00
'ses': ses_backend,
'sqs': sqs_backend,
'sts': sts_backend,
2013-11-14 19:14:14 +00:00
'route53': route53_backend
2013-07-26 19:14:34 +00:00
}
def get_model(name):
for backend in BACKENDS.values():
models = getattr(backend.__class__, '__models__', {})
if name in models:
2014-08-26 17:25:50 +00:00
return list(getattr(backend, models[name])())