diff --git a/doc/jsonrpc.md b/doc/jsonrpc.md index 5552039a16..0a829af8bf 100644 --- a/doc/jsonrpc.md +++ b/doc/jsonrpc.md @@ -254,7 +254,7 @@ Example response: "log_set_level", "log_get_print_level", "log_set_print_level", - "get_iscsi_global_params", + "iscsi_get_options", "iscsi_target_node_add_lun", "iscsi_get_connections", "iscsi_delete_portal_group", @@ -2605,7 +2605,7 @@ Example response: } ~~~ -## get_iscsi_global_params method {#rpc_get_iscsi_global_params} +## iscsi_get_options method {#rpc_iscsi_get_options} Show global parameters of iSCSI targets. @@ -2621,7 +2621,7 @@ Example request: request: { "jsonrpc": "2.0", - "method": "get_iscsi_global_params", + "method": "iscsi_get_options", "id": 1 } ~~~ diff --git a/lib/iscsi/iscsi_rpc.c b/lib/iscsi/iscsi_rpc.c index 228c0204f3..1a750ad1a1 100644 --- a/lib/iscsi/iscsi_rpc.c +++ b/lib/iscsi/iscsi_rpc.c @@ -1092,14 +1092,14 @@ SPDK_RPC_REGISTER("iscsi_target_node_set_auth", spdk_rpc_iscsi_target_node_set_a SPDK_RPC_REGISTER_ALIAS_DEPRECATED(iscsi_target_node_set_auth, set_iscsi_target_node_auth) static void -spdk_rpc_get_iscsi_global_params(struct spdk_jsonrpc_request *request, - const struct spdk_json_val *params) +spdk_rpc_iscsi_get_options(struct spdk_jsonrpc_request *request, + const struct spdk_json_val *params) { struct spdk_json_write_ctx *w; if (params != NULL) { spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS, - "get_iscsi_global_params requires no parameters"); + "iscsi_get_options requires no parameters"); return; } @@ -1108,7 +1108,8 @@ spdk_rpc_get_iscsi_global_params(struct spdk_jsonrpc_request *request, spdk_jsonrpc_end_result(request, w); } -SPDK_RPC_REGISTER("get_iscsi_global_params", spdk_rpc_get_iscsi_global_params, SPDK_RPC_RUNTIME) +SPDK_RPC_REGISTER("iscsi_get_options", spdk_rpc_iscsi_get_options, SPDK_RPC_RUNTIME) +SPDK_RPC_REGISTER_ALIAS_DEPRECATED(iscsi_get_options, get_iscsi_global_params) struct rpc_discovery_auth { bool disable_chap; diff --git a/scripts/rpc.py b/scripts/rpc.py index 80e6a38098..6b8cfc95ba 100755 --- a/scripts/rpc.py +++ b/scripts/rpc.py @@ -1103,11 +1103,12 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse help='Display iSCSI connections') p.set_defaults(func=iscsi_get_connections) - def get_iscsi_global_params(args): - print_dict(rpc.iscsi.get_iscsi_global_params(args.client)) + def iscsi_get_options(args): + print_dict(rpc.iscsi.iscsi_get_options(args.client)) - p = subparsers.add_parser('get_iscsi_global_params', help='Display iSCSI global parameters') - p.set_defaults(func=get_iscsi_global_params) + p = subparsers.add_parser('iscsi_get_options', aliases=['get_iscsi_global_params'], + help='Display iSCSI global parameters') + p.set_defaults(func=iscsi_get_options) def get_scsi_devices(args): print_dict(rpc.iscsi.get_scsi_devices(args.client)) diff --git a/scripts/rpc/iscsi.py b/scripts/rpc/iscsi.py index b1e74a512b..e043af535b 100644 --- a/scripts/rpc/iscsi.py +++ b/scripts/rpc/iscsi.py @@ -502,13 +502,14 @@ def iscsi_get_connections(client): return client.call('iscsi_get_connections') -def get_iscsi_global_params(client): +@deprecated_alias('get_iscsi_global_params') +def iscsi_get_options(client): """Display iSCSI global parameters. Returns: List of iSCSI global parameter. """ - return client.call('get_iscsi_global_params') + return client.call('iscsi_get_options') def get_scsi_devices(client): diff --git a/scripts/spdkcli/ui_node_iscsi.py b/scripts/spdkcli/ui_node_iscsi.py index 1ed7b2ce82..80d82a9c4c 100644 --- a/scripts/spdkcli/ui_node_iscsi.py +++ b/scripts/spdkcli/ui_node_iscsi.py @@ -25,7 +25,7 @@ class UIISCSIGlobalParams(UINode): def refresh(self): self._children = set([]) - iscsi_global_params = self.get_root().get_iscsi_global_params() + iscsi_global_params = self.get_root().iscsi_get_options() if not iscsi_global_params: return for param, val in iscsi_global_params.items(): diff --git a/scripts/spdkcli/ui_root.py b/scripts/spdkcli/ui_root.py index 70eb24355b..b48a4a7c8f 100644 --- a/scripts/spdkcli/ui_root.py +++ b/scripts/spdkcli/ui_root.py @@ -478,8 +478,8 @@ class UIRoot(UINode): @verbose @is_method_available - def get_iscsi_global_params(self, **kwargs): - return rpc.iscsi.get_iscsi_global_params(self.client, **kwargs) + def iscsi_get_options(self, **kwargs): + return rpc.iscsi.iscsi_get_options(self.client, **kwargs) def has_subsystem(self, subsystem): for system in rpc.subsystem.get_subsystems(self.client): diff --git a/test/iscsi_tgt/rpc_config/rpc_config.py b/test/iscsi_tgt/rpc_config/rpc_config.py index 65dda9aeb5..7340a01888 100755 --- a/test/iscsi_tgt/rpc_config/rpc_config.py +++ b/test/iscsi_tgt/rpc_config/rpc_config.py @@ -154,7 +154,7 @@ def verify_scsi_devices_rpc_methods(rpc_py): check_output('iscsiadm -m discovery -t st -p {}'.format(rpc_param['target_ip']), shell=True) check_output('iscsiadm -m node --login', shell=True) name = json.loads(rpc.iscsi_get_target_nodes())[0]['name'] - output = rpc.get_iscsi_global_params() + output = rpc.iscsi_get_options() jsonvalues = json.loads(output) nodebase = jsonvalues['node_base'] output = rpc.get_scsi_devices() @@ -324,7 +324,7 @@ def verify_initiator_groups_rpc_methods(rpc_py, rpc_param): def verify_target_nodes_rpc_methods(rpc_py, rpc_param): rpc = spdk_rpc(rpc_py) - output = rpc.get_iscsi_global_params() + output = rpc.iscsi_get_options() jsonvalues = json.loads(output) nodebase = jsonvalues['node_base'] output = rpc.iscsi_get_target_nodes()