pods¶
Model and Manager for Pod resources.
- class Pod(attrs: Mapping[str, Any] | None = None, client: APIClient | None = None, collection: Manager | None = None, podman_client: PodmanClient | None = None)[source]¶
Bases:
PodmanResourceDetails and configuration for a pod managed by the Podman service.
Initialize base class for PodmanResource’s.
- Parameters:
attrs – Mapping of attributes for resource from Podman service.
client – Configured connection to a Podman service.
collection – Manager of this category of resource, named collection for compatibility
podman_client – PodmanClient() configured to connect to Podman object.
- kill(signal: str | int | None = None) None[source]¶
Send signal to pod.
- Parameters:
signal – To be sent to pod.
- Raises:
NotFound – when pod not found
APIError – when service reports an error
- pause() None[source]¶
Pause pod.
- Raises:
NotFound – when pod not found
APIError – when service reports an error
- reload(**kwargs) None¶
Refresh this object’s data from the service.
- Keyword Arguments:
compatible (bool) – Use Docker compatibility endpoint
- remove(force: bool | None = None) None[source]¶
Delete pod.
- Parameters:
force – When True, stop and delete all containers in pod before deleting pod.
- Raises:
NotFound – when pod not found
APIError – when service reports an error
- restart() None[source]¶
Restart pod.
- Raises:
NotFound – when pod not found
APIError – when service reports an error
- start() None[source]¶
Start pod.
- Raises:
NotFound – when pod not found
APIError – when service reports an error
- stop(timeout: None | int | tuple[int, int] | tuple[int, None] = None) None[source]¶
Stop pod.
- Raises:
NotFound – when pod not found
APIError – when service reports an error
- top(**kwargs) dict[str, Any][source]¶
Report on running processes in pod.
- Keyword Arguments:
ps_args (str) – Optional arguments passed to ps.
- Raises:
NotFound – when pod not found
APIError – when service reports an error
- unpause() None[source]¶
Unpause pod.
- Raises:
NotFound – when pod not found
APIError – when service reports an error
- property id¶
Returns the identifier for the object.
- Type:
str
- manager: PodsManager¶
- property name¶
Returns name of pod.
- Type:
str
- property short_id¶
Returns truncated identifier. ‘sha256’ preserved when included in the id.
No attempt is made to ensure the returned value is semantically meaningful for all resources.
- Type:
str