This commit is contained in:
usmankb 2020-04-12 18:10:23 +05:30
parent 79e63e3bcf
commit 1c96a05314
3 changed files with 11 additions and 12 deletions

View File

@ -500,12 +500,12 @@ class RestAPI(BaseModel):
return child
def add_model(self,
name,
description=None,
schema=None,
content_type=None,
cli_input_json=None,
generate_cli_skeleton=None):
name,
description=None,
schema=None,
content_type=None,
cli_input_json=None,
generate_cli_skeleton=None):
model_id = create_id()
new_model = Model(
id=model_id,
@ -519,7 +519,6 @@ class RestAPI(BaseModel):
self.models[name] = new_model
return new_model
def get_resource_for_path(self, path_after_stage_name):
for resource in self.resources.values():
if resource.get_path() == path_after_stage_name:
@ -688,7 +687,6 @@ class Model(BaseModel,dict):
self["generateCliSkeleton"] = kwargs.get("generate_cli_skeleton")
class APIGatewayBackend(BaseBackend):
def __init__(self, region_name):
super(APIGatewayBackend, self).__init__()
@ -1171,7 +1169,8 @@ class APIGatewayBackend(BaseBackend):
model = api.models.get(model_name)
if model is None:
raise ModelNotFound
return model
else:
return model
apigateway_backends = {}

View File

@ -639,7 +639,7 @@ class APIGatewayResponse(BaseResponse):
'{{"message":"{0}","code":"{1}"}}'.format(
error.message, error.error_type
),
)
)
def model_induvidual(self, request, full_url, headers):
self.setup_class(request, full_url, headers)
@ -662,4 +662,4 @@ class APIGatewayResponse(BaseResponse):
'{{"message":"{0}","code":"{1}"}}'.format(
error.message, error.error_type
),
)
)

View File

@ -22,7 +22,7 @@ url_paths = {
"{0}/apikeys/(?P<apikey>[^/]+)": APIGatewayResponse().apikey_individual,
"{0}/usageplans$": APIGatewayResponse().usage_plans,
"{0}/domainnames$": APIGatewayResponse().domain_names,
"{0}/restapis/(?P<function_id>[^/]+)/models": APIGatewayResponse().models,
"{0}/restapis/(?P<function_id>[^/]+)/models$": APIGatewayResponse().models,
"{0}/restapis/(?P<function_id>[^/]+)/models/(?P<model_name>[^/]+)/?$": APIGatewayResponse().model_induvidual,
"{0}/domainnames/(?P<domain_name>[^/]+)/?$": APIGatewayResponse().domain_name_induvidual,
"{0}/usageplans/(?P<usage_plan_id>[^/]+)/?$": APIGatewayResponse().usage_plan_individual,