From e21174721f47e1cb6d591983daf85c3749fe5f4a Mon Sep 17 00:00:00 2001 From: Joffrey F Date: Mon, 26 Mar 2018 19:01:50 -0700 Subject: Add methods for /distribution//json endpoint Signed-off-by: Joffrey F --- docker/api/image.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'docker/api/image.py') 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 -- cgit v1.2.1