How to use delete_rest_api method in localstack

Best Python code snippet using localstack_python

apigateway.py

Source:apigateway.py Github

copy

Full Screen

...71 api_args = {'restApiId': api_id,72 'stageName': stage_name}73 return self.client.create_deployment(**api_args)74 @exception(logger)75 def delete_rest_api(self, api_id: str, count: int = _MAX_NUMBER_OF_RETRIES) -> Dict:76 """Deletes the specified API."""77 try:78 return self.client.delete_rest_api(restApiId=api_id)79 except ClientError as cerr:80 if (cerr.response['Error']['Code'] == 'TooManyRequestsException') \81 and (self._MAX_NUMBER_OF_RETRIES > 0):82 time.sleep(self._WAIT_BETWEEN_RETIRES)83 return self.delete_rest_api(api_id, count - 1)84 elif cerr.response['Error']['Code'] == 'NotFoundException':85 raise NotExistentApiGatewayWarning(restApiId=api_id)...

Full Screen

Full Screen

api_gateway.py

Source:api_gateway.py Github

copy

Full Screen

...14 'types': ['EDGE', ]15 })['id']16 assert any([api for api in client.get_rest_apis()['items'] if api['name'] == api_name])17 assert client.get_rest_api(restApiId=api_id)['name'] == api_name18 client.delete_rest_api(restApiId=api_id)19 with world.assert_raises(boto_exceptions.ClientError, 'NotFound'):20 client.get_rest_api(restApiId=api_id)21 def verify_denied(self, error_text):22 client = self.platform.get_client('apigateway')23 with world.assert_raises(boto_exceptions.ClientError, error_text):24 client.get_rest_apis()25 def verify_policy(self, prefix=False, pattern=False):26 client = self.platform.get_client('apigateway')27 if prefix:28 api_name = self.platform.get_test_name('api_')29 with world.assert_raises(boto_exceptions.ClientError,30 "Action 'CreateRestApi' violates policy 'csg.resource.name.prefix'"):31 client.create_rest_api(name=api_name,32 description='Api for Revizor Tests',33 endpointConfiguration={34 'types': ['EDGE', ]35 })36 if pattern:37 api_name = 'tmp_%s' % self.platform.get_test_name('api')38 with world.assert_raises(boto_exceptions.ClientError,39 "Action 'CreateRestApi' violates policy 'csg.resource.name.validation_pattern'"):40 client.create_rest_api(name=api_name,41 description='Api for Revizor Tests',42 endpointConfiguration={43 'types': ['EDGE', ]44 })45 api_name = 'tmp_%s' % self.platform.get_test_name('api_')46 api_id = client.create_rest_api(name=api_name,47 description='Api for Revizor Tests',48 endpointConfiguration={49 'types': ['EDGE', ]50 })['id']51 assert any([api for api in client.get_rest_apis()['items'] if api['name'] == api_name])...

Full Screen

Full Screen

sdk_metadata.py

Source:sdk_metadata.py Github

copy

Full Screen

1import boto32def justreturn(**kwargs):3 return "always_return_success"4_SDK_FUNC_DICT = {"add_permission": boto3.client('lambda').add_permission,5 "create_function": boto3.client('lambda').create_function,6 "delete_function": boto3.client('lambda').delete_function,7 "remove_permission": boto3.client('lambda').remove_permission,8 "create_rest_api": boto3.client('apigateway').create_rest_api,9 "get_resources": boto3.client('apigateway').get_resources,10 "create_resource": boto3.client('apigateway').create_resource,11 "put_method": boto3.client('apigateway').put_method,12 "put_integration": boto3.client('apigateway').put_integration,13 "create_deployment": boto3.client('apigateway').create_deployment,14 "delete_rest_api": boto3.client('apigateway').delete_rest_api,15 "update_stage": boto3.client('apigateway').update_stage,16 "update_account": boto3.client('apigateway').update_account,17 "create_api_mapping": boto3.client('apigatewayv2').create_api_mapping,18 "delete_api_mapping": boto3.client('apigatewayv2').delete_api_mapping,19 "get_api_mappings": boto3.client('apigatewayv2').get_api_mappings,20 "create_policy": boto3.client('iam').create_policy,21 "delete_policy": boto3.client('iam').delete_policy,22 "create_role": boto3.client('iam').create_role,23 "delete_role": boto3.client('iam').delete_role,24 "attach_role_policy": boto3.client('iam').attach_role_policy,25 "detach_role_policy": boto3.client('iam').detach_role_policy,26 "create_table": boto3.client('dynamodb').create_table,27 "delete_table": boto3.client('dynamodb').delete_table,28 "notdummy": justreturn...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run localstack automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful