from abc import ABCMeta, abstractproperty from six import add_metaclass @add_metaclass(ABCMeta) class ManifestInterface(object): """ Defines the interface for the various manifests types supported. """ @abstractproperty def digest(self): """ The digest of the manifest, including type prefix. """ pass @abstractproperty def media_type(self): """ The media type of the schema. """ pass @abstractproperty def manifest_dict(self): """ Returns the manifest as a dictionary ready to be serialized to JSON. """ pass @abstractproperty def bytes(self): """ Returns the bytes of the manifest. """ pass @abstractproperty def layers(self): """ Returns the layers of this manifest, from base to leaf. """ pass @abstractproperty def leaf_layer_v1_image_id(self): """ Returns the Docker V1 image ID for the leaf (top) layer, if any, or None if none. """ pass @abstractproperty def blob_digests(self): """ Returns an iterator over all the blob digests referenced by this manifest, from base to leaf. The blob digests are strings with prefixes. """