rpc: Rename add_initiators_to_initiator_group to iscsi_initiator_group_add_initiators

Change-Id: I776f52a5e15c1cb7949fffc76196634b37b5274b
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467226
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Pawel Kaminski 2019-09-03 05:59:23 -04:00 committed by Jim Harris
parent 28099e0ed9
commit a7d07920e8
8 changed files with 21 additions and 17 deletions

View File

@ -94,7 +94,7 @@ In addition to the configuration file, the iSCSI target may also be configured v
- add_initiator_group -- Add an initiator group. - add_initiator_group -- Add an initiator group.
- delete_initiator_group -- Delete an existing initiator group. - delete_initiator_group -- Delete an existing initiator group.
- add_initiators_to_initiator_group -- Add initiators to an existing initiator group. - iscsi_initiator_group_add_initiators -- Add initiators to an existing initiator group.
- get_initiator_groups -- Show information about all available initiator groups. - get_initiator_groups -- Show information about all available initiator groups.
~~~ ~~~

View File

@ -267,7 +267,7 @@ Example response:
"iscsi_get_target_nodes", "iscsi_get_target_nodes",
"delete_initiator_group", "delete_initiator_group",
"delete_initiators_from_initiator_group", "delete_initiators_from_initiator_group",
"add_initiators_to_initiator_group", "iscsi_initiator_group_add_initiators",
"add_initiator_group", "add_initiator_group",
"get_initiator_groups", "get_initiator_groups",
"set_iscsi_options", "set_iscsi_options",
@ -3045,7 +3045,7 @@ Example response:
} }
~~~ ~~~
## add_initiators_to_initiator_group method {#rpc_add_initiators_to_initiator_group} ## iscsi_initiator_group_add_initiators method {#rpc_iscsi_initiator_group_add_initiators}
Add initiators to an existing initiator group. Add initiators to an existing initiator group.
@ -3074,7 +3074,7 @@ request:
] ]
}, },
"jsonrpc": "2.0", "jsonrpc": "2.0",
"method": "add_initiators_to_initiator_group", "method": "iscsi_initiator_group_add_initiators",
"id": 1 "id": 1
} }
~~~ ~~~

View File

@ -179,7 +179,7 @@ static const struct spdk_json_object_decoder rpc_add_or_delete_initiators_decode
}; };
static void static void
spdk_rpc_add_initiators_to_initiator_group(struct spdk_jsonrpc_request *request, spdk_rpc_iscsi_initiator_group_add_initiators(struct spdk_jsonrpc_request *request,
const struct spdk_json_val *params) const struct spdk_json_val *params)
{ {
struct rpc_initiator_group req = {}; struct rpc_initiator_group req = {};
@ -211,8 +211,10 @@ invalid:
spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS, "Invalid parameters"); spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS, "Invalid parameters");
free_rpc_initiator_group(&req); free_rpc_initiator_group(&req);
} }
SPDK_RPC_REGISTER("add_initiators_to_initiator_group", SPDK_RPC_REGISTER("iscsi_initiator_group_add_initiators",
spdk_rpc_add_initiators_to_initiator_group, SPDK_RPC_RUNTIME) spdk_rpc_iscsi_initiator_group_add_initiators, SPDK_RPC_RUNTIME)
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(iscsi_initiator_group_add_initiators,
add_initiators_to_initiator_group)
static void static void
spdk_rpc_delete_initiators_from_initiator_group(struct spdk_jsonrpc_request *request, spdk_rpc_delete_initiators_from_initiator_group(struct spdk_jsonrpc_request *request,

View File

@ -978,7 +978,7 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
Example: '255.255.0.0 255.248.0.0' etc""") Example: '255.255.0.0 255.248.0.0' etc""")
p.set_defaults(func=add_initiator_group) p.set_defaults(func=add_initiator_group)
def add_initiators_to_initiator_group(args): def iscsi_initiator_group_add_initiators(args):
initiators = None initiators = None
netmasks = None netmasks = None
if args.initiator_list: if args.initiator_list:
@ -989,13 +989,14 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
netmasks = [] netmasks = []
for n in args.netmask_list.strip().split(' '): for n in args.netmask_list.strip().split(' '):
netmasks.append(n) netmasks.append(n)
rpc.iscsi.add_initiators_to_initiator_group( rpc.iscsi.iscsi_initiator_group_add_initiators(
args.client, args.client,
tag=args.tag, tag=args.tag,
initiators=initiators, initiators=initiators,
netmasks=netmasks) netmasks=netmasks)
p = subparsers.add_parser('add_initiators_to_initiator_group', p = subparsers.add_parser('iscsi_initiator_group_add_initiators',
aliases=['add_initiators_to_initiator_group'],
help='Add initiators to an existing initiator group') help='Add initiators to an existing initiator group')
p.add_argument( p.add_argument(
'tag', help='Initiator group tag (unique, integer > 0)', type=int) 'tag', help='Initiator group tag (unique, integer > 0)', type=int)
@ -1003,7 +1004,7 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
enclosed in quotes. This parameter can be omitted. Example: 'ANY' or '127.0.0.1 192.168.200.100'""", required=False) enclosed in quotes. This parameter can be omitted. Example: 'ANY' or '127.0.0.1 192.168.200.100'""", required=False)
p.add_argument('-m', dest='netmask_list', help="""Whitespace-separated list of initiator netmasks enclosed in quotes. p.add_argument('-m', dest='netmask_list', help="""Whitespace-separated list of initiator netmasks enclosed in quotes.
This parameter can be omitted. Example: '255.255.0.0 255.248.0.0' etc""", required=False) This parameter can be omitted. Example: '255.255.0.0 255.248.0.0' etc""", required=False)
p.set_defaults(func=add_initiators_to_initiator_group) p.set_defaults(func=iscsi_initiator_group_add_initiators)
def delete_initiators_from_initiator_group(args): def delete_initiators_from_initiator_group(args):
initiators = None initiators = None

