Add types to docker.models.containers.Container.logs (#12044)

This commit is contained in:
Adam Dangoor
2024-05-28 12:55:18 +01:00
committed by GitHub
parent 41cc4f9ede
commit b2f6e5221b

View File

@@ -1,5 +1,6 @@
import datetime
from _typeshed import Incomplete
from typing import Literal, NamedTuple
from typing import Literal, NamedTuple, overload
from docker.types.daemon import CancellableStream
@@ -44,7 +45,32 @@ class Container(Model):
self, path, chunk_size: int | None = 2097152, encode_stream: bool = False
) -> tuple[Incomplete, Incomplete]: ...
def kill(self, signal: Incomplete | None = None): ...
def logs(self, **kwargs) -> CancellableStream | bytes: ...
@overload
def logs(
self,
*,
stdout: bool = True,
stderr: bool = True,
stream: Literal[True],
timestamps: bool = False,
tail: Literal["all"] | int = "all",
since: datetime.datetime | float | None = None,
follow: bool | None = None,
until: datetime.datetime | float | None = None,
) -> CancellableStream: ...
@overload
def logs(
self,
*,
stdout: bool = True,
stderr: bool = True,
stream: Literal[False] = False,
timestamps: bool = False,
tail: Literal["all"] | int = "all",
since: datetime.datetime | float | None = None,
follow: bool | None = None,
until: datetime.datetime | float | None = None,
) -> bytes: ...
def pause(self): ...
def put_archive(self, path: str, data) -> bool: ...
def remove(self, **kwargs) -> None: ...