-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmonitoring_service.py
More file actions
38 lines (32 loc) · 1.11 KB
/
monitoring_service.py
File metadata and controls
38 lines (32 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import logging
from spaceone.core.service import *
from cloudforet.monitoring.manager.monitoring_manager import MonitoringManager
_LOGGER = logging.getLogger(__name__)
@authentication_handler
@authorization_handler
@event_handler
class MonitoringService(BaseService):
def __init__(self, metadata):
super().__init__(metadata)
@transaction
@check_required(['options', 'secret_data', 'query', 'start', 'end'])
@change_timestamp_value(['start', 'end'], timestamp_format='iso8601')
def list_logs(self, params):
""" Get quick list of resources
Args:
params (dict) {
'options': 'dict',
'schema': 'str',
'secret_data': 'dict',
'query': 'dict',
'keyword': 'str',
'start': 'timestamp',
'end': 'timestamp',
'sort': 'dict',
'limit': 'int'
}
Returns: list of resources
"""
mon_manager = self.locator.get_manager(MonitoringManager)
for logs in mon_manager.list_logs(params):
yield logs