diff options
author | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-03-04 09:58:41 +0100 |
---|---|---|
committer | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-03-04 09:58:41 +0100 |
commit | b242ee9f6e1f84d7cbc6114cac1bc5300fa3afcc (patch) | |
tree | e6f07500de87d7f4a708fba18d3dd4efccf5dd98 /cli | |
parent | 9f78cc5acee3e974e1c30bfdeac740e895e2dab1 (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')
-rw-r--r-- | cli/cli.py | 28 | ||||
-rw-r--r-- | cli/objects/client.py | 4 | ||||
-rw-r--r-- | cli/objects/poweroff.py | 4 | ||||
-rw-r--r-- | cli/objects/reboot.py | 4 | ||||
-rw-r--r-- | cli/objects/session.py | 4 | ||||
-rw-r--r-- | cli/objects/wol.py | 4 |
6 files changed, 24 insertions, 24 deletions
@@ -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'] diff --git a/cli/objects/client.py b/cli/objects/client.py index 66d25bc..cf5e0b9 100644 --- a/cli/objects/client.py +++ b/cli/objects/client.py @@ -45,8 +45,8 @@ class OgClient(): print_json(r.text) @staticmethod - def send_refresh(rest, args): - parser = argparse.ArgumentParser(prog='ogcli send refresh') + def request_refresh(rest, args): + parser = argparse.ArgumentParser(prog='ogcli request refresh') parser.add_argument('--client-ip', action='append', default=[], diff --git a/cli/objects/poweroff.py b/cli/objects/poweroff.py index 46086cb..c8848c5 100644 --- a/cli/objects/poweroff.py +++ b/cli/objects/poweroff.py @@ -13,8 +13,8 @@ import argparse class OgPoweroff(): @staticmethod - def send_poweroff(rest, args): - parser = argparse.ArgumentParser(prog='ogcli send poweroff') + def request_poweroff(rest, args): + parser = argparse.ArgumentParser(prog='ogcli request poweroff') group = parser.add_argument_group( 'clients', 'Client selection options') group.add_argument('--center-id', diff --git a/cli/objects/reboot.py b/cli/objects/reboot.py index 162e771..bfa3257 100644 --- a/cli/objects/reboot.py +++ b/cli/objects/reboot.py @@ -13,8 +13,8 @@ import argparse class OgReboot(): @staticmethod - def send_reboot(rest, args): - parser = argparse.ArgumentParser(prog='ogcli send reboot') + def request_reboot(rest, args): + parser = argparse.ArgumentParser(prog='ogcli request reboot') group = parser.add_argument_group( 'clients', 'Client selection options') group.add_argument('--center-id', diff --git a/cli/objects/session.py b/cli/objects/session.py index ee2cf73..c13468f 100644 --- a/cli/objects/session.py +++ b/cli/objects/session.py @@ -13,8 +13,8 @@ import argparse class OgSession(): @staticmethod - def send_session(rest, args): - parser = argparse.ArgumentParser(prog='ogcli send session') + def request_session(rest, args): + parser = argparse.ArgumentParser(prog='ogcli request session') parser.add_argument('--disk', nargs='?', required=True, diff --git a/cli/objects/wol.py b/cli/objects/wol.py index 44228c8..b037804 100644 --- a/cli/objects/wol.py +++ b/cli/objects/wol.py @@ -13,7 +13,7 @@ import argparse class OgWol(): @staticmethod - def send_wol(rest, args): + def request_wol(rest, args): def scope_lookup(scope_id, scope_type, d): if scope_id == d.get('id') and \ scope_type == d.get('type'): @@ -26,7 +26,7 @@ class OgWol(): return lookup return None - parser = argparse.ArgumentParser(prog='ogcli send wol') + parser = argparse.ArgumentParser(prog='ogcli request wol') parser.add_argument('--type', nargs='?', choices=['broadcast', 'unicast'], |