mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 00:37:10 +08:00
Add remaining parameter types to docker.api.container logs (#11907)
This commit is contained in:
@@ -1,8 +1,20 @@
|
||||
import datetime
|
||||
from _typeshed import Incomplete
|
||||
from typing import Literal, overload
|
||||
from typing import Literal, TypedDict, overload, type_check_only
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
from docker.types.daemon import CancellableStream
|
||||
|
||||
@type_check_only
|
||||
class _HasId(TypedDict):
|
||||
Id: str
|
||||
|
||||
@type_check_only
|
||||
class _HasID(TypedDict):
|
||||
ID: str
|
||||
|
||||
_Container: TypeAlias = _HasId | _HasID | str
|
||||
|
||||
class ContainerApiMixin:
|
||||
def attach(
|
||||
self, container, stdout: bool = True, stderr: bool = True, stream: bool = False, logs: bool = False, demux: bool = False
|
||||
@@ -72,42 +84,42 @@ class ContainerApiMixin:
|
||||
@overload
|
||||
def logs(
|
||||
self,
|
||||
container,
|
||||
container: _Container,
|
||||
stdout: bool = True,
|
||||
stderr: bool = True,
|
||||
*,
|
||||
stream: Literal[True],
|
||||
timestamps: bool = False,
|
||||
tail: Literal["all"] | int = "all",
|
||||
since: Incomplete | None = None,
|
||||
follow: Incomplete | None = None,
|
||||
until: Incomplete | None = None,
|
||||
since: datetime.datetime | float | None = None,
|
||||
follow: bool | None = None,
|
||||
until: datetime.datetime | float | None = None,
|
||||
) -> CancellableStream: ...
|
||||
@overload
|
||||
def logs(
|
||||
self,
|
||||
container,
|
||||
container: _Container,
|
||||
stdout: bool,
|
||||
stderr: bool,
|
||||
stream: Literal[True],
|
||||
timestamps: bool = False,
|
||||
tail: Literal["all"] | int = "all",
|
||||
since: Incomplete | None = None,
|
||||
follow: Incomplete | None = None,
|
||||
until: Incomplete | None = None,
|
||||
since: datetime.datetime | float | None = None,
|
||||
follow: bool | None = None,
|
||||
until: datetime.datetime | float | None = None,
|
||||
) -> CancellableStream: ...
|
||||
@overload
|
||||
def logs(
|
||||
self,
|
||||
container,
|
||||
container: _Container,
|
||||
stdout: bool = True,
|
||||
stderr: bool = True,
|
||||
stream: Literal[False] = False,
|
||||
timestamps: bool = False,
|
||||
tail: Literal["all"] | int = "all",
|
||||
since: Incomplete | None = None,
|
||||
follow: Incomplete | None = None,
|
||||
until: Incomplete | None = None,
|
||||
since: datetime.datetime | float | None = None,
|
||||
follow: bool | None = None,
|
||||
until: datetime.datetime | float | None = None,
|
||||
) -> bytes: ...
|
||||
def pause(self, container) -> None: ...
|
||||
def port(self, container, private_port): ...
|
||||
|
||||
Reference in New Issue
Block a user