pods

Model and Manager for Pod resources.

class Pod(attrs: Mapping[str, Any] | None = None, client: APIClient | None = None, collection: Manager | None = None)[source]

Bases: PodmanResource

Details 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

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() None

Refresh this object’s data from the service.

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 | float | Tuple[float, float] | Tuple[float, 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

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