kubex.core¶
Auto-generated reference for the kubex.core module.
Exceptions¶
kubex.core.exceptions ¶
Request and response¶
kubex.core.request ¶
kubex.core.response ¶
API parameters¶
kubex.core.params ¶
AttachOptions ¶
AttachOptions(
*,
container: str | None = None,
stdin: bool = False,
stdout: bool = True,
stderr: bool = True,
tty: bool = False,
)
Options for the Pod attach subresource. Mirrors v1.PodAttachOptions.
Source code in kubex/core/params.py
ExecOptions ¶
ExecOptions(
*,
command: Sequence[str],
container: str | None = None,
stdin: bool = False,
stdout: bool = True,
stderr: bool = True,
tty: bool = False,
)
Options for the Pod exec subresource.
Mirrors the v1.PodExecOptions Kubernetes API. command is required
and must be a non-empty sequence of strings — each element serializes as a
separate command= query parameter. Boolean flags serialize as the
lowercase strings "true" / "false" to match what the Kubernetes API
server expects.
Source code in kubex/core/params.py
PortForwardOptions ¶
Options for the Pod portforward subresource.
Validates that ports are unique, non-empty, and within 1..65535.
to_query_params() returns repeated ("ports", "<n>") pairs in input order.
Source code in kubex/core/params.py
Timeout ¶
Timeout(
total: float | None = None,
*,
connect: float | None = None,
read: float | None = None,
write: float | None = None,
pool: float | None = None,
)
Timeout settings for HTTP requests.
Provides a client-agnostic way to configure timeout settings for the underlying HTTP client. Individual fields may be ignored by a given implementation if the client library does not support them.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
total
|
float | None
|
Total timeout in seconds for the whole request. Used as the default for unset granular fields. |
None
|
connect
|
float | None
|
Timeout in seconds for establishing a connection. |
None
|
read
|
float | None
|
Timeout in seconds for reading the response. |
None
|
write
|
float | None
|
Timeout in seconds for writing the request body. Only honored by the httpx backend. |
None
|
pool
|
float | None
|
Timeout in seconds for acquiring a connection from the pool. Only honored by the httpx backend. |
None
|
Source code in kubex/core/params.py
coerce
classmethod
¶
Normalize a TimeoutTypes value to Timeout or None.
Source code in kubex/core/params.py
Patch types¶
kubex.core.patch ¶
JsonPatch ¶
Bases: RootModel[list[JsonPatchOperation]]
RFC 6902 JSON Patch document.
Can be constructed directly or built incrementally via chaining::
patch = JsonPatch().add("/a", 1).remove("/b").replace("/c", "new")
JsonPointer ¶
Bases: str
RFC 6901 JSON Pointer.
A JSON Pointer is either the empty string (referencing the whole document)
or a sequence of reference tokens each prefixed by /.
Construct from a raw string, from individual tokens, or by chaining
the / operator::
ptr = JsonPointer("/foo/0")
ptr = JsonPointer.from_tokens("foo", 0)
ptr = JsonPointer() / "foo" / 0
from_tokens
classmethod
¶
Build a pointer from unescaped reference tokens.
Tokens are escaped per RFC 6901 (~ -> ~0, / -> ~1).
Source code in kubex/core/json_pointer.py
JSON Patch (RFC 6902)¶
kubex.core.json_patch ¶
JsonPatch ¶
Bases: RootModel[list[JsonPatchOperation]]
RFC 6902 JSON Patch document.
Can be constructed directly or built incrementally via chaining::
patch = JsonPatch().add("/a", 1).remove("/b").replace("/c", "new")
JSON Pointer (RFC 6901)¶
kubex.core.json_pointer ¶
JsonPointer ¶
Bases: str
RFC 6901 JSON Pointer.
A JSON Pointer is either the empty string (referencing the whole document)
or a sequence of reference tokens each prefixed by /.
Construct from a raw string, from individual tokens, or by chaining
the / operator::
ptr = JsonPointer("/foo/0")
ptr = JsonPointer.from_tokens("foo", 0)
ptr = JsonPointer() / "foo" / 0
from_tokens
classmethod
¶
Build a pointer from unescaped reference tokens.
Tokens are escaped per RFC 6901 (~ -> ~0, / -> ~1).