summaryrefslogtreecommitdiffstats
path: root/cli/cli.py
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-03-04 09:58:41 +0100
committerAlejandro Sirgo Rica <asirgo@soleta.eu>2024-03-04 09:58:41 +0100
commitb242ee9f6e1f84d7cbc6114cac1bc5300fa3afcc (patch)
treee6f07500de87d7f4a708fba18d3dd4efccf5dd98 /cli/cli.py
parent9f78cc5acee3e974e1c30bfdeac740e895e2dab1 (diff)
change 'ogcli send' command into 'ogcli request'
By using the word 'request' the command becomes more semantic and represents the 'best effort' nature of the communication with ogserver.
Diffstat (limited to 'cli/cli.py')
-rw-r--r--cli/cli.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/cli/cli.py b/cli/cli.py
index 8e88a11..a81ed07 100644
--- a/cli/cli.py
+++ b/cli/cli.py
@@ -124,27 +124,27 @@ class OgCLI():
elif parsed_args.item == 'server':
OgServer.set_server(self.rest, args[1:])
- def send(self, args):
+ def request(self, args):
choices = ['reboot', 'refresh', 'poweroff', 'wol', 'session']
- parser = argparse.ArgumentParser(prog='ogcli send')
- parser.add_argument('send_obj', choices=choices)
+ parser = argparse.ArgumentParser(prog='ogcli request')
+ parser.add_argument('request_obj', choices=choices)
if not args:
- print('Missing send subcommand', file=sys.stderr)
+ print('Missing request subcommand', file=sys.stderr)
parser.print_help(file=sys.stderr)
sys.exit(1)
parsed_args = parser.parse_args([args[0]])
- if parsed_args.send_obj == 'wol':
- OgWol.send_wol(self.rest, args[1:])
- elif parsed_args.send_obj == 'poweroff':
- OgPoweroff.send_poweroff(self.rest, args[1:])
- elif parsed_args.send_obj == 'refresh':
- OgClient.send_refresh(self.rest, args[1:])
- elif parsed_args.send_obj == 'reboot':
- OgReboot.send_reboot(self.rest, args[1:])
- elif parsed_args.send_obj == 'session':
- OgSession.send_session(self.rest, args[1:])
+ if parsed_args.request_obj == 'wol':
+ OgWol.request_wol(self.rest, args[1:])
+ elif parsed_args.request_obj == 'poweroff':
+ OgPoweroff.request_poweroff(self.rest, args[1:])
+ elif parsed_args.request_obj == 'refresh':
+ OgClient.request_refresh(self.rest, args[1:])
+ elif parsed_args.request_obj == 'reboot':
+ OgReboot.request_reboot(self.rest, args[1:])
+ elif parsed_args.request_obj == 'session':
+ OgSession.request_session(self.rest, args[1:])
def restore(self, args):
choices = ['image']