2021-08-24 15:49:45 +00:00
|
|
|
"""{{ service_class }}Backend class with methods for supported APIs."""
|
2019-12-26 16:12:22 +00:00
|
|
|
from boto3 import Session
|
2021-08-24 15:49:45 +00:00
|
|
|
|
2017-09-19 18:14:14 +00:00
|
|
|
from moto.core import BaseBackend, BaseModel
|
|
|
|
|
|
|
|
|
|
|
|
class {{ service_class }}Backend(BaseBackend):
|
2021-08-24 15:49:45 +00:00
|
|
|
"""Implementation of {{ service_class }} APIs."""
|
|
|
|
|
2017-09-19 18:14:14 +00:00
|
|
|
def __init__(self, region_name=None):
|
|
|
|
self.region_name = region_name
|
|
|
|
|
|
|
|
def reset(self):
|
2021-08-24 15:49:45 +00:00
|
|
|
"""Re-initialize all attributes for this instance."""
|
2017-09-19 18:14:14 +00:00
|
|
|
region_name = self.region_name
|
|
|
|
self.__dict__ = {}
|
|
|
|
self.__init__(region_name)
|
|
|
|
|
|
|
|
# add methods from here
|
|
|
|
|
|
|
|
|
2019-12-26 16:12:22 +00:00
|
|
|
{{ escaped_service }}_backends = {}
|
2021-08-24 15:49:45 +00:00
|
|
|
for available_region in Session().get_available_regions("{{ service }}"):
|
|
|
|
{{ escaped_service }}_backends[available_region] = {{ service_class }}Backend()
|
|
|
|
for available_region in Session().get_available_regions(
|
|
|
|
"{{ service }}", partition_name="aws-us-gov"
|
|
|
|
):
|
|
|
|
{{ escaped_service }}_backends[available_region] = {{ service_class }}Backend()
|
|
|
|
for available_region in Session().get_available_regions(
|
|
|
|
"{{ service }}", partition_name="aws-cn"
|
|
|
|
):
|
|
|
|
{{ escaped_service }}_backends[available_region] = {{ service_class }}Backend()
|