Prepare release 2.2.8 (#4345)

This commit is contained in:
Bert Blommers 2021-09-25 16:20:33 +00:00 committed by GitHub
parent 939b800e96
commit 75beb9d1f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 63 additions and 25 deletions

View File

@ -1,8 +1,28 @@
Moto Changelog Moto Changelog
=================== ===================
Unreleased 2.2.8
----- -----
New Services:
* ACM:
* export_certificate()
* APIGateway:
* create_request_validator()
* delete_request_validator()
* get_request_validators()
* update_request_validator()
Miscellaneous:
* APIGateway: update_rest_api() now has improved support for the patchOperations-parameter
* Batch: register_job_definition() now supports the tags-parameter
* CloudFormation: Stack Events are now propagated to SNS when the NotificationARNs-parameter is supplied.
* EC2: describe_vpc_endpoint_services() now returns the default endpoints for implemented services
* IOT: list_job_executions_for_job() now supports the status-parameter
* IOT: list_job_executions_for_thing() now supports the status-parameter
* KMS: list_resource_tags() now supports an ARN as the KeyId-parameter
* KMS: tag_resource() now supports an ARN as the KeyId-parameter
* KMS: untag_resource() now supports an ARN as the KeyId-parameter
* SecretsManager: update_secret() now supports the ClientRequestToken-parameter
2.2.7 2.2.7
----- -----

View File

@ -22,7 +22,7 @@
## apigateway ## apigateway
<details> <details>
<summary>44% implemented</summary> <summary>48% implemented</summary>
- [X] create_api_key - [X] create_api_key
- [X] create_authorizer - [X] create_authorizer
@ -32,7 +32,7 @@
- [ ] create_documentation_version - [ ] create_documentation_version
- [X] create_domain_name - [X] create_domain_name
- [X] create_model - [X] create_model
- [ ] create_request_validator - [X] create_request_validator
- [X] create_resource - [X] create_resource
- [X] create_rest_api - [X] create_rest_api
- [X] create_stage - [X] create_stage
@ -53,7 +53,7 @@
- [X] delete_method - [X] delete_method
- [X] delete_method_response - [X] delete_method_response
- [ ] delete_model - [ ] delete_model
- [ ] delete_request_validator - [X] delete_request_validator
- [X] delete_resource - [X] delete_resource
- [X] delete_rest_api - [X] delete_rest_api
- [X] delete_stage - [X] delete_stage
@ -90,8 +90,8 @@
- [X] get_model - [X] get_model
- [ ] get_model_template - [ ] get_model_template
- [X] get_models - [X] get_models
- [ ] get_request_validator - [X] get_request_validator
- [ ] get_request_validators - [X] get_request_validators
- [X] get_resource - [X] get_resource
- [ ] get_resources - [ ] get_resources
- [X] get_rest_api - [X] get_rest_api
@ -137,7 +137,7 @@
- [X] update_method - [X] update_method
- [X] update_method_response - [X] update_method_response
- [ ] update_model - [ ] update_model
- [ ] update_request_validator - [X] update_request_validator
- [ ] update_resource - [ ] update_resource
- [X] update_rest_api - [X] update_rest_api
- [X] update_stage - [X] update_stage
@ -1687,7 +1687,7 @@
## elb ## elb
<details> <details>
<summary>34% implemented</summary> <summary>37% implemented</summary>
- [ ] add_tags - [ ] add_tags
- [X] apply_security_groups_to_load_balancer - [X] apply_security_groups_to_load_balancer
@ -1715,7 +1715,7 @@
- [ ] modify_load_balancer_attributes - [ ] modify_load_balancer_attributes
- [ ] register_instances_with_load_balancer - [ ] register_instances_with_load_balancer
- [ ] remove_tags - [ ] remove_tags
- [ ] set_load_balancer_listener_ssl_certificate - [X] set_load_balancer_listener_ssl_certificate
- [ ] set_load_balancer_policies_for_backend_server - [ ] set_load_balancer_policies_for_backend_server
- [X] set_load_balancer_policies_of_listener - [X] set_load_balancer_policies_of_listener
</details> </details>

View File

@ -1684,6 +1684,28 @@ class APIGatewayBackend(BaseBackend):
else: else:
return model return model
def get_request_validators(self, restapi_id):
restApi = self.get_rest_api(restapi_id)
return restApi.get_request_validators()
def create_request_validator(self, restapi_id, name, body, params):
restApi = self.get_rest_api(restapi_id)
return restApi.create_request_validator(
name=name, validateRequestBody=body, validateRequestParameters=params,
)
def get_request_validator(self, restapi_id, validator_id):
restApi = self.get_rest_api(restapi_id)
return restApi.get_request_validator(validator_id)
def delete_request_validator(self, restapi_id, validator_id):
restApi = self.get_rest_api(restapi_id)
restApi.delete_request_validator(validator_id)
def update_request_validator(self, restapi_id, validator_id, patch_operations):
restApi = self.get_rest_api(restapi_id)
return restApi.update_request_validator(validator_id, patch_operations)
apigateway_backends = {} apigateway_backends = {}
for region_name in Session().get_available_regions("apigateway"): for region_name in Session().get_available_regions("apigateway"):

View File

@ -311,23 +311,19 @@ class APIGatewayResponse(BaseResponse):
url_path_parts = self.path.split("/") url_path_parts = self.path.split("/")
restapi_id = url_path_parts[2] restapi_id = url_path_parts[2]
try: try:
restApi = self.backend.get_rest_api(restapi_id)
if self.method == "GET": if self.method == "GET":
validators = restApi.get_request_validators() validators = self.backend.get_request_validators(restapi_id)
res = json.dumps( res = json.dumps(
{"item": [validator.to_dict() for validator in validators]} {"item": [validator.to_dict() for validator in validators]}
) )
return 200, {}, res return 200, {}, res
if self.method == "POST": if self.method == "POST":
name = self._get_param("name") name = self._get_param("name")
validateRequestBody = self._get_bool_param("validateRequestBody") body = self._get_bool_param("validateRequestBody")
validateRequestParameters = self._get_bool_param( params = self._get_bool_param("validateRequestParameters")
"validateRequestParameters" validator = self.backend.create_request_validator(
) restapi_id, name, body, params
validator = restApi.create_request_validator(
name=name,
validateRequestBody=validateRequestBody,
validateRequestParameters=validateRequestParameters,
) )
return 200, {}, json.dumps(validator) return 200, {}, json.dumps(validator)
except BadRequestException as e: except BadRequestException as e:
@ -341,16 +337,16 @@ class APIGatewayResponse(BaseResponse):
restapi_id = url_path_parts[2] restapi_id = url_path_parts[2]
validator_id = url_path_parts[4] validator_id = url_path_parts[4]
try: try:
restApi = self.backend.get_rest_api(restapi_id)
if self.method == "GET": if self.method == "GET":
return 200, {}, json.dumps(restApi.get_request_validator(validator_id)) validator = self.backend.get_request_validator(restapi_id, validator_id)
return 200, {}, json.dumps(validator)
if self.method == "DELETE": if self.method == "DELETE":
restApi.delete_request_validator(validator_id) self.backend.delete_request_validator(restapi_id, validator_id)
return 202, {}, "" return 202, {}, ""
if self.method == "PATCH": if self.method == "PATCH":
patch_operations = self._get_param("patchOperations") patch_operations = self._get_param("patchOperations")
validator = restApi.update_request_validator( validator = self.backend.update_request_validator(
validator_id, patch_operations restapi_id, validator_id, patch_operations
) )
return 200, {}, json.dumps(validator) return 200, {}, json.dumps(validator)
except BadRequestException as e: except BadRequestException as e: