manager

Base classes for PodmanResources and Manager’s.

class Manager(client: APIClient | None = None, podman_client: PodmanClient | None = None)[source]

Bases: ABC

Base class for representing a Manager of resources for a Podman service.

Initialize Manager() object.

Parameters:
  • client – APIClient() configured to connect to Podman service.

  • podman_client – PodmanClient() configured to connect to Podman object.

abstractmethod exists(key: str) bool[source]

Returns True if resource exists.

Podman only.

Notes

This method does _not_ provide any mutex mechanism.

abstractmethod get(key: str) PodmanResourceType[source]

Returns representation of resource.

abstractmethod list(**kwargs) list[PodmanResourceType][source]

Returns list of resources.

prepare_model(attrs: PodmanResource | Mapping[str, Any]) PodmanResourceType[source]

Create a model from a set of attributes.

abstract property resource

Class which the factory method prepare_model() will use.

Type:

Type[PodmanResource]

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

Bases: ABC

Base class for representing resource of a Podman service.

attrs

Mapping of attributes for resource from 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.

reload(**kwargs) None[source]

Refresh this object’s data from the service.

Keyword Arguments:

compatible (bool) – Use Docker compatibility endpoint

property id

Returns the identifier for the object.

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