diff options
Diffstat (limited to 'cli/objects')
-rw-r--r-- | cli/objects/repo.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/cli/objects/repo.py b/cli/objects/repo.py index c4c4164..9728f33 100644 --- a/cli/objects/repo.py +++ b/cli/objects/repo.py @@ -17,6 +17,31 @@ class OgRepo(): print_json(r.text) @staticmethod + def add_repo(rest, args): + parser = argparse.ArgumentParser(prog='ogcli add repo') + parser.add_argument('--address', + nargs='?', + required=True, + help='valid ip address') + parser.add_argument('--name', + nargs='?', + required=True, + help='valid ip address') + parser.add_argument('--center', + nargs='?', + type=int, + help='(Optional, Legacy) Center id serving this repository') + parsed_args = parser.parse_args(args) + payload = { + 'ip': parsed_args.address, + 'name': parsed_args.name, + } + if parsed_args.center: + payload['center']: center + + rest.post('/repository/add', payload=payload) + + @staticmethod def set_repo(rest, args): parser = argparse.ArgumentParser(prog='ogcli set repo') parser.add_argument('--id', |