diff options
author | baude <bbaude@redhat.com> | 2018-06-22 08:15:37 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-06-27 04:52:22 +0000 |
commit | 60427ab3d26bbe5a5ab00c4e7b550f111b4f72e5 (patch) | |
tree | 64f11dab9bcdc426956160b6b56ee536bb3aa6e8 /contrib/python/cmd/pman.py | |
parent | 56133f7263337e9b2c9cfb1cfce35adc2366f52b (diff) | |
download | podman-60427ab3d26bbe5a5ab00c4e7b550f111b4f72e5.tar.gz podman-60427ab3d26bbe5a5ab00c4e7b550f111b4f72e5.tar.bz2 podman-60427ab3d26bbe5a5ab00c4e7b550f111b4f72e5.zip |
add podman remote client
podman client that is capable of:
* images
* ps
* rm
* rmi
this is only a mockup to frame out and prove python library and ssh
tunnelling usage.
Signed-off-by: baude <bbaude@redhat.com>
Closes: #986
Approved by: rhatdan
Diffstat (limited to 'contrib/python/cmd/pman.py')
-rw-r--r-- | contrib/python/cmd/pman.py | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/contrib/python/cmd/pman.py b/contrib/python/cmd/pman.py new file mode 100644 index 000000000..c75c3d174 --- /dev/null +++ b/contrib/python/cmd/pman.py @@ -0,0 +1,42 @@ +import podman as p + + +class PodmanRemote(object): + def __init__(self): + self.args = None + self._remote_uri= None + self._local_uri= None + self._identity_file= None + self._client = None + + def set_args(self, args, local_uri, remote_uri, identity_file): + self.args = args + self._local_uri = local_uri + self.remote_uri = remote_uri + self._identity_file = identity_file + + @property + def remote_uri(self): + return self._remote_uri + + @property + def local_uri(self): + return self._local_uri + + @property + def client(self): + if self._client is None: + self._client = p.Client(uri=self.local_uri, remote_uri=self.remote_uri, identity_file=self.identity_file) + return self._client + + @remote_uri.setter + def remote_uri(self, uri): + self._remote_uri = uri + + @local_uri.setter + def local_uri(self, uri): + self._local_uri= uri + + @property + def identity_file(self): + return self._identity_file |