2022-05-21 11:41:26 +02:00
|
|
|
from enum import Enum
|
|
|
|
|
|
|
|
|
|
|
|
class VolumeType(str, Enum):
|
|
|
|
volume = "volume"
|
|
|
|
bind = "bind"
|
|
|
|
tmpfs = "tmpfs"
|
2022-05-22 06:34:18 +02:00
|
|
|
npipe = "npipe"
|
|
|
|
|
|
|
|
|
|
|
|
class AccessMode(str, Enum):
|
|
|
|
rw = "rw"
|
|
|
|
ro = "ro"
|
|
|
|
z = "z"
|
|
|
|
Z = "Z"
|
2022-05-21 11:41:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
class Volume:
|
2022-05-22 06:34:18 +02:00
|
|
|
def __init__(
|
|
|
|
self, source: str, target: str, type: VolumeType = VolumeType.volume, access_mode: AccessMode = AccessMode.rw
|
|
|
|
):
|
2022-05-21 11:41:26 +02:00
|
|
|
self._source = source
|
|
|
|
self._target = target
|
|
|
|
self._type = type
|
2022-05-22 06:34:18 +02:00
|
|
|
self._access_mode = access_mode
|
2022-05-21 11:41:26 +02:00
|
|
|
|
|
|
|
@property
|
|
|
|
def source(self):
|
|
|
|
return self._source
|
|
|
|
|
|
|
|
@property
|
|
|
|
def target(self):
|
|
|
|
return self._target
|
|
|
|
|
|
|
|
@property
|
|
|
|
def type(self):
|
|
|
|
return self._type
|
2022-05-22 06:34:18 +02:00
|
|
|
|
|
|
|
@property
|
|
|
|
def access_mode(self):
|
|
|
|
return self._access_mode
|