diff options
author | Joffrey F <joffrey@docker.com> | 2018-03-26 19:01:50 -0700 |
---|---|---|
committer | Joffrey F <joffrey@docker.com> | 2018-03-26 19:08:55 -0700 |
commit | e21174721f47e1cb6d591983daf85c3749fe5f4a (patch) | |
tree | c279a72bb642d89b03d8661b0575429c9d99eb30 /docker/api/image.py | |
parent | 12a6833eba4f64be1386d3da0d605156319c5946 (diff) | |
download | docker-py-distribution_inspect.tar.gz |
Add methods for /distribution/<name>/json endpointdistribution_inspect
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'docker/api/image.py')
-rw-r--r-- | docker/api/image.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/docker/api/image.py b/docker/api/image.py index 3ebca32..5f05d88 100644 --- a/docker/api/image.py +++ b/docker/api/image.py @@ -245,6 +245,27 @@ class ImageApiMixin(object): self._get(self._url("/images/{0}/json", image)), True ) + @utils.minimum_version('1.30') + @utils.check_resource('image') + def inspect_distribution(self, image): + """ + Get image digest and platform information by contacting the registry. + + Args: + image (str): The image name to inspect + + Returns: + (dict): A dict containing distribution data + + Raises: + :py:class:`docker.errors.APIError` + If the server returns an error. + """ + + return self._result( + self._get(self._url("/distribution/{0}/json", image)), True + ) + def load_image(self, data, quiet=None): """ Load an image that was previously saved using |