We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
ElasticSearch 6 Support
Is there a plan for ElasticSearch 6 support anytime soon? Since [AWS supports ES 6](https://aws.amazon.com/about-aws/whats-new/2017/12/elasticsearch-6-0-now-available-on-amazon-elasticsearch-service/) it would be nice to be able to effectively simulate it locally.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `localstack/constants.py`
Content:
```
1 import os
2 import localstack_client.config
3 
4 # LocalStack version
5 VERSION = '0.8.5'
6 
7 # default AWS region
8 if 'DEFAULT_REGION' not in os.environ:
9     os.environ['DEFAULT_REGION'] = 'us-east-1'
10 DEFAULT_REGION = os.environ['DEFAULT_REGION']
11 
12 # constant to represent the "local" region, i.e., local machine
13 REGION_LOCAL = 'local'
14 
15 # dev environment
16 ENV_DEV = 'dev'
17 
18 # backend service ports, for services that are behind a proxy (counting down from 4566)
19 DEFAULT_PORT_APIGATEWAY_BACKEND = 4566
20 DEFAULT_PORT_KINESIS_BACKEND = 4565
21 DEFAULT_PORT_DYNAMODB_BACKEND = 4564
22 DEFAULT_PORT_S3_BACKEND = 4563
23 DEFAULT_PORT_SNS_BACKEND = 4562
24 DEFAULT_PORT_SQS_BACKEND = 4561
25 DEFAULT_PORT_ELASTICSEARCH_BACKEND = 4560
26 DEFAULT_PORT_CLOUDFORMATION_BACKEND = 4559
27 
28 DEFAULT_PORT_WEB_UI = 8080
29 
30 LOCALHOST = 'localhost'
31 
32 # version of the Maven dependency with Java utility code
33 LOCALSTACK_MAVEN_VERSION = '0.1.11'
34 
35 # map of default service APIs and ports to be spun up (fetch map from localstack_client)
36 DEFAULT_SERVICE_PORTS = localstack_client.config.get_service_ports()
37 
38 # host to bind to when starting the services
39 BIND_HOST = '0.0.0.0'
40 
41 # AWS user account ID used for tests
42 TEST_AWS_ACCOUNT_ID = '000000000000'
43 os.environ['TEST_AWS_ACCOUNT_ID'] = TEST_AWS_ACCOUNT_ID
44 
45 # root code folder
46 LOCALSTACK_ROOT_FOLDER = os.path.realpath(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))
47 
48 # virtualenv folder
49 LOCALSTACK_VENV_FOLDER = os.path.join(LOCALSTACK_ROOT_FOLDER, '.venv')
50 if not os.path.isdir(LOCALSTACK_VENV_FOLDER):
51     # assuming this package lives here: <python>/lib/pythonX.X/site-packages/localstack/
52     LOCALSTACK_VENV_FOLDER = os.path.realpath(os.path.join(LOCALSTACK_ROOT_FOLDER, '..', '..', '..'))
53 
54 # API Gateway path to indicate a user request sent to the gateway
55 PATH_USER_REQUEST = '_user_request_'
56 
57 # name of LocalStack Docker image
58 DOCKER_IMAGE_NAME = 'localstack/localstack'
59 
60 # environment variable name to tag local test runs
61 ENV_INTERNAL_TEST_RUN = 'LOCALSTACK_INTERNAL_TEST_RUN'
62 
63 # content types
64 APPLICATION_AMZ_JSON_1_0 = 'application/x-amz-json-1.0'
65 APPLICATION_AMZ_JSON_1_1 = 'application/x-amz-json-1.1'
66 APPLICATION_JSON = 'application/json'
67 
68 # Lambda defaults
69 LAMBDA_TEST_ROLE = 'arn:aws:iam::%s:role/lambda-test-role' % TEST_AWS_ACCOUNT_ID
70 
71 # installation constants
72 ELASTICSEARCH_JAR_URL = 'https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.3.0.zip'
73 DYNAMODB_JAR_URL = 'https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.zip'
74 ELASTICMQ_JAR_URL = 'https://s3-eu-west-1.amazonaws.com/softwaremill-public/elasticmq-server-0.13.8.jar'
75 STS_JAR_URL = 'http://central.maven.org/maven2/com/amazonaws/aws-java-sdk-sts/1.11.14/aws-java-sdk-sts-1.11.14.jar'
76 
77 # API endpoint for analytics events
78 API_ENDPOINT = 'https://api.localstack.cloud/v1'
79
```

Path: `localstack/services/es/es_api.py`
Content:
```
1 import json
2 from flask import Flask, jsonify, request, make_response
3 from localstack.services import generic_proxy
4 from localstack.constants import TEST_AWS_ACCOUNT_ID, DEFAULT_REGION
5 from localstack.utils.common import to_str
6 
7 APP_NAME = 'es_api'
8 API_PREFIX = '/2015-01-01'
9 
10 ES_DOMAINS = {}
11 
12 app = Flask(APP_NAME)
13 
14 
15 def error_response(error_type, code=400, message='Unknown error.'):
16     if not message:
17         if error_type == 'ResourceNotFoundException':
18             message = 'Resource not found.'
19         elif error_type == 'ResourceAlreadyExistsException':
20             message = 'Resource already exists.'
21     response = make_response(jsonify({'error': message}))
22     response.headers['x-amzn-errortype'] = error_type
23     return response, code
24 
25 
26 def get_domain_status(domain_name, deleted=False):
27     return {
28         'DomainStatus': {
29             'ARN': 'arn:aws:es:%s:%s:domain/%s' % (DEFAULT_REGION, TEST_AWS_ACCOUNT_ID, domain_name),
30             'Created': True,
31             'Deleted': deleted,
32             'DomainId': '%s/%s' % (TEST_AWS_ACCOUNT_ID, domain_name),
33             'DomainName': domain_name,
34             'ElasticsearchClusterConfig': {
35                 'DedicatedMasterCount': 1,
36                 'DedicatedMasterEnabled': True,
37                 'DedicatedMasterType': 'm3.medium.elasticsearch',
38                 'InstanceCount': 1,
39                 'InstanceType': 'm3.medium.elasticsearch',
40                 'ZoneAwarenessEnabled': True
41             },
42             'ElasticsearchVersion': '5.3',
43             'Endpoint': None,
44             'Processing': True
45         }
46     }
47 
48 
49 @app.route('%s/domain' % API_PREFIX, methods=['GET'])
50 def list_domain_names():
51     result = {
52         'DomainNames': [{'DomainName': name} for name in ES_DOMAINS.keys()]
53     }
54     return jsonify(result)
55 
56 
57 @app.route('%s/es/domain' % API_PREFIX, methods=['POST'])
58 def create_domain():
59     data = json.loads(to_str(request.data))
60     domain_name = data['DomainName']
61     if domain_name in ES_DOMAINS:
62         return error_response(error_type='ResourceAlreadyExistsException')
63     ES_DOMAINS[domain_name] = data
64     result = get_domain_status(domain_name)
65     return jsonify(result)
66 
67 
68 @app.route('%s/es/domain/<domain_name>' % API_PREFIX, methods=['GET'])
69 def describe_domain(domain_name):
70     if domain_name not in ES_DOMAINS:
71         return error_response(error_type='ResourceNotFoundException')
72     result = get_domain_status(domain_name)
73     return jsonify(result)
74 
75 
76 @app.route('%s/es/domain/<domain_name>' % API_PREFIX, methods=['DELETE'])
77 def delete_domain(domain_name):
78     if domain_name not in ES_DOMAINS:
79         return error_response(error_type='ResourceNotFoundException')
80     result = get_domain_status(domain_name, deleted=True)
81     ES_DOMAINS.pop(domain_name)
82     return jsonify(result)
83 
84 
85 def serve(port, quiet=True):
86     generic_proxy.serve_flask_app(app=app, port=port, quiet=quiet)
87
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/localstack/constants.py b/localstack/constants.py
--- a/localstack/constants.py
+++ b/localstack/constants.py
@@ -69,7 +69,7 @@
 LAMBDA_TEST_ROLE = 'arn:aws:iam::%s:role/lambda-test-role' % TEST_AWS_ACCOUNT_ID
 
 # installation constants
-ELASTICSEARCH_JAR_URL = 'https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.3.0.zip'
+ELASTICSEARCH_JAR_URL = 'https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.0.zip'
 DYNAMODB_JAR_URL = 'https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.zip'
 ELASTICMQ_JAR_URL = 'https://s3-eu-west-1.amazonaws.com/softwaremill-public/elasticmq-server-0.13.8.jar'
 STS_JAR_URL = 'http://central.maven.org/maven2/com/amazonaws/aws-java-sdk-sts/1.11.14/aws-java-sdk-sts-1.11.14.jar'
diff --git a/localstack/services/es/es_api.py b/localstack/services/es/es_api.py
--- a/localstack/services/es/es_api.py
+++ b/localstack/services/es/es_api.py
@@ -39,7 +39,7 @@
                 'InstanceType': 'm3.medium.elasticsearch',
                 'ZoneAwarenessEnabled': True
             },
-            'ElasticsearchVersion': '5.3',
+            'ElasticsearchVersion': '6.2',
             'Endpoint': None,
             'Processing': True
         }

{"golden_diff": "diff --git a/localstack/constants.py b/localstack/constants.py\n--- a/localstack/constants.py\n+++ b/localstack/constants.py\n@@ -69,7 +69,7 @@\n LAMBDA_TEST_ROLE = 'arn:aws:iam::%s:role/lambda-test-role' % TEST_AWS_ACCOUNT_ID\n \n # installation constants\n-ELASTICSEARCH_JAR_URL = 'https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.3.0.zip'\n+ELASTICSEARCH_JAR_URL = 'https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.0.zip'\n DYNAMODB_JAR_URL = 'https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.zip'\n ELASTICMQ_JAR_URL = 'https://s3-eu-west-1.amazonaws.com/softwaremill-public/elasticmq-server-0.13.8.jar'\n STS_JAR_URL = 'http://central.maven.org/maven2/com/amazonaws/aws-java-sdk-sts/1.11.14/aws-java-sdk-sts-1.11.14.jar'\ndiff --git a/localstack/services/es/es_api.py b/localstack/services/es/es_api.py\n--- a/localstack/services/es/es_api.py\n+++ b/localstack/services/es/es_api.py\n@@ -39,7 +39,7 @@\n                 'InstanceType': 'm3.medium.elasticsearch',\n                 'ZoneAwarenessEnabled': True\n             },\n-            'ElasticsearchVersion': '5.3',\n+            'ElasticsearchVersion': '6.2',\n             'Endpoint': None,\n             'Processing': True\n         }\n", "issue": "ElasticSearch 6 Support\nIs there a plan for ElasticSearch 6 support anytime soon? Since [AWS supports ES 6](https://aws.amazon.com/about-aws/whats-new/2017/12/elasticsearch-6-0-now-available-on-amazon-elasticsearch-service/) it would be nice to be able to effectively simulate it locally.\n", "before_files": [{"content": "import os\nimport localstack_client.config\n\n# LocalStack version\nVERSION = '0.8.5'\n\n# default AWS region\nif 'DEFAULT_REGION' not in os.environ:\n    os.environ['DEFAULT_REGION'] = 'us-east-1'\nDEFAULT_REGION = os.environ['DEFAULT_REGION']\n\n# constant to represent the \"local\" region, i.e., local machine\nREGION_LOCAL = 'local'\n\n# dev environment\nENV_DEV = 'dev'\n\n# backend service ports, for services that are behind a proxy (counting down from 4566)\nDEFAULT_PORT_APIGATEWAY_BACKEND = 4566\nDEFAULT_PORT_KINESIS_BACKEND = 4565\nDEFAULT_PORT_DYNAMODB_BACKEND = 4564\nDEFAULT_PORT_S3_BACKEND = 4563\nDEFAULT_PORT_SNS_BACKEND = 4562\nDEFAULT_PORT_SQS_BACKEND = 4561\nDEFAULT_PORT_ELASTICSEARCH_BACKEND = 4560\nDEFAULT_PORT_CLOUDFORMATION_BACKEND = 4559\n\nDEFAULT_PORT_WEB_UI = 8080\n\nLOCALHOST = 'localhost'\n\n# version of the Maven dependency with Java utility code\nLOCALSTACK_MAVEN_VERSION = '0.1.11'\n\n# map of default service APIs and ports to be spun up (fetch map from localstack_client)\nDEFAULT_SERVICE_PORTS = localstack_client.config.get_service_ports()\n\n# host to bind to when starting the services\nBIND_HOST = '0.0.0.0'\n\n# AWS user account ID used for tests\nTEST_AWS_ACCOUNT_ID = '000000000000'\nos.environ['TEST_AWS_ACCOUNT_ID'] = TEST_AWS_ACCOUNT_ID\n\n# root code folder\nLOCALSTACK_ROOT_FOLDER = os.path.realpath(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))\n\n# virtualenv folder\nLOCALSTACK_VENV_FOLDER = os.path.join(LOCALSTACK_ROOT_FOLDER, '.venv')\nif not os.path.isdir(LOCALSTACK_VENV_FOLDER):\n    # assuming this package lives here: <python>/lib/pythonX.X/site-packages/localstack/\n    LOCALSTACK_VENV_FOLDER = os.path.realpath(os.path.join(LOCALSTACK_ROOT_FOLDER, '..', '..', '..'))\n\n# API Gateway path to indicate a user request sent to the gateway\nPATH_USER_REQUEST = '_user_request_'\n\n# name of LocalStack Docker image\nDOCKER_IMAGE_NAME = 'localstack/localstack'\n\n# environment variable name to tag local test runs\nENV_INTERNAL_TEST_RUN = 'LOCALSTACK_INTERNAL_TEST_RUN'\n\n# content types\nAPPLICATION_AMZ_JSON_1_0 = 'application/x-amz-json-1.0'\nAPPLICATION_AMZ_JSON_1_1 = 'application/x-amz-json-1.1'\nAPPLICATION_JSON = 'application/json'\n\n# Lambda defaults\nLAMBDA_TEST_ROLE = 'arn:aws:iam::%s:role/lambda-test-role' % TEST_AWS_ACCOUNT_ID\n\n# installation constants\nELASTICSEARCH_JAR_URL = 'https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.3.0.zip'\nDYNAMODB_JAR_URL = 'https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.zip'\nELASTICMQ_JAR_URL = 'https://s3-eu-west-1.amazonaws.com/softwaremill-public/elasticmq-server-0.13.8.jar'\nSTS_JAR_URL = 'http://central.maven.org/maven2/com/amazonaws/aws-java-sdk-sts/1.11.14/aws-java-sdk-sts-1.11.14.jar'\n\n# API endpoint for analytics events\nAPI_ENDPOINT = 'https://api.localstack.cloud/v1'\n", "path": "localstack/constants.py"}, {"content": "import json\nfrom flask import Flask, jsonify, request, make_response\nfrom localstack.services import generic_proxy\nfrom localstack.constants import TEST_AWS_ACCOUNT_ID, DEFAULT_REGION\nfrom localstack.utils.common import to_str\n\nAPP_NAME = 'es_api'\nAPI_PREFIX = '/2015-01-01'\n\nES_DOMAINS = {}\n\napp = Flask(APP_NAME)\n\n\ndef error_response(error_type, code=400, message='Unknown error.'):\n    if not message:\n        if error_type == 'ResourceNotFoundException':\n            message = 'Resource not found.'\n        elif error_type == 'ResourceAlreadyExistsException':\n            message = 'Resource already exists.'\n    response = make_response(jsonify({'error': message}))\n    response.headers['x-amzn-errortype'] = error_type\n    return response, code\n\n\ndef get_domain_status(domain_name, deleted=False):\n    return {\n        'DomainStatus': {\n            'ARN': 'arn:aws:es:%s:%s:domain/%s' % (DEFAULT_REGION, TEST_AWS_ACCOUNT_ID, domain_name),\n            'Created': True,\n            'Deleted': deleted,\n            'DomainId': '%s/%s' % (TEST_AWS_ACCOUNT_ID, domain_name),\n            'DomainName': domain_name,\n            'ElasticsearchClusterConfig': {\n                'DedicatedMasterCount': 1,\n                'DedicatedMasterEnabled': True,\n                'DedicatedMasterType': 'm3.medium.elasticsearch',\n                'InstanceCount': 1,\n                'InstanceType': 'm3.medium.elasticsearch',\n                'ZoneAwarenessEnabled': True\n            },\n            'ElasticsearchVersion': '5.3',\n            'Endpoint': None,\n            'Processing': True\n        }\n    }\n\n\n@app.route('%s/domain' % API_PREFIX, methods=['GET'])\ndef list_domain_names():\n    result = {\n        'DomainNames': [{'DomainName': name} for name in ES_DOMAINS.keys()]\n    }\n    return jsonify(result)\n\n\n@app.route('%s/es/domain' % API_PREFIX, methods=['POST'])\ndef create_domain():\n    data = json.loads(to_str(request.data))\n    domain_name = data['DomainName']\n    if domain_name in ES_DOMAINS:\n        return error_response(error_type='ResourceAlreadyExistsException')\n    ES_DOMAINS[domain_name] = data\n    result = get_domain_status(domain_name)\n    return jsonify(result)\n\n\n@app.route('%s/es/domain/<domain_name>' % API_PREFIX, methods=['GET'])\ndef describe_domain(domain_name):\n    if domain_name not in ES_DOMAINS:\n        return error_response(error_type='ResourceNotFoundException')\n    result = get_domain_status(domain_name)\n    return jsonify(result)\n\n\n@app.route('%s/es/domain/<domain_name>' % API_PREFIX, methods=['DELETE'])\ndef delete_domain(domain_name):\n    if domain_name not in ES_DOMAINS:\n        return error_response(error_type='ResourceNotFoundException')\n    result = get_domain_status(domain_name, deleted=True)\n    ES_DOMAINS.pop(domain_name)\n    return jsonify(result)\n\n\ndef serve(port, quiet=True):\n    generic_proxy.serve_flask_app(app=app, port=port, quiet=quiet)\n", "path": "localstack/services/es/es_api.py"}], "after_files": [{"content": "import os\nimport localstack_client.config\n\n# LocalStack version\nVERSION = '0.8.5'\n\n# default AWS region\nif 'DEFAULT_REGION' not in os.environ:\n    os.environ['DEFAULT_REGION'] = 'us-east-1'\nDEFAULT_REGION = os.environ['DEFAULT_REGION']\n\n# constant to represent the \"local\" region, i.e., local machine\nREGION_LOCAL = 'local'\n\n# dev environment\nENV_DEV = 'dev'\n\n# backend service ports, for services that are behind a proxy (counting down from 4566)\nDEFAULT_PORT_APIGATEWAY_BACKEND = 4566\nDEFAULT_PORT_KINESIS_BACKEND = 4565\nDEFAULT_PORT_DYNAMODB_BACKEND = 4564\nDEFAULT_PORT_S3_BACKEND = 4563\nDEFAULT_PORT_SNS_BACKEND = 4562\nDEFAULT_PORT_SQS_BACKEND = 4561\nDEFAULT_PORT_ELASTICSEARCH_BACKEND = 4560\nDEFAULT_PORT_CLOUDFORMATION_BACKEND = 4559\n\nDEFAULT_PORT_WEB_UI = 8080\n\nLOCALHOST = 'localhost'\n\n# version of the Maven dependency with Java utility code\nLOCALSTACK_MAVEN_VERSION = '0.1.11'\n\n# map of default service APIs and ports to be spun up (fetch map from localstack_client)\nDEFAULT_SERVICE_PORTS = localstack_client.config.get_service_ports()\n\n# host to bind to when starting the services\nBIND_HOST = '0.0.0.0'\n\n# AWS user account ID used for tests\nTEST_AWS_ACCOUNT_ID = '000000000000'\nos.environ['TEST_AWS_ACCOUNT_ID'] = TEST_AWS_ACCOUNT_ID\n\n# root code folder\nLOCALSTACK_ROOT_FOLDER = os.path.realpath(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))\n\n# virtualenv folder\nLOCALSTACK_VENV_FOLDER = os.path.join(LOCALSTACK_ROOT_FOLDER, '.venv')\nif not os.path.isdir(LOCALSTACK_VENV_FOLDER):\n    # assuming this package lives here: <python>/lib/pythonX.X/site-packages/localstack/\n    LOCALSTACK_VENV_FOLDER = os.path.realpath(os.path.join(LOCALSTACK_ROOT_FOLDER, '..', '..', '..'))\n\n# API Gateway path to indicate a user request sent to the gateway\nPATH_USER_REQUEST = '_user_request_'\n\n# name of LocalStack Docker image\nDOCKER_IMAGE_NAME = 'localstack/localstack'\n\n# environment variable name to tag local test runs\nENV_INTERNAL_TEST_RUN = 'LOCALSTACK_INTERNAL_TEST_RUN'\n\n# content types\nAPPLICATION_AMZ_JSON_1_0 = 'application/x-amz-json-1.0'\nAPPLICATION_AMZ_JSON_1_1 = 'application/x-amz-json-1.1'\nAPPLICATION_JSON = 'application/json'\n\n# Lambda defaults\nLAMBDA_TEST_ROLE = 'arn:aws:iam::%s:role/lambda-test-role' % TEST_AWS_ACCOUNT_ID\n\n# installation constants\nELASTICSEARCH_JAR_URL = 'https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.0.zip'\nDYNAMODB_JAR_URL = 'https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.zip'\nELASTICMQ_JAR_URL = 'https://s3-eu-west-1.amazonaws.com/softwaremill-public/elasticmq-server-0.13.8.jar'\nSTS_JAR_URL = 'http://central.maven.org/maven2/com/amazonaws/aws-java-sdk-sts/1.11.14/aws-java-sdk-sts-1.11.14.jar'\n\n# API endpoint for analytics events\nAPI_ENDPOINT = 'https://api.localstack.cloud/v1'\n", "path": "localstack/constants.py"}, {"content": "import json\nfrom flask import Flask, jsonify, request, make_response\nfrom localstack.services import generic_proxy\nfrom localstack.constants import TEST_AWS_ACCOUNT_ID, DEFAULT_REGION\nfrom localstack.utils.common import to_str\n\nAPP_NAME = 'es_api'\nAPI_PREFIX = '/2015-01-01'\n\nES_DOMAINS = {}\n\napp = Flask(APP_NAME)\n\n\ndef error_response(error_type, code=400, message='Unknown error.'):\n    if not message:\n        if error_type == 'ResourceNotFoundException':\n            message = 'Resource not found.'\n        elif error_type == 'ResourceAlreadyExistsException':\n            message = 'Resource already exists.'\n    response = make_response(jsonify({'error': message}))\n    response.headers['x-amzn-errortype'] = error_type\n    return response, code\n\n\ndef get_domain_status(domain_name, deleted=False):\n    return {\n        'DomainStatus': {\n            'ARN': 'arn:aws:es:%s:%s:domain/%s' % (DEFAULT_REGION, TEST_AWS_ACCOUNT_ID, domain_name),\n            'Created': True,\n            'Deleted': deleted,\n            'DomainId': '%s/%s' % (TEST_AWS_ACCOUNT_ID, domain_name),\n            'DomainName': domain_name,\n            'ElasticsearchClusterConfig': {\n                'DedicatedMasterCount': 1,\n                'DedicatedMasterEnabled': True,\n                'DedicatedMasterType': 'm3.medium.elasticsearch',\n                'InstanceCount': 1,\n                'InstanceType': 'm3.medium.elasticsearch',\n                'ZoneAwarenessEnabled': True\n            },\n            'ElasticsearchVersion': '6.2',\n            'Endpoint': None,\n            'Processing': True\n        }\n    }\n\n\n@app.route('%s/domain' % API_PREFIX, methods=['GET'])\ndef list_domain_names():\n    result = {\n        'DomainNames': [{'DomainName': name} for name in ES_DOMAINS.keys()]\n    }\n    return jsonify(result)\n\n\n@app.route('%s/es/domain' % API_PREFIX, methods=['POST'])\ndef create_domain():\n    data = json.loads(to_str(request.data))\n    domain_name = data['DomainName']\n    if domain_name in ES_DOMAINS:\n        return error_response(error_type='ResourceAlreadyExistsException')\n    ES_DOMAINS[domain_name] = data\n    result = get_domain_status(domain_name)\n    return jsonify(result)\n\n\n@app.route('%s/es/domain/<domain_name>' % API_PREFIX, methods=['GET'])\ndef describe_domain(domain_name):\n    if domain_name not in ES_DOMAINS:\n        return error_response(error_type='ResourceNotFoundException')\n    result = get_domain_status(domain_name)\n    return jsonify(result)\n\n\n@app.route('%s/es/domain/<domain_name>' % API_PREFIX, methods=['DELETE'])\ndef delete_domain(domain_name):\n    if domain_name not in ES_DOMAINS:\n        return error_response(error_type='ResourceNotFoundException')\n    result = get_domain_status(domain_name, deleted=True)\n    ES_DOMAINS.pop(domain_name)\n    return jsonify(result)\n\n\ndef serve(port, quiet=True):\n    generic_proxy.serve_flask_app(app=app, port=port, quiet=quiet)\n", "path": "localstack/services/es/es_api.py"}]}