Coverage for /usr/local/lib/python3.12/site-packages/prefect/server/schemas/statuses.py: 86%

21 statements  

« prev     ^ index     » next       coverage.py v7.10.6, created at 2025-12-05 11:21 +0000

1from prefect.utilities.collections import AutoEnum 1a

2 

3 

4class WorkPoolStatus(AutoEnum): 1a

5 """Enumeration of work pool statuses.""" 

6 

7 READY = AutoEnum.auto() 1a

8 NOT_READY = AutoEnum.auto() 1a

9 PAUSED = AutoEnum.auto() 1a

10 

11 def in_kebab_case(self) -> str: 1a

12 return self.value.lower().replace("_", "-") 

13 

14 

15class WorkerStatus(AutoEnum): 1a

16 """Enumeration of worker statuses.""" 

17 

18 ONLINE = AutoEnum.auto() 1a

19 OFFLINE = AutoEnum.auto() 1a

20 

21 

22class DeploymentStatus(AutoEnum): 1a

23 """Enumeration of deployment statuses.""" 

24 

25 READY = AutoEnum.auto() 1a

26 NOT_READY = AutoEnum.auto() 1a

27 

28 def in_kebab_case(self) -> str: 1a

29 return self.value.lower().replace("_", "-") 

30 

31 

32class WorkQueueStatus(AutoEnum): 1a

33 """Enumeration of work queue statuses.""" 

34 

35 READY = AutoEnum.auto() 1a

36 NOT_READY = AutoEnum.auto() 1a

37 PAUSED = AutoEnum.auto() 1a

38 

39 def in_kebab_case(self) -> str: 1a

40 return self.value.lower().replace("_", "-")