diff options
author | Gauvain Pocentek <gauvain@pocentek.net> | 2016-07-16 19:56:22 +0200 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2016-07-16 19:56:22 +0200 |
commit | fc68e9bbf8cf24eca4faf57997f0c7273944eabe (patch) | |
tree | d1dc7a3560530af408276467d51f03aa1f2ea349 /gitlab/cli.py | |
parent | e7c412510ba014f6e1cf94b725b0e24665c7b4ed (diff) | |
download | gitlab-fc68e9bbf8cf24eca4faf57997f0c7273944eabe.tar.gz |
implement CLI for project archive/unarchive/share
Diffstat (limited to 'gitlab/cli.py')
-rw-r--r-- | gitlab/cli.py | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/gitlab/cli.py b/gitlab/cli.py index bc17915..e8bb425 100644 --- a/gitlab/cli.py +++ b/gitlab/cli.py @@ -61,7 +61,10 @@ EXTRA_ACTIONS = { 'all': {}, 'starred': {}, 'star': {'required': ['id']}, - 'unstar': {'required': ['id']}}, + 'unstar': {'required': ['id']}, + 'archive': {'required': ['id']}, + 'unarchive': {'required': ['id']}, + 'share': {'required': ['id', 'group-id', 'group-access']}}, gitlab.User: {'block': {'required': ['id']}, 'unblock': {'required': ['id']}, 'search': {'required': ['query']}, @@ -205,6 +208,27 @@ class GitlabCLI(object): except Exception as e: _die("Impossible to unstar project (%s)" % str(e)) + def do_project_archive(self, cls, gl, what, args): + try: + o = self.do_get(cls, gl, what, args) + o.archive_() + except Exception as e: + _die("Impossible to archive project (%s)" % str(e)) + + def do_project_unarchive(self, cls, gl, what, args): + try: + o = self.do_get(cls, gl, what, args) + o.unarchive_() + except Exception as e: + _die("Impossible to unarchive project (%s)" % str(e)) + + def do_project_share(self, cls, gl, what, args): + try: + o = self.do_get(cls, gl, what, args) + o.share(args['group_id'], args['group_access']) + except Exception as e: + _die("Impossible to share project (%s)" % str(e)) + def do_user_block(self, cls, gl, what, args): try: o = self.do_get(cls, gl, what, args) |