chore: add compose and service getter
This commit is contained in:
parent
42e68fb4f7
commit
064da8092c
2 changed files with 45 additions and 9 deletions
|
@ -4,7 +4,11 @@ from compose_viz.service import Service
|
|||
|
||||
class Compose:
|
||||
def __init__(self, services: List[Service]) -> None:
|
||||
self.services = services
|
||||
self._services = services
|
||||
|
||||
def extract_networks(self) -> List[str]:
|
||||
raise NotImplementedError
|
||||
|
||||
@property
|
||||
def services(self):
|
||||
return self._services
|
||||
|
|
|
@ -3,11 +3,43 @@ from typing import List
|
|||
|
||||
class Service:
|
||||
def __init__(self, name: str, image: str, ports: List[str] = [], networks: List[str] = [], volumes: List[str] = [], depends_on: List[str] = [], links: List[str] = [], extends: List[str] = []) -> None:
|
||||
self.name = name
|
||||
self.image = image
|
||||
self.ports = ports
|
||||
self.networks = networks
|
||||
self.volumes = volumes
|
||||
self.depends_on = depends_on
|
||||
self.links = links
|
||||
self.extends = extends
|
||||
self._name = name
|
||||
self._image = image
|
||||
self._ports = ports
|
||||
self._networks = networks
|
||||
self._volumes = volumes
|
||||
self._depends_on = depends_on
|
||||
self._links = links
|
||||
self._extends = extends
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return self._name
|
||||
|
||||
@property
|
||||
def image(self):
|
||||
return self._image
|
||||
|
||||
@property
|
||||
def ports(self):
|
||||
return self._ports
|
||||
|
||||
@property
|
||||
def networks(self):
|
||||
return self._networks
|
||||
|
||||
@property
|
||||
def volumes(self):
|
||||
return self._volumes
|
||||
|
||||
@property
|
||||
def depends_on(self):
|
||||
return self._depends_on
|
||||
|
||||
@property
|
||||
def links(self):
|
||||
return self._links
|
||||
|
||||
@property
|
||||
def extends(self):
|
||||
return self._extends
|
||||
|
|
Loading…
Reference in a new issue