From 82e8880841e31a37060b3d2e5b7dd25abd9b91cf Mon Sep 17 00:00:00 2001 From: "Jose M. Guisado" Date: Wed, 19 Jul 2023 17:46:24 +0200 Subject: update image: add optional --backup parameter Add support for backup image file when running the image update command. For this optional parameter to be useful, the target ogServer and ogClient must also support the 'backup' parameter. See commits: ogServer 74b6e3ec7275164e2ecbf6f98b24357b2a9bb174 ogClient 035995fc8c55740693575ca5f7b408bfc46c1f7d --- cli/objects/images.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'cli') diff --git a/cli/objects/images.py b/cli/objects/images.py index 3bed476..f0e2076 100644 --- a/cli/objects/images.py +++ b/cli/objects/images.py @@ -169,6 +169,11 @@ class OgImage(): nargs='?', required=True, help='Image id') + parser.add_argument('--backup', + action='store_true', + required=False, + default=False, + help='Create a backup before updating the image (No backup is created by default)') parser.add_argument('--repo-id', nargs='?', default=1, @@ -210,13 +215,14 @@ class OgImage(): else: print(f'Updating {image_name} image') - payload = {'clients': parsed_args.client_ip, + payload = {'repository_id': parsed_args.repo_id, + 'clients': parsed_args.client_ip, + 'partition': parsed_args.part, + 'backup': parsed_args.backup, 'disk': parsed_args.disk, 'center_id': center_id, - 'partition': parsed_args.part, - 'code': str(fs_code), 'id': parsed_args.id, - 'name': image_name, - 'repository_id': parsed_args.repo_id} + 'code': str(fs_code), + 'name': image_name} rest.post('/image/create', payload=payload) -- cgit v1.2.3-18-g5258