Skip to content

Commit 284d739

Browse files
nejchJohnVillalovos
authored andcommitted
feat(api): add support for instance-level registry repositories
1 parent 70148c6 commit 284d739

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

gitlab/client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ def __init__(
160160
"""See :class:`~gitlab.v4.objects.NotificationSettingsManager`"""
161161
self.projects = objects.ProjectManager(self)
162162
"""See :class:`~gitlab.v4.objects.ProjectManager`"""
163+
self.registry_repositories = objects.RegistryRepositoryManager(self)
164+
"""See :class:`~gitlab.v4.objects.RegistryRepositoryManager`"""
163165
self.runners = objects.RunnerManager(self)
164166
"""See :class:`~gitlab.v4.objects.RunnerManager`"""
165167
self.settings = objects.ApplicationSettingsManager(self)

gitlab/v4/objects/container_registry.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,22 @@
33
from gitlab import cli
44
from gitlab import exceptions as exc
55
from gitlab.base import RESTManager, RESTObject
6-
from gitlab.mixins import DeleteMixin, ListMixin, ObjectDeleteMixin, RetrieveMixin
6+
from gitlab.mixins import (
7+
DeleteMixin,
8+
GetMixin,
9+
ListMixin,
10+
ObjectDeleteMixin,
11+
RetrieveMixin,
12+
)
713

814
__all__ = [
915
"GroupRegistryRepositoryManager",
1016
"ProjectRegistryRepository",
1117
"ProjectRegistryRepositoryManager",
1218
"ProjectRegistryTag",
1319
"ProjectRegistryTagManager",
20+
"RegistryRepository",
21+
"RegistryRepositoryManager",
1422
]
1523

1624

@@ -72,3 +80,17 @@ class GroupRegistryRepositoryManager(ListMixin, RESTManager):
7280
_path = "/groups/{group_id}/registry/repositories"
7381
_obj_cls = ProjectRegistryRepository
7482
_from_parent_attrs = {"group_id": "id"}
83+
84+
85+
class RegistryRepository(RESTObject):
86+
_repr_attr = "path"
87+
88+
89+
class RegistryRepositoryManager(GetMixin, RESTManager):
90+
_path = "/registry/repositories"
91+
_obj_cls = RegistryRepository
92+
93+
def get(
94+
self, id: Union[str, int], lazy: bool = False, **kwargs: Any
95+
) -> RegistryRepository:
96+
return cast(RegistryRepository, super().get(id=id, lazy=lazy, **kwargs))

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy