-
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.
feat: initialize dashboard service using spaceone-core (#1)
Signed-off-by: Seolmin Kwon <seolmin@megazone.com>
- Loading branch information
Showing
40 changed files
with
331 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
*.swp | ||
*.bak | ||
.git | ||
.gitignore | ||
.dockerignore | ||
dist | ||
build | ||
test | ||
*.egg-info | ||
__pycache__ | ||
.idea |
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,10 @@ | ||
### Category | ||
- [ ] New feature | ||
- [ ] Bug fix | ||
- [ ] Improvement | ||
- [ ] Refactor | ||
- [ ] etc | ||
|
||
### Description | ||
|
||
### Known issue |
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,16 @@ | ||
*.swp | ||
*.bak | ||
disk | ||
build | ||
*.egg-info | ||
*.egg | ||
*.whl | ||
*.log | ||
.idea | ||
__pycache__ | ||
venv | ||
local-conf.yml | ||
test/reports | ||
test/_trial_temp | ||
.DS_Store | ||
.venv/ |
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 +1,2 @@ | ||
# dashboard | ||
# dashboard | ||
Core service for Dashboard |
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,4 @@ | ||
spaceone-core | ||
spaceone-api | ||
mongoengine | ||
boto3 |
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 @@ | ||
|
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,39 @@ | ||
# | ||
# Copyright 2020 The SpaceONE Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from setuptools import setup, find_packages | ||
|
||
with open('VERSION', 'r') as f: | ||
VERSION = f.read().strip() | ||
f.close() | ||
|
||
setup( | ||
name='spaceone-dashboard', | ||
version=VERSION, | ||
description='SpaceONE dashboard service', | ||
long_description='', | ||
url='https://www.spaceone.dev/', | ||
author='MEGAZONE SpaceONE Team', | ||
author_email='admin@spaceone.dev', | ||
license='Apache License 2.0', | ||
packages=find_packages(), | ||
install_requires=[ | ||
'spaceone-core', | ||
'spaceone-api', | ||
'mongoengine', | ||
'boto3' | ||
], | ||
zip_safe=False, | ||
) |
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 @@ | ||
__path__ = __import__('pkgutil').extend_path(__path__, __name__) |
Empty file.
Empty file.
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,55 @@ | ||
# Database Settings | ||
DATABASES = { | ||
'default': { | ||
'db': 'dashboard', | ||
'host': 'localhost', | ||
'port': 27017, | ||
'username': '', | ||
'password': '' | ||
} | ||
} | ||
|
||
# Cache Settings | ||
CACHES = { | ||
'default': { | ||
# Redis Example | ||
# 'backend': 'spaceone.core.cache.redis_cache.RedisCache', | ||
# 'host': '<host>', | ||
# 'port': 6379, | ||
# 'db': 0 | ||
} | ||
} | ||
|
||
# Handler Configuration | ||
HANDLERS = { | ||
'authentication': [ | ||
# Default Authentication Handler | ||
# { | ||
# 'backend': 'spaceone.core.handler.authentication_handler.AuthenticationGRPCHandler', | ||
# 'uri': 'grpc://identity:50051/v1/Domain/get_public_key' | ||
# } | ||
], | ||
'authorization': [ | ||
# Default Authorization Handler | ||
# { | ||
# 'backend': 'spaceone.core.handler.authorization_handler.AuthorizationGRPCHandler', | ||
# 'uri': 'grpc://identity:50051/v1/Authorization/verify' | ||
# } | ||
], | ||
'mutation': [], | ||
'event': [] | ||
} | ||
|
||
# Connector Settings | ||
CONNECTORS = { | ||
'SpaceConnector': { | ||
'backend': 'spaceone.core.connector.space_connector.SpaceConnector', | ||
'endpoints': { | ||
'identity': 'grpc://identity:50051', | ||
} | ||
} | ||
} | ||
|
||
# Log Settings | ||
LOG = { | ||
} |
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,5 @@ | ||
PROTO = { | ||
'spaceone.dashboard.interface.grpc.v1.domain_dashboard': ['DomainDashboard'], | ||
'spaceone.dashboard.interface.grpc.v1.project_dashboard': ['ProjectDashboard'], | ||
'spaceone.dashboard.interface.grpc.v1.widget': ['Widget'] | ||
} |
Empty file.
Empty file.
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,4 @@ | ||
from spaceone.dashboard.info.common_info import * | ||
from spaceone.dashboard.info.domain_dashboard_info import * | ||
from spaceone.dashboard.info.project_dashboard_info import * | ||
from spaceone.dashboard.info.widget_info import * |
Empty file.
Empty file.
Empty file.
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) |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
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,3 @@ | ||
from spaceone.dashboard.manager.domain_dashboard_manager import DomainDashboardManager | ||
from spaceone.dashboard.manager.project_dashboard_manager import ProjectDashboardManager | ||
from spaceone.dashboard.manager.widget_manager import WidgetManager |
12 changes: 12 additions & 0 deletions
12
src/spaceone/dashboard/manager/domain_dashboard_manager.py
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 @@ | ||
import logging | ||
from spaceone.core.manager import BaseManager | ||
from spaceone.dashboard.model.domain_dashboard_model import DomainDashboard | ||
|
||
_LOGGER = logging.getLogger(__name__) | ||
|
||
|
||
class DomainDashboardManager(BaseManager): | ||
|
||
def __init__(self, *args, **kwargs): | ||
super().__init__(*args, **kwargs) | ||
self.domain_dashboard_model: DomainDashboard = self.locator.get_model('DomainDashboard') |
12 changes: 12 additions & 0 deletions
12
src/spaceone/dashboard/manager/project_dashboard_manager.py
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 @@ | ||
import logging | ||
from spaceone.core.manager import BaseManager | ||
from spaceone.dashboard.model.project_dashboard_model import ProjectDashboard | ||
|
||
_LOGGER = logging.getLogger(__name__) | ||
|
||
|
||
class ProjectDashboardManager(BaseManager): | ||
|
||
def __init__(self, *args, **kwargs): | ||
super().__init__(*args, **kwargs) | ||
self.project_dashboard_model: ProjectDashboard = self.locator.get_model('ProjectDashboard') |
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 @@ | ||
import logging | ||
from spaceone.core.manager import BaseManager | ||
from spaceone.dashboard.model.widget_model import Widget | ||
|
||
_LOGGER = logging.getLogger(__name__) | ||
|
||
|
||
class WidgetManager(BaseManager): | ||
|
||
def __init__(self, *args, **kwargs): | ||
super().__init__(*args, **kwargs) | ||
self.widget_model: Widget = self.locator.get_model('Widget') |
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,3 @@ | ||
from spaceone.dashboard.model.domain_dashboard_model import DomainDashboard | ||
from spaceone.dashboard.model.project_dashboard_model import ProjectDashboard | ||
from spaceone.dashboard.model.widget_dashboard_model import WidgetDashboard |
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,7 @@ | ||
from mongoengine import StringField, ListField, DictField, DateTimeField | ||
|
||
from spaceone.core.model.mongo_model import MongoModel | ||
|
||
|
||
class DomainDashboard(MongoModel): | ||
pass |
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,7 @@ | ||
from mongoengine import StringField, ListField, DictField, DateTimeField | ||
|
||
from spaceone.core.model.mongo_model import MongoModel | ||
|
||
|
||
class ProjectDashboard(MongoModel): | ||
pass |
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,7 @@ | ||
from mongoengine import StringField, ListField, DictField, DateTimeField | ||
|
||
from spaceone.core.model.mongo_model import MongoModel | ||
|
||
|
||
class WidgetDashboard(MongoModel): | ||
pass |
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,3 @@ | ||
from spaceone.dashboard.service.domain_dashboard_service import DomainDashboardService | ||
from spaceone.dashboard.service.project_dashboard_service import ProjectDashboardService | ||
from spaceone.dashboard.service.widget_service import WidgetService |
35 changes: 35 additions & 0 deletions
35
src/spaceone/dashboard/service/domain_dashboard_service.py
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,35 @@ | ||
import logging | ||
|
||
from spaceone.core.service import * | ||
from spaceone.dashboard.manager import DomainDashboardManager | ||
|
||
_LOGGER = logging.getLogger(__name__) | ||
|
||
|
||
@authentication_handler | ||
@authorization_handler | ||
@mutation_handler | ||
@event_handler | ||
class DomainDashboardService(BaseService): | ||
|
||
def __init__(self, *args, **kwargs): | ||
super().__init__(*args, **kwargs) | ||
self.domain_dashboard_mgr: DomainDashboardManager = self.locator.get_manager('DomainDashboardManager') | ||
|
||
def create(self, params): | ||
pass | ||
|
||
def update(self, params): | ||
pass | ||
|
||
def delete(self, params): | ||
pass | ||
|
||
def get(self, params): | ||
pass | ||
|
||
def list(self, params): | ||
pass | ||
|
||
def stat(self, params): | ||
pass |
35 changes: 35 additions & 0 deletions
35
src/spaceone/dashboard/service/project_dashboard_service.py
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,35 @@ | ||
import logging | ||
|
||
from spaceone.core.service import * | ||
from spaceone.dashboard.manager import ProjectDashboardManager | ||
|
||
_LOGGER = logging.getLogger(__name__) | ||
|
||
|
||
@authentication_handler | ||
@authorization_handler | ||
@mutation_handler | ||
@event_handler | ||
class ProjectDashboardService(BaseService): | ||
|
||
def __init__(self, *args, **kwargs): | ||
super().__init__(*args, **kwargs) | ||
self.project_dashboard_mgr: ProjectDashboardManager = self.locator.get_manager('ProjectDashboardManager') | ||
|
||
def create(self, params): | ||
pass | ||
|
||
def update(self, params): | ||
pass | ||
|
||
def delete(self, params): | ||
pass | ||
|
||
def get(self, params): | ||
pass | ||
|
||
def list(self, params): | ||
pass | ||
|
||
def stat(self, params): | ||
pass |
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,35 @@ | ||
import logging | ||
|
||
from spaceone.core.service import * | ||
from spaceone.dashboard.manager import WidgetManager | ||
|
||
_LOGGER = logging.getLogger(__name__) | ||
|
||
|
||
@authentication_handler | ||
@authorization_handler | ||
@mutation_handler | ||
@event_handler | ||
class WidgetService(BaseService): | ||
|
||
def __init__(self, *args, **kwargs): | ||
super().__init__(*args, **kwargs) | ||
self.widget_mgr: WidgetManager = self.locator.get_manager('WidgetManager') | ||
|
||
def create(self, params): | ||
pass | ||
|
||
def update(self, params): | ||
pass | ||
|
||
def delete(self, params): | ||
pass | ||
|
||
def get(self, params): | ||
pass | ||
|
||
def list(self, params): | ||
pass | ||
|
||
def stat(self, params): | ||
pass |
Empty file.
Empty file.