Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1""" 

2Models for config buckets 

3""" 

4 

5from typing import Optional, Set 

6 

7from pydantic import BaseModel 

8from pydantic.fields import Field 

9from pydantic.types import DirectoryPath 

10 

11 

12class ListConfigBucket(BaseModel): 

13 """Class for obtaining list of files for a config bucket""" 

14 directory_path: DirectoryPath = Field( 

15 ..., title="Directory path for the bucket", 

16 description="This is the path of the directory\ 

17 in which the config file(s) reside" 

18 ) 

19 ignore_patterns: Optional[Set[str]] = Field( 

20 None, title="List of unix-shell style patterns for files to be ignored", 

21 description="Files which match this pattern will be ignored.\ 

22 The expressions in this list should follow glob syntax" 

23 ) 

24 

25 

26class ConfigBucket(BaseModel): 

27 """Class for validating config bucket creation and updation""" 

28 directory_path: DirectoryPath = Field( 

29 None, title="Directory path for the bucket", 

30 description="This is the path of the directory\ 

31 in which the config file(s) reside" 

32 ) 

33 ignore_patterns: Optional[Set[str]] = Field( 

34 None, title="List of unix-shell style patterns for files to be ignored", 

35 description="Files which match this pattern will be ignored.\ 

36 The expressions in this list should follow glob syntax" 

37 ) 

38 update_command: Optional[str] = Field( 

39 None, title="Command to be run to reload the config file(s)" 

40 ) 

41 

42 

43class UpdateCommand(BaseModel): 

44 """Class for update command""" 

45 update_command: str = Field( 

46 ..., title="Command to be run to reload the config file(s)" 

47 )