Unverified Commit 8cc4e6b3 authored by Tao Feng's avatar Tao Feng Committed by GitHub

Change dashboard ES doc based on latest requirement (#238)

parent cf8478c0
......@@ -8,13 +8,13 @@ class DashboardESDocument(ElasticsearchDocument):
Schema for the ES dashboard ES document
"""
def __init__(self,
dashboard_group, # type: str
dashboard_name, # type: str
group_name, # type: str
name, # type: str
description, # type: Union[str, None]
total_usage, # type: int
product='', # type: Optional[str]
cluster='', # type: Optional[str]
dashboard_group_description=None, # type: Optional[str]
group_description=None, # type: Optional[str]
query_names=None, # type: Union[List[str], None]
group_url=None, # type: Optional[str]
url=None, # type: Optional[str]
......@@ -23,8 +23,8 @@ class DashboardESDocument(ElasticsearchDocument):
tags=None # type: list
):
# type: (...) -> None
self.dashboard_group = dashboard_group
self.dashboard_name = dashboard_name
self.group_name = group_name
self.name = name
self.description = description
self.cluster = cluster
self.product = product
......@@ -33,6 +33,6 @@ class DashboardESDocument(ElasticsearchDocument):
self.uri = uri
self.last_successful_run_timestamp = last_successful_run_timestamp
self.total_usage = total_usage
self.dashboard_group_description = dashboard_group_description
self.group_description = group_description
self.query_names = query_names
self.tags = tags
......@@ -2,7 +2,7 @@ import os
from setuptools import setup, find_packages
__version__ = '2.5.1'
__version__ = '2.5.2'
requirements_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'requirements.txt')
with open(requirements_path) as requirements_file:
......
......@@ -11,12 +11,12 @@ class TestDashboardElasticsearchDocument(unittest.TestCase):
"""
Test string generated from to_json method
"""
test_obj = DashboardESDocument(dashboard_group='test_dashboard_group',
dashboard_name='test_dashboard_name',
test_obj = DashboardESDocument(group_name='test_dashboard_group',
name='test_dashboard_name',
description='test_description',
product='mode',
cluster='gold',
dashboard_group_description='work space group',
group_description='work space group',
query_names=['query1'],
group_url='mode_group_url',
url='mode_report_url',
......@@ -25,8 +25,8 @@ class TestDashboardElasticsearchDocument(unittest.TestCase):
total_usage=10,
tags=['test'])
expected_document_dict = {"dashboard_group": "test_dashboard_group",
"dashboard_name": "test_dashboard_name",
expected_document_dict = {"group_name": "test_dashboard_group",
"name": "test_dashboard_name",
"description": "test_description",
"product": "mode",
"cluster": "gold",
......@@ -35,7 +35,7 @@ class TestDashboardElasticsearchDocument(unittest.TestCase):
"uri": "mode_dashboard://gold.cluster/dashboard_group/dashboard",
"query_names": ['query1'],
"last_successful_run_timestamp": 10,
"dashboard_group_description": "work space group",
"group_description": "work space group",
"total_usage": 10,
"tags": ["test"]
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment