Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions stubs/docker/docker/context/context.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from collections.abc import Mapping
from typing import Any, TypedDict, type_check_only
from typing import TypedDict, type_check_only

from docker.tls import TLSConfig as _TLSConfig

@type_check_only
class _StorageData(TypedDict):
Expand All @@ -14,9 +15,10 @@ class _Storage(TypedDict):
class _Endpoint(TypedDict, total=False):
Host: str
SkipTLSVerify: bool
DefaultNamespace: str

@type_check_only
class _TLSMaterial:
class _TLSMaterial(TypedDict):
TLSMaterial: dict[str, list[str]]

@type_check_only
Expand All @@ -27,38 +29,41 @@ class _MetaMetaData(TypedDict, total=False):
class _Metadata(TypedDict):
Name: str
Metadata: _MetaMetaData
Endpoints: Mapping[str, _Endpoint]
Endpoints: dict[str, _Endpoint]

@type_check_only
class _Context(_Metadata, _TLSMaterial, _Storage): ...

class Context:
name: str
context_type: str | None
orchestrator: str | None
endpoints: dict[str, _Endpoint]
tls_cfg: dict[str, Any]
tls_cfg: dict[str, _TLSConfig]
meta_path: str
tls_path: str
def __init__(
self,
name: str,
orchestrator: str | None = None,
host: str | None = None,
endpoints: Mapping[str, _Endpoint] | None = None,
endpoints: dict[str, _Endpoint] | None = None,
tls: bool = False,
) -> None: ...
def set_endpoint(
self,
name: str = "docker",
host: str | None = None,
tls_cfg: Mapping[str, Any] | None = None,
tls_cfg: _TLSConfig | None = None,
skip_tls_verify: bool = False,
def_namespace: str | None = None,
) -> None: ...
def inspect(self) -> Mapping[str, Any]: ...
def inspect(self) -> _Context: ...
@classmethod
def load_context(cls, name: str) -> Context | None: ...
def save(self) -> None: ...
def remove(self) -> None: ...
def __call__(self) -> Mapping[str, Any]: ...
def __call__(self) -> _Context: ...
def is_docker_host(self) -> bool: ...
@property
def Name(self) -> str: ...
Expand All @@ -69,7 +74,7 @@ class Context:
@property
def Metadata(self) -> _Metadata: ...
@property
def TLSConfig(self) -> Any: ...
def TLSConfig(self) -> _TLSConfig: ...
@property
def TLSMaterial(self) -> _TLSMaterial: ...
@property
Expand Down