-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: change all apis for SpaceONE 2.0
- Loading branch information
Showing
18 changed files
with
348 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from spaceone.dashboard.info.domain_dashboard_info import * | ||
from spaceone.dashboard.info.domain_dashboard_version_info import * | ||
from spaceone.dashboard.info.dashboard_info import * | ||
from spaceone.dashboard.info.dashboard_version_info import * | ||
from spaceone.dashboard.info.common_info import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from google.protobuf.empty_pb2 import Empty | ||
from spaceone.core.pygrpc.message_type import * | ||
|
||
__all__ = ["EmptyInfo", "StatisticsInfo"] | ||
|
||
|
||
def EmptyInfo(): | ||
return Empty() | ||
|
||
|
||
def StatisticsInfo(result): | ||
return change_struct_type(result) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,46 @@ | ||
import functools | ||
from spaceone.api.dashboard.v1 import domain_dashboard_pb2 | ||
from spaceone.api.dashboard.v1 import dashboard_pb2 | ||
from spaceone.core.pygrpc.message_type import * | ||
from spaceone.core import utils | ||
from spaceone.dashboard.model.dashboard_model import Dashboard | ||
|
||
__all__ = ["DomainDashboardInfo", "DomainDashboardsInfo"] | ||
__all__ = ["DashboardInfo", "DashboardsInfo"] | ||
|
||
|
||
def DomainDashboardInfo(domain_dashboard_vo: Dashboard, minimal=False): | ||
def DashboardInfo(dashboard_vo: Dashboard, minimal=False): | ||
info = { | ||
"domain_dashboard_id": domain_dashboard_vo.domain_dashboard_id, | ||
"name": domain_dashboard_vo.name, | ||
"viewers": domain_dashboard_vo.viewers, | ||
"version": domain_dashboard_vo.version, | ||
"labels": change_list_value_type(domain_dashboard_vo.labels), | ||
"user_id": domain_dashboard_vo.user_id, | ||
"domain_id": domain_dashboard_vo.domain_id, | ||
"dashboard_id": dashboard_vo.dashboard_id, | ||
"name": dashboard_vo.name, | ||
"dashboard_type": dashboard_vo.dashboard_type, | ||
"version": dashboard_vo.version, | ||
"labels": change_list_value_type(dashboard_vo.labels), | ||
"resource_group": dashboard_vo.resource_group, | ||
"user_id": dashboard_vo.user_id, | ||
"project_id": dashboard_vo.project_id, | ||
"workspace_id": dashboard_vo.workspace_id, | ||
"domain_id": dashboard_vo.domain_id, | ||
} | ||
|
||
if not minimal: | ||
info.update( | ||
{ | ||
"layouts": change_list_value_type(domain_dashboard_vo.layouts) | ||
if domain_dashboard_vo.layouts | ||
"layouts": change_list_value_type(dashboard_vo.layouts) | ||
if dashboard_vo.layouts | ||
else None, | ||
"variables": change_struct_type(domain_dashboard_vo.variables), | ||
"settings": change_struct_type(domain_dashboard_vo.settings), | ||
"variables_schema": change_struct_type( | ||
domain_dashboard_vo.variables_schema | ||
), | ||
"tags": change_struct_type(domain_dashboard_vo.tags), | ||
"created_at": utils.datetime_to_iso8601(domain_dashboard_vo.created_at), | ||
"updated_at": utils.datetime_to_iso8601(domain_dashboard_vo.updated_at), | ||
"variables": change_struct_type(dashboard_vo.variables), | ||
"settings": change_struct_type(dashboard_vo.settings), | ||
"variables_schema": change_struct_type(dashboard_vo.variables_schema), | ||
"tags": change_struct_type(dashboard_vo.tags), | ||
"created_at": utils.datetime_to_iso8601(dashboard_vo.created_at), | ||
"updated_at": utils.datetime_to_iso8601(dashboard_vo.updated_at), | ||
} | ||
) | ||
|
||
return domain_dashboard_pb2.DomainDashboardInfo(**info) | ||
return dashboard_pb2.DashboardInfo(**info) | ||
|
||
|
||
def DomainDashboardsInfo(domain_dashboard_vos, total_count, **kwargs): | ||
return domain_dashboard_pb2.DomainDashboardsInfo( | ||
results=list( | ||
map(functools.partial(DomainDashboardInfo, **kwargs), domain_dashboard_vos) | ||
), | ||
def DashboardsInfo(dashboard_vos, total_count, **kwargs): | ||
return dashboard_pb2.DashboardsInfo( | ||
results=list(map(functools.partial(DashboardInfo, **kwargs), dashboard_vos)), | ||
total_count=total_count, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from spaceone.dashboard.manager.dashboard_manager import DashboardManager | ||
from spaceone.dashboard.manager.dashboard_version_manager import DashboardVersionManager | ||
from spaceone.dashboard.manager.identity_manager import IdentityManager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.