diff options
author | Gauvain Pocentek <gauvain@pocentek.net> | 2017-05-23 09:10:44 +0200 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2017-05-23 15:42:26 +0200 |
commit | deecf1769ed4d3e9e2674412559413eb058494cf (patch) | |
tree | beaa3d1b165180f9d145b61d570f930d7235bff2 /gitlab/objects.py | |
parent | c02dabd25507a14d666e85c7f1ea7831c64d0394 (diff) | |
download | gitlab-deecf1769ed4d3e9e2674412559413eb058494cf.tar.gz |
[v4] Update project search API
* projects.search() is not implemented in v4
* add the 'search' attribute to projects.list()
Diffstat (limited to 'gitlab/objects.py')
-rw-r--r-- | gitlab/objects.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gitlab/objects.py b/gitlab/objects.py index 0def183..630d415 100644 --- a/gitlab/objects.py +++ b/gitlab/objects.py @@ -2278,6 +2278,7 @@ class Project(GitlabObject): _constructorTypes = {'owner': 'User', 'namespace': 'Group'} optionalListAttrs = ['search'] requiredCreateAttrs = ['name'] + optionalListAttrs = ['search'] optionalCreateAttrs = ['path', 'namespace_id', 'description', 'issues_enabled', 'merge_requests_enabled', 'builds_enabled', 'wiki_enabled', @@ -2678,6 +2679,8 @@ class ProjectManager(BaseManager): def search(self, query, **kwargs): """Search projects by name. + API v3 only. + .. note:: The search is only performed on the project name (not on the @@ -2696,6 +2699,9 @@ class ProjectManager(BaseManager): Returns: list(gitlab.Gitlab.Project): A list of matching projects. """ + if self.gitlab.api_version == '4': + raise NotImplementedError("Not supported by v4 API") + return self.gitlab._raw_list("/projects/search/" + query, Project, **kwargs) |