rpc: Rename add_iscsi_auth_group to iscsi_create_auth_group
Change-Id: I000a98138ca6c3620beebc6da0733d728562e78c Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468356 Tested-by: SPDK CI Jenkins <sys_sgci@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:
parent
4d62a7cc1f
commit
d9edd3afbb
@ -2696,18 +2696,18 @@ Example response:
|
||||
}
|
||||
~~~
|
||||
|
||||
## add_iscsi_auth_group method {#rpc_add_iscsi_auth_group}
|
||||
## iscsi_create_auth_group method {#rpc_iscsi_create_auth_group}
|
||||
|
||||
Add an authentication group for CHAP authentication.
|
||||
Create an authentication group for CHAP authentication.
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Optional | Type | Description
|
||||
--------------------------- | -------- | --------| -----------
|
||||
tag | Required | number | Authentication group tag (unique, integer > 0)
|
||||
secrets | Optional | array | Array of @ref rpc_add_iscsi_auth_group_secret objects
|
||||
secrets | Optional | array | Array of @ref rpc_iscsi_create_auth_group_secret objects
|
||||
|
||||
### secret {#rpc_add_iscsi_auth_group_secret}
|
||||
### secret {#rpc_iscsi_create_auth_group_secret}
|
||||
|
||||
Name | Optional | Type | Description
|
||||
--------------------------- | ---------| --------| -----------
|
||||
@ -2734,7 +2734,7 @@ Example request:
|
||||
"tag": 2
|
||||
},
|
||||
"jsonrpc": "2.0",
|
||||
"method": "add_iscsi_auth_group",
|
||||
"method": "iscsi_create_auth_group",
|
||||
"id": 1
|
||||
}
|
||||
~~~
|
||||
@ -2799,7 +2799,7 @@ Array of objects describing authentication group.
|
||||
Name | Type | Description
|
||||
--------------------------- | --------| -----------
|
||||
tag | number | Authentication group tag
|
||||
secrets | array | Array of @ref rpc_add_iscsi_auth_group_secret objects
|
||||
secrets | array | Array of @ref rpc_iscsi_create_auth_group_secret objects
|
||||
|
||||
### Example
|
||||
|
||||
|
@ -1227,8 +1227,8 @@ static const struct spdk_json_object_decoder rpc_auth_group_decoders[] = {
|
||||
};
|
||||
|
||||
static void
|
||||
spdk_rpc_add_iscsi_auth_group(struct spdk_jsonrpc_request *request,
|
||||
const struct spdk_json_val *params)
|
||||
spdk_rpc_iscsi_create_auth_group(struct spdk_jsonrpc_request *request,
|
||||
const struct spdk_json_val *params)
|
||||
{
|
||||
struct rpc_auth_group req = {};
|
||||
struct rpc_auth_secret *_secret;
|
||||
@ -1283,7 +1283,8 @@ spdk_rpc_add_iscsi_auth_group(struct spdk_jsonrpc_request *request,
|
||||
spdk_json_write_bool(w, true);
|
||||
spdk_jsonrpc_end_result(request, w);
|
||||
}
|
||||
SPDK_RPC_REGISTER("add_iscsi_auth_group", spdk_rpc_add_iscsi_auth_group, SPDK_RPC_RUNTIME)
|
||||
SPDK_RPC_REGISTER("iscsi_create_auth_group", spdk_rpc_iscsi_create_auth_group, SPDK_RPC_RUNTIME)
|
||||
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(iscsi_create_auth_group, add_iscsi_auth_group)
|
||||
|
||||
struct rpc_delete_auth_group {
|
||||
int32_t tag;
|
||||
|
@ -1483,7 +1483,7 @@ iscsi_auth_group_config_json(struct spdk_iscsi_auth_group *group,
|
||||
{
|
||||
spdk_json_write_object_begin(w);
|
||||
|
||||
spdk_json_write_named_string(w, "method", "add_iscsi_auth_group");
|
||||
spdk_json_write_named_string(w, "method", "iscsi_create_auth_group");
|
||||
|
||||
spdk_json_write_name(w, "params");
|
||||
iscsi_auth_group_info_json(group, w);
|
||||
|
@ -749,19 +749,20 @@ if __name__ == "__main__":
|
||||
*** Authentication group must be precreated ***""", type=int)
|
||||
p.set_defaults(func=iscsi_set_discovery_auth)
|
||||
|
||||
def add_iscsi_auth_group(args):
|
||||
def iscsi_create_auth_group(args):
|
||||
secrets = None
|
||||
if args.secrets:
|
||||
secrets = [dict(u.split(":") for u in a.split(" ")) for a in args.secrets.split(",")]
|
||||
|
||||
rpc.iscsi.add_iscsi_auth_group(args.client, tag=args.tag, secrets=secrets)
|
||||
rpc.iscsi.iscsi_create_auth_group(args.client, tag=args.tag, secrets=secrets)
|
||||
|
||||
p = subparsers.add_parser('add_iscsi_auth_group', help='Add authentication group for CHAP authentication.')
|
||||
p = subparsers.add_parser('iscsi_create_auth_group', aliases=['add_iscsi_auth_group'],
|
||||
help='Create authentication group for CHAP authentication.')
|
||||
p.add_argument('tag', help='Authentication group tag (unique, integer > 0).', type=int)
|
||||
p.add_argument('-c', '--secrets', help="""Comma-separated list of CHAP secrets
|
||||
<user:user_name secret:chap_secret muser:mutual_user_name msecret:mutual_chap_secret> enclosed in quotes.
|
||||
Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 msecret:ms2'""", required=False)
|
||||
p.set_defaults(func=add_iscsi_auth_group)
|
||||
p.set_defaults(func=iscsi_create_auth_group)
|
||||
|
||||
def delete_iscsi_auth_group(args):
|
||||
rpc.iscsi.delete_iscsi_auth_group(args.client, tag=args.tag)
|
||||
|
@ -267,8 +267,9 @@ def iscsi_target_node_set_auth(
|
||||
return client.call('iscsi_target_node_set_auth', params)
|
||||
|
||||
|
||||
def add_iscsi_auth_group(client, tag, secrets=None):
|
||||
"""Add authentication group for CHAP authentication.
|
||||
@deprecated_alias('add_iscsi_auth_group')
|
||||
def iscsi_create_auth_group(client, tag, secrets=None):
|
||||
"""Create authentication group for CHAP authentication.
|
||||
|
||||
Args:
|
||||
tag: Authentication group tag (unique, integer > 0).
|
||||
@ -281,7 +282,7 @@ def add_iscsi_auth_group(client, tag, secrets=None):
|
||||
|
||||
if secrets:
|
||||
params['secrets'] = secrets
|
||||
return client.call('add_iscsi_auth_group', params)
|
||||
return client.call('iscsi_create_auth_group', params)
|
||||
|
||||
|
||||
def delete_iscsi_auth_group(client, tag):
|
||||
|
@ -542,7 +542,7 @@ class UIISCSIAuthGroups(UINode):
|
||||
if secrets:
|
||||
secrets = [dict(u.split(":") for u in a.split(" "))
|
||||
for a in secrets.split(",")]
|
||||
self.get_root().add_iscsi_auth_group(tag=tag, secrets=secrets)
|
||||
self.get_root().iscsi_create_auth_group(tag=tag, secrets=secrets)
|
||||
|
||||
def ui_command_delete(self, tag):
|
||||
"""Delete an authentication group.
|
||||
|
@ -457,8 +457,8 @@ class UIRoot(UINode):
|
||||
return rpc.iscsi.get_iscsi_auth_groups(self.client, **kwargs)
|
||||
|
||||
@verbose
|
||||
def add_iscsi_auth_group(self, **kwargs):
|
||||
rpc.iscsi.add_iscsi_auth_group(self.client, **kwargs)
|
||||
def iscsi_create_auth_group(self, **kwargs):
|
||||
rpc.iscsi.iscsi_create_auth_group(self.client, **kwargs)
|
||||
|
||||
@verbose
|
||||
def delete_iscsi_auth_group(self, **kwargs):
|
||||
|
@ -43,7 +43,7 @@ echo "iscsi_tgt is listening. Running tests..."
|
||||
|
||||
timing_exit start_iscsi_tgt
|
||||
|
||||
$rpc_py add_iscsi_auth_group 1 -c 'user:root secret:tester'
|
||||
$rpc_py iscsi_create_auth_group 1 -c 'user:root secret:tester'
|
||||
$rpc_py iscsi_set_discovery_auth -g 1
|
||||
$rpc_py iscsi_create_portal_group $PORTAL_TAG $TARGET_IP:$ISCSI_PORT
|
||||
$rpc_py add_initiator_group $INITIATOR_TAG $INITIATOR_NAME $NETMASK
|
||||
|
Loading…
Reference in New Issue
Block a user