diff options
Diffstat (limited to 'cli')
-rw-r--r-- | cli/cli.py | 4 | ||||
-rw-r--r-- | cli/objects/repo.py | 11 |
2 files changed, 14 insertions, 1 deletions
@@ -197,7 +197,7 @@ class OgCLI(): OgImage.update_image(self.rest, args[1:]) def delete(self, args): - choices = ['server', 'center', 'room', 'client'] + choices = ['server', 'repo', 'center', 'room', 'client'] parser = argparse.ArgumentParser(prog='ogcli delete') parser.add_argument('delete_obj', choices=choices) @@ -209,6 +209,8 @@ class OgCLI(): parsed_args = parser.parse_args([args[0]]) if parsed_args.delete_obj == 'server': OgServer.delete_server(self.rest, args[1:]) + elif parsed_args.delete_obj == 'repo': + OgRepo.delete_repo(self.rest, args[1:]) elif parsed_args.delete_obj == 'center': OgCenter.delete_center(self.rest, args[1:]) elif parsed_args.delete_obj == 'room': diff --git a/cli/objects/repo.py b/cli/objects/repo.py index 9728f33..9f37591 100644 --- a/cli/objects/repo.py +++ b/cli/objects/repo.py @@ -42,6 +42,17 @@ class OgRepo(): rest.post('/repository/add', payload=payload) @staticmethod + def delete_repo(rest, args): + parser = argparse.ArgumentParser(prog='ogcli delete repo') + parser.add_argument('--id', + nargs='?', + required=True, + help='room id in scopes') + parsed_args = parser.parse_args(args) + payload = {'id': parsed_args.id} + rest.post('/repository/delete', payload=payload) + + @staticmethod def set_repo(rest, args): parser = argparse.ArgumentParser(prog='ogcli set repo') parser.add_argument('--id', |