21 lines
505 B
Python
21 lines
505 B
Python
from abc import ABC, abstractmethod
|
|
from typing import Optional
|
|
|
|
from core.domain.worker.Worker import Worker
|
|
from core.domain.worker.WorkerStatus import WorkerStatus
|
|
from core.types.Id import Id
|
|
|
|
|
|
class WorkerStatusRepo(ABC):
|
|
@abstractmethod
|
|
def getAll(self) -> list[WorkerStatus]:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get(self, id: Id[WorkerStatus]) -> Optional[WorkerStatus]:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def post(self, workerId: Id[Worker], ramAvailable: float, cpuUtilization: float) -> WorkerStatus:
|
|
pass
|