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
===================
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
-----

View File

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

View File

@ -1684,6 +1684,28 @@ class APIGatewayBackend(BaseBackend):
else:
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 = {}
for region_name in Session().get_available_regions("apigateway"):

View File

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