How to use get_domain_config_status method in localstack

Best Python code snippet using localstack_python

es_api.py

Source:es_api.py Github

copy

Full Screen

...18 message = 'Resource already exists.'19 response = make_response(jsonify({'error': message}))20 response.headers['x-amzn-errortype'] = error_type21 return response, code22def get_domain_config_status():23 return {24 'CreationDate': '%.2f' % time.time(),25 'PendingDeletion': False,26 'State': 'Active',27 'UpdateDate': '%.2f' % time.time(),28 'UpdateVersion': randint(1, 100)29 }30def get_domain_config(domain_name):31 return {32 'DomainConfig': {33 'AccessPolicies': {34 'Options': '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"AWS":"arn:aws:iam::%s:root"},"Action":"es:*","Resource":"arn:aws:es:%s:%s:domain/%s/*"}]}' % (TEST_AWS_ACCOUNT_ID, DEFAULT_REGION, TEST_AWS_ACCOUNT_ID, domain_name), # noqa: E50135 'Status': get_domain_config_status()36 },37 'AdvancedOptions': {38 'Options': {39 'indices.fielddata.cache.size': '',40 'rest.action.multi.allow_explicit_index': 'true'41 },42 'Status': get_domain_config_status()43 },44 'EBSOptions': {45 'Options': {46 'EBSEnabled': True,47 'EncryptionEnabled': False,48 'Iops': 0,49 'VolumeSize': 10,50 'VolumeType': 'gp2'51 },52 'Status': get_domain_config_status()53 },54 'ElasticsearchClusterConfig': {55 'Options': {56 'DedicatedMasterCount': 1,57 'DedicatedMasterEnabled': True,58 'DedicatedMasterType': 'm3.medium.elasticsearch',59 'InstanceCount': 1,60 'InstanceType': 'm3.medium.elasticsearch',61 'ZoneAwarenessEnabled': False62 },63 'Status': get_domain_config_status()64 },65 'ElasticsearchVersion': {66 'Options': '5.3',67 'Status': get_domain_config_status()68 },69 'EncryptionAtRestOptions': {70 'Options': {71 'Enabled': False,72 'KmsKeyId': ''73 },74 'Status': get_domain_config_status()75 },76 'LogPublishingOptions': {77 'Status': get_domain_config_status(),78 'Options': {79 'INDEX_SLOW_LOGS': {80 'CloudWatchLogsLogGroupArn': 'arn:aws:logs:%s:%s:log-group:sample-domain' % (DEFAULT_REGION, TEST_AWS_ACCOUNT_ID), # noqa: E50181 'Enabled': False82 },83 'SEARCH_SLOW_LOGS': {84 'CloudWatchLogsLogGroupArn': 'arn:aws:logs:%s:%s:log-group:sample-domain' % (DEFAULT_REGION, TEST_AWS_ACCOUNT_ID), # noqa: E50185 'Enabled': False,86 }87 }88 },89 'SnapshotOptions': {90 'Options': {91 'AutomatedSnapshotStartHour': randint(0, 23)92 },93 'Status': get_domain_config_status()94 },95 'VPCOptions': {96 'Options': {97 'AvailabilityZones': [98 'us-east-1b'99 ],100 'SecurityGroupIds': [101 'sg-12345678'102 ],103 'SubnetIds': [104 'subnet-12345678'105 ],106 'VPCId': 'vpc-12345678'107 },108 'Status': get_domain_config_status()109 }110 }111 }112def get_domain_status(domain_name, deleted=False):113 return {114 'DomainStatus': {115 'ARN': 'arn:aws:es:%s:%s:domain/%s' % (DEFAULT_REGION, TEST_AWS_ACCOUNT_ID, domain_name),116 'Created': True,117 'Deleted': deleted,118 'DomainId': '%s/%s' % (TEST_AWS_ACCOUNT_ID, domain_name),119 'DomainName': domain_name,120 'ElasticsearchClusterConfig': {121 'DedicatedMasterCount': 1,122 'DedicatedMasterEnabled': True,...

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