How to use the podman.libs.pods.Pod function in podman

To help you get started, we’ve selected a few podman examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github containers / python-podman / podman / libs / pods.py View on Github external
labels=None,
               share=None,
               infra=False):
        """Create a new empty pod."""
        config = ConfigDict(
            name=ident,
            cgroupParent=cgroupparent,
            labels=labels,
            share=share,
            infra=infra,
        )

        with self._client() as podman:
            result = podman.CreatePod(config)
            details = podman.GetPod(result['pod'])
        return Pod(self._client, result['pod'], details['pod'])
github containers / python-podman / podman / libs / pods.py View on Github external
def get(self, ident):
        """Get Pod from ident."""
        with self._client() as podman:
            result = podman.GetPod(ident)
        return Pod(self._client, result['pod']['id'], result['pod'])
github containers / python-podman / podman / libs / pods.py View on Github external
def get_by_context(self, all=True, latest=False, args=[]):
        """Get pods ids or names depending on all, latest, or a list of
        pods names"""
        with self._client() as podman:
            results = podman.GetPodsByContext(all, latest, args)
        for pod in results['pods']:
            yield Pod(self._client, pod['id'], pod)
github containers / python-podman / podman / libs / pods.py View on Github external
def list(self):
        """List all pods."""
        with self._client() as podman:
            results = podman.ListPods()
        for pod in results['pods']:
            yield Pod(self._client, pod['id'], pod)