| 123456789101112131415161718192021222324252627282930313233 |
- from abc import ABC, abstractmethod
- from typing import Optional
- from client.FeiShuClient import FeiShuService
- from resource.enums.resource import Resource
- class BasicMonitor(ABC):
- resource: Optional[Resource] = None
- _monitors = []
- def __init__(self):
- self.access_key_id = "LTAI5tRwjztCCwQNBB6nW1dY"
- self.access_key_secret = "NaTnMxrGEJh64tLly7Kb5tr166Xpos"
- self.fei_shu_spread_sheet_token = "XzQGsheQzhk74rtknKacClASnTc"
- self.fei_shu_service = FeiShuService()
- def __init_subclass__(cls, **kwargs):
- super().__init_subclass__(**kwargs)
- if cls != BasicMonitor:
- cls._monitors.append(cls)
- @classmethod
- def get_monitors(cls):
- return cls._monitors
- def fei_shu_tenant_access_token(self, app_id: str = "cli_a89702999f3c900b", app_secret: str = "47ewnaxRqJAvHYdUR8idHgfzfeqAu0Pz") -> str:
- tenant_access_token = self.fei_shu_service.get_tenant_access_token(app_id, app_secret)
- return tenant_access_token
- @abstractmethod
- def run(self):
- raise NotImplementedError("该方法没有被实现")
|