Skip to content

Commit

Permalink
Add a number of types to docker.models.containers (#11912)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamtheturtle authored May 14, 2024
1 parent b859441 commit a9d7e86
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions stubs/docker/docker/models/containers.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ from .resource import Collection, Model

class Container(Model):
@property
def name(self): ...
def name(self) -> str | None: ...
@property
def image(self): ...
def image(self) -> Image | None: ...
@property
def labels(self): ...
@property
def status(self): ...
def status(self) -> str: ...
@property
def health(self): ...
def health(self) -> str: ...
@property
def ports(self): ...
def ports(self) -> dict[Incomplete, Incomplete]: ...
def attach(self, **kwargs): ...
def attach_socket(self, **kwargs): ...
def commit(self, repository: str | None = None, tag: str | None = None, **kwargs): ...
Expand All @@ -38,16 +38,18 @@ class Container(Model):
environment: Incomplete | None = None,
workdir: Incomplete | None = None,
demux: bool = False,
): ...
def export(self, chunk_size=2097152): ...
def get_archive(self, path, chunk_size=2097152, encode_stream: bool = False): ...
) -> ExecResult: ...
def export(self, chunk_size: int | None = 2097152) -> str: ...
def get_archive(
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: ...
def pause(self): ...
def put_archive(self, path, data): ...
def put_archive(self, path: str, data) -> bool: ...
def remove(self, **kwargs) -> None: ...
def rename(self, name): ...
def resize(self, height, width): ...
def rename(self, name: str): ...
def resize(self, height: int, width: int): ...
def restart(self, **kwargs): ...
def start(self, **kwargs) -> None: ...
def stats(self, **kwargs): ...
Expand All @@ -68,22 +70,22 @@ class ContainerCollection(Collection[Container]):
remove: bool = False,
**kwargs,
): ...
def create(self, image: str, command: str | list[str] | None = None, **kwargs): ... # type:ignore[override]
def get(self, container_id: str): ...
def create(self, image: str, command: str | list[str] | None = None, **kwargs) -> Container: ... # type:ignore[override]
def get(self, container_id: str) -> Container: ...
def list(
self,
all: bool = False,
before: Incomplete | None = None,
before: str | None = None,
filters: Incomplete | None = None,
limit: int = -1,
since: Incomplete | None = None,
since: str | None = None,
sparse: bool = False,
ignore_removed: bool = False,
): ...
def prune(self, filters: Incomplete | None = None): ...

RUN_CREATE_KWARGS: Incomplete
RUN_HOST_CONFIG_KWARGS: Incomplete
RUN_CREATE_KWARGS: list[str]
RUN_HOST_CONFIG_KWARGS: list[str]

class ExecResult(NamedTuple):
exit_code: Incomplete
Expand Down

0 comments on commit a9d7e86

Please sign in to comment.