summaryrefslogtreecommitdiff
path: root/gitlab
diff options
context:
space:
mode:
Diffstat (limited to 'gitlab')
-rw-r--r--gitlab/__init__.py4
-rw-r--r--gitlab/objects.py14
2 files changed, 18 insertions, 0 deletions
diff --git a/gitlab/__init__.py b/gitlab/__init__.py
index 5baa55d..9c93cd1 100644
--- a/gitlab/__init__.py
+++ b/gitlab/__init__.py
@@ -88,6 +88,8 @@ class Gitlab(object):
project_commit_statuses (ProjectCommitStatusManager): Manager for
GitLab projects commits statuses
project_keys (ProjectKeyManager): Manager for GitLab projects keys
+ project_environments (ProjectEnvironmentManager): Manager for GitLab
+ projects environments
project_events (ProjectEventManager): Manager for GitLab projects
events
project_forks (ProjectForkManager): Manager for GitLab projects forks
@@ -165,6 +167,7 @@ class Gitlab(object):
self.project_commit_comments = ProjectCommitCommentManager(self)
self.project_commit_statuses = ProjectCommitStatusManager(self)
self.project_keys = ProjectKeyManager(self)
+ self.project_environments = ProjectEnvironmentManager(self)
self.project_events = ProjectEventManager(self)
self.project_forks = ProjectForkManager(self)
self.project_hooks = ProjectHookManager(self)
@@ -417,6 +420,7 @@ class Gitlab(object):
", ".join(missing))
url = self._construct_url(id_=None, obj=obj_class, parameters=kwargs)
+ print(url)
headers = self._create_headers()
# Remove attributes that are used in url so that there is only
diff --git a/gitlab/objects.py b/gitlab/objects.py
index 76cc219..04f9e47 100644
--- a/gitlab/objects.py
+++ b/gitlab/objects.py
@@ -1075,6 +1075,19 @@ class ProjectCommitManager(BaseManager):
obj_cls = ProjectCommit
+class ProjectEnvironment(GitlabObject):
+ _url = '/projects/%(project_id)s/environments'
+ canGet = 'from_list'
+ requiredUrlAttrs = ['project_id']
+ requiredCreateAttrs = ['name']
+ optionalCreateAttrs = ['external_url']
+ optionalUpdateAttrs = ['name', 'external_url']
+
+
+class ProjectEnvironmentManager(BaseManager):
+ obj_cls = ProjectEnvironment
+
+
class ProjectKey(GitlabObject):
_url = '/projects/%(project_id)s/keys'
canUpdate = False
@@ -1659,6 +1672,7 @@ class Project(GitlabObject):
[('project_id', 'id')]),
('commit_statuses', ProjectCommitStatusManager,
[('project_id', 'id')]),
+ ('environments', ProjectEnvironmentManager, [('project_id', 'id')]),
('events', ProjectEventManager, [('project_id', 'id')]),
('files', ProjectFileManager, [('project_id', 'id')]),
('forks', ProjectForkManager, [('project_id', 'id')]),