(self, imagerepo, tags_only=False)
Get list of tags in a repo from Docker Hub
Get list of tags in a repo from Docker Hub
Get list of tags in a repo from Docker Hub
def get_v1_image_tags(self, imagerepo, tags_only=False):
        """Get list of tags in a repo from Docker Hub"""
        (hdr_data, dummy) = self.get_v1_repo(imagerepo)
        try:
            endpoint = "http://" + hdr_data["x-docker-endpoints"]
        except KeyError:
            endpoint = self.index_url
        url = endpoint + "/v1/repositories/" + imagerepo + "/tags"
        Msg().out("Info: tags url", url, l=Msg.DBG)
        (dummy, buf) = self._get_url(url)
        tags = []
        try:
            if tags_only:
                for tag in json.loads(buf.getvalue()):
                    tags.append(tag["name"])
                return tags

            return json.loads(buf.getvalue())
        except (IOError, OSError, AttributeError, ValueError, TypeError):
            return []
def get_v1_image_tags ( self , imagerepo , tags_only = False ) : ( hdr_data , dummy ) = self . get_v1_repo ( imagerepo ) try : endpoint = "http://" + hdr_data [ "x-docker-endpoints" ] except KeyError : endpoint = self . index_url url = endpoint + "/v1/repositories/" + imagerepo + "/tags" Msg ( ) . out ( "Info: tags url" , url , l = Msg . DBG ) ( dummy , buf ) = self . _get_url ( url ) tags = [ ] try : if tags_only : for tag in json . loads ( buf . getvalue ( ) ) : tags . append ( tag [ "name" ] ) return tags return json . loads ( buf . getvalue ( ) ) except ( IOError , OSError , AttributeError , ValueError , TypeError ) : return [ ]