diff --git a/src/spaceone/dashboard/error/data_table.py b/src/spaceone/dashboard/error/data_table.py index 4adea0b..9b29440 100644 --- a/src/spaceone/dashboard/error/data_table.py +++ b/src/spaceone/dashboard/error/data_table.py @@ -13,6 +13,10 @@ class ERROR_NOT_SUPPORTED_OPERATOR(ERROR_INVALID_ARGUMENT): _message = "Data table does not support operator. (operator = {operator})" +class ERROR_UNAVAILABLE_DATA_TABLE(ERROR_INVALID_ARGUMENT): + _message = "Data table is not available. (data_table_id = {data_table_id})" + + class ERROR_DUPLICATED_DATA_FIELDS(ERROR_INVALID_ARGUMENT): _message = "Data fields for join are duplicated. (fields = {fields})" diff --git a/src/spaceone/dashboard/service/public_data_table_service.py b/src/spaceone/dashboard/service/public_data_table_service.py index a51926e..910207f 100644 --- a/src/spaceone/dashboard/service/public_data_table_service.py +++ b/src/spaceone/dashboard/service/public_data_table_service.py @@ -4,6 +4,7 @@ from spaceone.core.service import * from spaceone.core.error import * +from spaceone.dashboard.error.data_table import ERROR_UNAVAILABLE_DATA_TABLE from spaceone.dashboard.manager.public_data_table_manager import PublicDataTableManager from spaceone.dashboard.manager.public_widget_manager import PublicWidgetManager from spaceone.dashboard.manager.data_table_manager.data_source_manager import ( @@ -393,6 +394,11 @@ def load(self, params: PublicDataTableLoadRequest) -> dict: ) ) + if pub_data_table_vo.state == "UNAVAILABLE": + raise ERROR_UNAVAILABLE_DATA_TABLE( + data_table_id=pub_data_table_vo.data_table_id + ) + if pub_data_table_vo.data_type == "ADDED": ds_mgr = DataSourceManager( "PUBLIC",