summaryrefslogtreecommitdiff
path: root/gitlab/v4/objects
diff options
context:
space:
mode:
authorNejc Habjan <nejc.habjan@siemens.com>2022-07-20 16:02:52 +0200
committerJohn Villalovos <john@sodarock.com>2022-07-20 07:41:38 -0700
commit284d73950ad5cf5dfbdec2f91152ed13931bd0ee (patch)
treef9cbbad79d5046fc88e336a322bed7f7902be0f8 /gitlab/v4/objects
parent70148c62a3aba16dd8a9c29f15ed16e77c01a247 (diff)
downloadgitlab-284d73950ad5cf5dfbdec2f91152ed13931bd0ee.tar.gz
feat(api): add support for instance-level registry repositories
Diffstat (limited to 'gitlab/v4/objects')
-rw-r--r--gitlab/v4/objects/container_registry.py24
1 files changed, 23 insertions, 1 deletions
diff --git a/gitlab/v4/objects/container_registry.py b/gitlab/v4/objects/container_registry.py
index d9b88bc..5d1c78e 100644
--- a/gitlab/v4/objects/container_registry.py
+++ b/gitlab/v4/objects/container_registry.py
@@ -3,7 +3,13 @@ from typing import Any, cast, TYPE_CHECKING, Union
from gitlab import cli
from gitlab import exceptions as exc
from gitlab.base import RESTManager, RESTObject
-from gitlab.mixins import DeleteMixin, ListMixin, ObjectDeleteMixin, RetrieveMixin
+from gitlab.mixins import (
+ DeleteMixin,
+ GetMixin,
+ ListMixin,
+ ObjectDeleteMixin,
+ RetrieveMixin,
+)
__all__ = [
"GroupRegistryRepositoryManager",
@@ -11,6 +17,8 @@ __all__ = [
"ProjectRegistryRepositoryManager",
"ProjectRegistryTag",
"ProjectRegistryTagManager",
+ "RegistryRepository",
+ "RegistryRepositoryManager",
]
@@ -72,3 +80,17 @@ class GroupRegistryRepositoryManager(ListMixin, RESTManager):
_path = "/groups/{group_id}/registry/repositories"
_obj_cls = ProjectRegistryRepository
_from_parent_attrs = {"group_id": "id"}
+
+
+class RegistryRepository(RESTObject):
+ _repr_attr = "path"
+
+
+class RegistryRepositoryManager(GetMixin, RESTManager):
+ _path = "/registry/repositories"
+ _obj_cls = RegistryRepository
+
+ def get(
+ self, id: Union[str, int], lazy: bool = False, **kwargs: Any
+ ) -> RegistryRepository:
+ return cast(RegistryRepository, super().get(id=id, lazy=lazy, **kwargs))