18 lines
567 B
Python
18 lines
567 B
Python
from typing import Optional
|
|
|
|
from .sys_mon_agent_api_pb2 import MonitoringStats, MonitoredStorage, MonitoredService
|
|
|
|
def _MonitoringStats_get_storage_by_name(self: MonitoringStats, name: str) -> Optional[MonitoredStorage]:
|
|
for storage in self.storage:
|
|
if storage.name == name:
|
|
return storage
|
|
|
|
return None
|
|
|
|
def _MonitoringStats_get_service_by_name(self: MonitoringStats, name: str) -> Optional[MonitoredService]:
|
|
for service in self.services:
|
|
if service.name == name:
|
|
return service
|
|
|
|
return None
|