Best Python code snippet using localstack_python
inventory-client-vpn.py
Source:inventory-client-vpn.py
...106 107 return(response['Connections'])108def discover_client_vpn_routes(ec2_client, vpnId):109 '''Get client VPN routes configuration based on the endpointId''' 110 response = ec2_client.describe_client_vpn_routes(111 ClientVpnEndpointId=vpnId,112 )113 114 return(response['Routes'])115def discover_client_vpn_targets(ec2_client, vpnId):116 '''Get client VPN target networks configuration based on the endpointId'''117 response = ec2_client.describe_client_vpn_target_networks(118 ClientVpnEndpointId=vpnId,119 )120 ...
quotas.py
Source:quotas.py
...4EC2_SERVICE_CODE = 'ec2'5IN_PROGRESS = ['PENDING', 'CASE_OPENED']6def get_route_count(endpoint) -> int:7 client = boto3.client('ec2')8 response = client.describe_client_vpn_routes(9 ClientVpnEndpointId=endpoint,10 )11 return len(response['Routes'])12def quota_request_open(quota_code) -> bool:13 client = boto3.client('service-quotas')14 response = client.list_requested_service_quota_change_history_by_quota(15 ServiceCode=EC2_SERVICE_CODE,16 QuotaCode=quota_code17 )18 # Status='PENDING'|'CASE_OPENED'|'APPROVED'|'DENIED'|'CASE_CLOSED'19 return any(req['Status'] in IN_PROGRESS for req in response['RequestedQuotas'])20def increase_quota(increase_value, quota_code, endpoint) -> str:21 if quota_request_open(quota_code):22 return None...
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!