feat: create device model
This commit is contained in:
parent
edf56997bf
commit
321e687049
2 changed files with 19 additions and 1 deletions
18
compose_viz/models/device.py
Normal file
18
compose_viz/models/device.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
|
||||
class Device:
|
||||
def __init__(self, host_path: str, container_path: str, cgroup_permissions: str = None):
|
||||
self._host_path = host_path
|
||||
self._container_path = container_path
|
||||
self._cgroup_permissions = cgroup_permissions
|
||||
|
||||
@property
|
||||
def host_path(self):
|
||||
return self._host_path
|
||||
|
||||
@property
|
||||
def container_path(self):
|
||||
return self._container_path
|
||||
|
||||
@property
|
||||
def cgroup_permissions(self):
|
||||
return self._cgroup_permissions
|
|
@ -19,7 +19,7 @@ class Service:
|
|||
extends: Optional[Extends] = None,
|
||||
cgroup_parent: Optional[str] = None,
|
||||
container_name: Optional[str] = None,
|
||||
devices: Optional[Device] = None,
|
||||
devices: Optional[Device] = [],
|
||||
env_file: List[str] = [],
|
||||
expose: List[str] = [],
|
||||
profiles: List[str] = [],
|
||||
|
|
Loading…
Reference in a new issue