Started ACM framework

This commit is contained in:
Terry Cain 2017-09-21 21:44:34 +01:00
parent 606fa0afb5
commit 9e19243310
No known key found for this signature in database
GPG Key ID: 14D90844E4E9B9F3
4 changed files with 85 additions and 0 deletions

6
moto/acm/__init__.py Normal file
View File

@ -0,0 +1,6 @@
from __future__ import unicode_literals
from .models import acm_backends
from ..core.models import base_decorator
acm_backend = acm_backends['us-east-1']
mock_acm = base_decorator(acm_backends)

19
moto/acm/models.py Normal file
View File

@ -0,0 +1,19 @@
from __future__ import unicode_literals
from moto.core import BaseBackend, BaseModel
from moto.ec2 import ec2_backends
class Certificate(BaseModel):
pass
class AWSCertificateManagerBackend(BaseBackend):
def __init__(self):
self._certificates = {}
acm_backends = {}
for region, ec2_backend in ec2_backends.items():
acm_backends[region] = AWSCertificateManagerBackend()

50
moto/acm/responses.py Normal file
View File

@ -0,0 +1,50 @@
from __future__ import unicode_literals
import json
from moto.core.responses import BaseResponse
from .models import acm_backends
class AWSCertificateManagerResponse(BaseResponse):
@property
def acm_backend(self):
return acm_backends[self.region]
@property
def request_params(self):
try:
return json.loads(self.body)
except ValueError:
return {}
def _get_param(self, param, default=None):
return self.request_params.get(param, default)
def add_tags_to_certificate(self):
raise NotImplementedError()
def delete_certificate(self):
raise NotImplementedError()
def describe_certificate(self):
raise NotImplementedError()
def import_certificate(self):
raise NotImplementedError()
def list_certificates(self):
raise NotImplementedError()
def list_tags_for_certificate(self):
raise NotImplementedError()
def remove_tags_from_certificate(self):
raise NotImplementedError()
def request_certificate(self):
raise NotImplementedError()
def resend_validation_email(self):
raise NotImplementedError()

10
moto/acm/urls.py Normal file
View File

@ -0,0 +1,10 @@
from __future__ import unicode_literals
from .responses import AWSCertificateManagerResponse
url_bases = [
"https?://acm.(.+).amazonaws.com",
]
url_paths = {
'{0}/$': AWSCertificateManagerResponse.dispatch,
}