8000 feat(api): Add instance level service accounts (EE) · python-gitlab/python-gitlab@468fed7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 468fed7

Browse files
author
Rolf Offermanns
committed
feat(api): Add instance level service accounts (EE)
Fixes #2812.
1 parent 22be96c commit 468fed7

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

gitlab/client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ def __init__(
212212
"""See :class:`~gitlab.v4.objects.TopicManager`"""
213213
self.statistics = objects.ApplicationStatisticsManager(self)
214214
"""See :class:`~gitlab.v4.objects.ApplicationStatisticsManager`"""
215+
self.service_accounts = objects.ServiceAccountManager(self)
216+
"""See :class:`~gitlab.v4.objects.ServiceAccountManager`"""
215217

216218
def __enter__(self) -> Gitlab:
217219
return self

gitlab/v4/objects/service_accounts.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,24 @@
22
from gitlab.mixins import CreateMixin, DeleteMixin, ListMixin, ObjectDeleteMixin
33
from gitlab.types import RequiredOptional
44

5-
__all__ = ["GroupServiceAccount", "GroupServiceAccountManager"]
5+
__all__ = [
6+
"ServiceAccount",
7+
"ServiceAccountManager",
8+
"GroupServiceAccount",
9+
"GroupServiceAccountManager",
10+
]
11+
12+
13+
class ServiceAccount(RESTObject):
14+
pass
15+
16+
17+
class ServiceAccountManager(CreateMixin, ListMixin, RESTManager):
18+
_path = "/service_accounts"
19+
_obj_cls = ServiceAccount
20+
_create_attrs = RequiredOptional(
21+
optional=("name", "username", "email"),
22+
)
623

724

825
class GroupServiceAccount(ObjectDeleteMixin, RESTObject):

0 commit comments

Comments
 (0)
0