[docker] Add a number of types to docker.models.containers.Container (#12077)

This commit is contained in:
Adam Dangoor
2024-06-16 11:05:42 +01:00
committed by GitHub
parent 77ef4d639e
commit 1af9de664f
3 changed files with 25 additions and 8 deletions

View File

@@ -8,3 +8,6 @@ docker.transport.sshconn
# model is always set by child classes
docker.models.resource.Collection.model
# keyword arguments are now unsupported
docker.api.container.ContainerApiMixin.start

View File

@@ -154,10 +154,10 @@ class ContainerApiMixin:
def rename(self, container: _Container, name: str) -> None: ...
def resize(self, container: _Container, height: int, width: int) -> None: ...
def restart(self, container: _Container, timeout: int = 10) -> None: ...
def start(self, container: _Container, *args, **kwargs) -> None: ...
def start(self, container: _Container) -> None: ...
def stats(self, container: _Container, decode: bool | None = None, stream: bool = True, one_shot: bool | None = None): ...
def stop(self, container: _Container, timeout: int | None = None) -> None: ...
def top(self, container: _Container, ps_args: str | None = None): ...
def top(self, container: _Container, ps_args: str | None = None) -> str: ...
def unpause(self, container: _Container) -> None: ...
def update_container(
self,

View File

@@ -71,18 +71,32 @@ class Container(Model):
follow: bool | None = None,
until: datetime.datetime | float | None = None,
) -> bytes: ...
def pause(self): ...
def pause(self) -> None: ...
def put_archive(self, path: str, data) -> bool: ...
def remove(self, **kwargs) -> None: ...
def remove(self, *, v: bool = False, link: bool = False, force: bool = False) -> None: ...
def rename(self, name: str): ...
def resize(self, height: int, width: int): ...
def restart(self, **kwargs): ...
def start(self, **kwargs) -> None: ...
def restart(self, *, timeout: float | None = 10): ...
def start(self) -> None: ...
def stats(self, **kwargs): ...
def stop(self, *, timeout: float | None = None) -> None: ...
def top(self, **kwargs): ...
def top(self, *, ps_args: str | None = None) -> str: ...
def unpause(self): ...
def update(self, **kwargs): ...
def update(
self,
*,
blkio_weight: int | None = None,
cpu_period: int | None = None,
cpu_quota: int | None = None,
cpu_shares: int | None = None,
cpuset_cpus: str | None = None,
cpuset_mems: str | None = None,
mem_limit: float | str | None = None,
mem_reservation: float | str | None = None,
memswap_limit: int | str | None = None,
kernel_memory: int | str | None = None,
restart_policy: Incomplete | None = None,
): ...
def wait(self, *, timeout: float | None = None, condition: Literal["not-running", "next-exit", "removed"] | None = None): ...
class ContainerCollection(Collection[Container]):