commit
6a0e8df189
@ -6,5 +6,5 @@ url_bases = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
url_paths = {
|
url_paths = {
|
||||||
'{0}/$': AutoScalingResponse().dispatch,
|
'{0}/$': AutoScalingResponse.dispatch,
|
||||||
}
|
}
|
||||||
|
@ -6,5 +6,5 @@ url_bases = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
url_paths = {
|
url_paths = {
|
||||||
'{0}/$': CloudFormationResponse().dispatch,
|
'{0}/$': CloudFormationResponse.dispatch,
|
||||||
}
|
}
|
||||||
|
@ -5,5 +5,5 @@ url_bases = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
url_paths = {
|
url_paths = {
|
||||||
'{0}/$': CloudWatchResponse().dispatch,
|
'{0}/$': CloudWatchResponse.dispatch,
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,11 @@ class BaseResponse(_TemplateEnvironmentMixin):
|
|||||||
default_region = 'us-east-1'
|
default_region = 'us-east-1'
|
||||||
region_regex = r'\.(.+?)\.amazonaws\.com'
|
region_regex = r'\.(.+?)\.amazonaws\.com'
|
||||||
|
|
||||||
def dispatch(self, request, full_url, headers):
|
@classmethod
|
||||||
|
def dispatch(cls, *args, **kwargs):
|
||||||
|
return cls()._dispatch(*args, **kwargs)
|
||||||
|
|
||||||
|
def _dispatch(self, request, full_url, headers):
|
||||||
querystring = {}
|
querystring = {}
|
||||||
|
|
||||||
if hasattr(request, 'body'):
|
if hasattr(request, 'body'):
|
||||||
|
@ -7,5 +7,5 @@ url_bases = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
url_paths = {
|
url_paths = {
|
||||||
"{0}/": DynamoHandler().dispatch,
|
"{0}/": DynamoHandler.dispatch,
|
||||||
}
|
}
|
||||||
|
@ -240,7 +240,7 @@ class Table(object):
|
|||||||
results = []
|
results = []
|
||||||
last_page = True # Once pagination is implemented, change this
|
last_page = True # Once pagination is implemented, change this
|
||||||
|
|
||||||
possible_results = [item for item in list(self.all_items()) if item.hash_key == hash_key]
|
possible_results = [item for item in list(self.all_items()) if isinstance(item, Item) and item.hash_key == hash_key]
|
||||||
if range_comparison:
|
if range_comparison:
|
||||||
for result in possible_results:
|
for result in possible_results:
|
||||||
if result.range_key.compare(range_comparison, range_objs):
|
if result.range_key.compare(range_comparison, range_objs):
|
||||||
|
@ -7,5 +7,5 @@ url_bases = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
url_paths = {
|
url_paths = {
|
||||||
"{0}/": DynamoHandler().dispatch,
|
"{0}/": DynamoHandler.dispatch,
|
||||||
}
|
}
|
||||||
|
@ -7,5 +7,5 @@ url_bases = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
url_paths = {
|
url_paths = {
|
||||||
'{0}/': EC2Response().dispatch,
|
'{0}/': EC2Response.dispatch,
|
||||||
}
|
}
|
||||||
|
@ -6,5 +6,5 @@ url_bases = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
url_paths = {
|
url_paths = {
|
||||||
'{0}/$': ELBResponse().dispatch,
|
'{0}/$': ELBResponse.dispatch,
|
||||||
}
|
}
|
||||||
|
@ -6,5 +6,5 @@ url_bases = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
url_paths = {
|
url_paths = {
|
||||||
'{0}/$': ElasticMapReduceResponse().dispatch,
|
'{0}/$': ElasticMapReduceResponse.dispatch,
|
||||||
}
|
}
|
||||||
|
@ -6,5 +6,5 @@ url_bases = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
url_paths = {
|
url_paths = {
|
||||||
'{0}/$': IamResponse().dispatch,
|
'{0}/$': IamResponse.dispatch,
|
||||||
}
|
}
|
||||||
|
@ -6,5 +6,5 @@ url_bases = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
url_paths = {
|
url_paths = {
|
||||||
'{0}/$': KinesisResponse().dispatch,
|
'{0}/$': KinesisResponse.dispatch,
|
||||||
}
|
}
|
||||||
|
@ -6,5 +6,5 @@ url_bases = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
url_paths = {
|
url_paths = {
|
||||||
'{0}/$': RDSResponse().dispatch,
|
'{0}/$': RDSResponse.dispatch,
|
||||||
}
|
}
|
||||||
|
@ -7,5 +7,5 @@ url_bases = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
url_paths = {
|
url_paths = {
|
||||||
'{0}/$': RDS2Response().dispatch,
|
'{0}/$': RDS2Response.dispatch,
|
||||||
}
|
}
|
||||||
|
@ -6,5 +6,5 @@ url_bases = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
url_paths = {
|
url_paths = {
|
||||||
'{0}/$': RedshiftResponse().dispatch,
|
'{0}/$': RedshiftResponse.dispatch,
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,15 @@ def create_backend_app(service):
|
|||||||
|
|
||||||
backend = BACKENDS[service]
|
backend = BACKENDS[service]
|
||||||
for url_path, handler in backend.flask_paths.items():
|
for url_path, handler in backend.flask_paths.items():
|
||||||
backend_app.route(url_path, methods=HTTP_METHODS)(convert_flask_to_httpretty_response(handler))
|
if handler.__name__ == 'dispatch':
|
||||||
|
endpoint = '{0}.dispatch'.format(handler.__self__.__name__)
|
||||||
|
else:
|
||||||
|
endpoint = None
|
||||||
|
|
||||||
|
backend_app.route(
|
||||||
|
url_path,
|
||||||
|
endpoint=endpoint,
|
||||||
|
methods=HTTP_METHODS)(convert_flask_to_httpretty_response(handler))
|
||||||
|
|
||||||
return backend_app
|
return backend_app
|
||||||
|
|
||||||
|
@ -6,5 +6,5 @@ url_bases = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
url_paths = {
|
url_paths = {
|
||||||
'{0}/$': EmailResponse().dispatch,
|
'{0}/$': EmailResponse.dispatch,
|
||||||
}
|
}
|
||||||
|
@ -6,5 +6,5 @@ url_bases = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
url_paths = {
|
url_paths = {
|
||||||
'{0}/$': SNSResponse().dispatch,
|
'{0}/$': SNSResponse.dispatch,
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,6 @@ url_bases = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
url_paths = {
|
url_paths = {
|
||||||
'{0}/$': QueuesResponse().dispatch,
|
'{0}/$': QueuesResponse.dispatch,
|
||||||
'{0}/(?P<account_id>\d+)/(?P<queue_name>[a-zA-Z0-9\-_]+)': QueueResponse().dispatch,
|
'{0}/(?P<account_id>\d+)/(?P<queue_name>[a-zA-Z0-9\-_]+)': QueueResponse.dispatch,
|
||||||
}
|
}
|
||||||
|
@ -6,5 +6,5 @@ url_bases = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
url_paths = {
|
url_paths = {
|
||||||
'{0}/$': TokenResponse().dispatch,
|
'{0}/$': TokenResponse.dispatch,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user