View File

@ -390,7 +390,8 @@ def add_initiator_group(client, tag, initiators, netmasks):
return client.call('add_initiator_group', params) return client.call('add_initiator_group', params)
def add_initiators_to_initiator_group( @deprecated_alias('add_initiators_to_initiator_group')
def iscsi_initiator_group_add_initiators(
client, client,
tag, tag,
initiators=None, initiators=None,
@ -411,7 +412,7 @@ def add_initiators_to_initiator_group(
params['initiators'] = initiators params['initiators'] = initiators
if netmasks: if netmasks:
params['netmasks'] = netmasks params['netmasks'] = netmasks
return client.call('add_initiators_to_initiator_group', params) return client.call('iscsi_initiator_group_add_initiators', params)
def delete_initiators_from_initiator_group( def delete_initiators_from_initiator_group(

View File

@ -422,7 +422,7 @@ class UIInitiatorGroups(UINode):
e.g. 255.255.0.0 255.248.0.0 e.g. 255.255.0.0 255.248.0.0
""" """
tag = self.ui_eval_param(tag, "number", None) tag = self.ui_eval_param(tag, "number", None)
self.get_root().add_initiators_to_initiator_group( self.get_root().iscsi_initiator_group_add_initiators(
tag=tag, initiators=initiators.split(" "), tag=tag, initiators=initiators.split(" "),
netmasks=netmasks.split(" ")) netmasks=netmasks.split(" "))

View File

@ -428,8 +428,8 @@ class UIRoot(UINode):
yield ic yield ic
@verbose @verbose
def add_initiators_to_initiator_group(self, **kwargs): def iscsi_initiator_group_add_initiators(self, **kwargs):
rpc.iscsi.add_initiators_to_initiator_group(self.client, **kwargs) rpc.iscsi.iscsi_initiator_group_add_initiators(self.client, **kwargs)
@verbose @verbose
def delete_initiators_from_initiator_group(self, **kwargs): def delete_initiators_from_initiator_group(self, **kwargs):

View File

@ -287,7 +287,7 @@ def verify_initiator_groups_rpc_methods(rpc_py, rpc_param):
for idx, value in enumerate(rpc_param['netmask']): for idx, value in enumerate(rpc_param['netmask']):
tag = idx + 1 tag = idx + 1
rpc.add_initiators_to_initiator_group(tag, '-n', rpc_param['initiator_name'], '-m', value) rpc.iscsi_initiator_group_add_initiators(tag, '-n', rpc_param['initiator_name'], '-m', value)
output = rpc.get_initiator_groups() output = rpc.get_initiator_groups()
jsonvalues = json.loads(output) jsonvalues = json.loads(output)
verify(len(jsonvalues) == tag, 1, verify(len(jsonvalues) == tag, 1,