Skip to content

Commit

Permalink
[v4] Update triggers endpoint and attrs
Browse files Browse the repository at this point in the history
  • Loading branch information
Gauvain Pocentek committed May 23, 2017
1 parent 449f607 commit 0c3fe39
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gitlab/v4/objects.py
Expand Up @@ -1619,7 +1619,7 @@ class ProjectTrigger(GitlabObject):
_url = '/projects/%(project_id)s/triggers'
canUpdate = False
idAttr = 'token'
requiredUrlAttrs = ['project_id']
requiredUrlAttrs = ['project_id', 'description']


class ProjectTriggerManager(BaseManager):
Expand Down Expand Up @@ -2087,7 +2087,7 @@ def share(self, group_id, group_access, **kwargs):
r = self.gitlab._raw_post(url, data=data, **kwargs)
raise_error_from_response(r, GitlabCreateError, 201)

def trigger_build(self, ref, token, variables={}, **kwargs):
def trigger_pipeline(self, ref, token, variables={}, **kwargs):
"""Trigger a CI build.
See https://gitlab.com/help/ci/triggers/README.md#trigger-a-build
Expand All @@ -2101,7 +2101,7 @@ def trigger_build(self, ref, token, variables={}, **kwargs):
GitlabConnectionError: If the server cannot be reached.
GitlabCreateError: If the server fails to perform the request.
"""
url = "/projects/%s/trigger/builds" % self.id
url = "/projects/%s/trigger/pipeline" % self.id
form = {r'variables[%s]' % k: v for k, v in six.iteritems(variables)}
data = {'ref': ref, 'token': token}
data.update(form)
Expand Down

0 comments on commit 0c3fe39

Please sign in to comment.