Add doc comments to data interface for manifest labels

This commit is contained in:
Evan Cordell 2017-07-26 14:21:51 -04:00
parent af27a1b6dc
commit c92b566427
2 changed files with 61 additions and 6 deletions

View file

@ -12,7 +12,14 @@ class ManifestLabel(
'source_type_name',
'media_type_name',
])):
"""
ManifestLabel represents a label on a manifest
:type uuid: string
:type key: string
:type value: string
:type source_type_name: string
:type media_type_name: string
"""
def to_dict(self):
return {
'id': self.uuid,
@ -25,18 +32,66 @@ class ManifestLabel(
@add_metaclass(ABCMeta)
class ManifestLabelInterface(object):
"""
Data interface that the manifest labels API uses
"""
@abstractmethod
def get_manifest_labels(self, namespace_name, repository_name, manifestref, filter=None):
pass
"""
Args:
namespace_name: string
repository_name: string
manifestref: string
filter: string
Returns:
list(ManifestLabel) or None
"""
@abstractmethod
def create_manifest_label(self, namespace_name, repository_name, manifestref, key, value, source_type_name, media_type_name):
pass
"""
Args:
namespace_name: string
repository_name: string
manifestref: string
key: string
value: string
source_type_name: string
media_type_name: string
Returns:
ManifestLabel or None
"""
@abstractmethod
def get_manifest_label(self, namespace_name, repository_name, manifestref, label_uuid):
pass
"""
Args:
namespace_name: string
repository_name: string
manifestref: string
label_uuid: string
Returns:
ManifestLabel or None
"""
@abstractmethod
def delete_manifest_label(self, namespace_name, repository_name, manifestref, label_uuid):
pass
"""
Args:
namespace_name: string
repository_name: string
manifestref: string
label_uuid: string
Returns:
ManifestLabel or None
"""

View file

@ -47,4 +47,4 @@ class ManifestLabelPreOCI(ManifestLabelInterface):
media_type_name=label_obj.media_type.name,
)
pre_oci_model = ManifestLabelPreOCI()
pre_oci_model = ManifestLabelPreOCI()