This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/endpoints/api/manifest_models_interface.py
2017-07-31 15:45:52 -04:00

42 lines
1 KiB
Python

from abc import ABCMeta, abstractmethod
from collections import namedtuple
from six import add_metaclass
class ManifestLabel(
namedtuple('ManifestLabel', [
'uuid',
'key',
'value',
'source_type_name',
'media_type_name',
])):
def to_dict(self):
return {
'id': self.uuid,
'key': self.key,
'value': self.value,
'source_type': self.source_type_name,
'media_type': self.media_type_name,
}
@add_metaclass(ABCMeta)
class ManifestLabelInterface(object):
@abstractmethod
def get_manifest_labels(self, namespace_name, repository_name, manifestref, filter=None):
pass
@abstractmethod
def create_manifest_label(self, namespace_name, repository_name, manifestref, key, value, source_type_name, media_type_name):
pass
@abstractmethod
def get_manifest_label(self, namespace_name, repository_name, manifestref, label_uuid):
pass
@abstractmethod
def delete_manifest_label(self, namespace_name, repository_name, manifestref, label_uuid):
pass