rpc: Rename delete_secret_from_iscsi_auth_group to iscsi_auth_group_remove_secret
Change-Id: I914c930914931f1356cd1ae9fb6a8eb4ff6a85b1 Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468487 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
61f4433c20
commit
a25f9bf94a
@ -2886,9 +2886,9 @@ Example response:
|
|||||||
}
|
}
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
## delete_secret_from_iscsi_auth_group {#rpc_delete_secret_from_iscsi_auth_group}
|
## iscsi_auth_group_remove_secret {#rpc_iscsi_auth_group_remove_secret}
|
||||||
|
|
||||||
Delete a secret from an existing authentication group for CHAP authentication.
|
Remove a secret from an existing authentication group for CHAP authentication.
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
@ -2908,7 +2908,7 @@ Example request:
|
|||||||
"user": "u3"
|
"user": "u3"
|
||||||
},
|
},
|
||||||
"jsonrpc": "2.0",
|
"jsonrpc": "2.0",
|
||||||
"method": "delete_secret_from_iscsi_auth_group",
|
"method": "iscsi_auth_group_remove_secret",
|
||||||
"id": 1
|
"id": 1
|
||||||
}
|
}
|
||||||
~~~
|
~~~
|
||||||
|
@ -1416,37 +1416,37 @@ SPDK_RPC_REGISTER("iscsi_auth_group_add_secret", spdk_rpc_iscsi_auth_group_add_s
|
|||||||
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(iscsi_auth_group_add_secret, add_secret_to_iscsi_auth_group)
|
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(iscsi_auth_group_add_secret, add_secret_to_iscsi_auth_group)
|
||||||
|
|
||||||
|
|
||||||
struct rpc_delete_auth_secret {
|
struct rpc_remove_auth_secret {
|
||||||
int32_t tag;
|
int32_t tag;
|
||||||
char *user;
|
char *user;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
free_rpc_delete_auth_secret(struct rpc_delete_auth_secret *_secret)
|
free_rpc_remove_auth_secret(struct rpc_remove_auth_secret *_secret)
|
||||||
{
|
{
|
||||||
free(_secret->user);
|
free(_secret->user);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct spdk_json_object_decoder rpc_delete_auth_secret_decoders[] = {
|
static const struct spdk_json_object_decoder rpc_remove_auth_secret_decoders[] = {
|
||||||
{"tag", offsetof(struct rpc_delete_auth_secret, tag), spdk_json_decode_int32},
|
{"tag", offsetof(struct rpc_remove_auth_secret, tag), spdk_json_decode_int32},
|
||||||
{"user", offsetof(struct rpc_delete_auth_secret, user), spdk_json_decode_string},
|
{"user", offsetof(struct rpc_remove_auth_secret, user), spdk_json_decode_string},
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
spdk_rpc_delete_secret_from_iscsi_auth_group(struct spdk_jsonrpc_request *request,
|
spdk_rpc_iscsi_auth_group_remove_secret(struct spdk_jsonrpc_request *request,
|
||||||
const struct spdk_json_val *params)
|
const struct spdk_json_val *params)
|
||||||
{
|
{
|
||||||
struct rpc_delete_auth_secret req = {};
|
struct rpc_remove_auth_secret req = {};
|
||||||
struct spdk_json_write_ctx *w;
|
struct spdk_json_write_ctx *w;
|
||||||
struct spdk_iscsi_auth_group *group;
|
struct spdk_iscsi_auth_group *group;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if (spdk_json_decode_object(params, rpc_delete_auth_secret_decoders,
|
if (spdk_json_decode_object(params, rpc_remove_auth_secret_decoders,
|
||||||
SPDK_COUNTOF(rpc_delete_auth_secret_decoders), &req)) {
|
SPDK_COUNTOF(rpc_remove_auth_secret_decoders), &req)) {
|
||||||
SPDK_ERRLOG("spdk_json_decode_object failed\n");
|
SPDK_ERRLOG("spdk_json_decode_object failed\n");
|
||||||
spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS,
|
spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS,
|
||||||
"Invalid parameters");
|
"Invalid parameters");
|
||||||
free_rpc_delete_auth_secret(&req);
|
free_rpc_remove_auth_secret(&req);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1458,7 +1458,7 @@ spdk_rpc_delete_secret_from_iscsi_auth_group(struct spdk_jsonrpc_request *reques
|
|||||||
|
|
||||||
spdk_jsonrpc_send_error_response_fmt(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS,
|
spdk_jsonrpc_send_error_response_fmt(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS,
|
||||||
"Could not find auth group (%d)", req.tag);
|
"Could not find auth group (%d)", req.tag);
|
||||||
free_rpc_delete_auth_secret(&req);
|
free_rpc_remove_auth_secret(&req);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1469,20 +1469,22 @@ spdk_rpc_delete_secret_from_iscsi_auth_group(struct spdk_jsonrpc_request *reques
|
|||||||
spdk_jsonrpc_send_error_response_fmt(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS,
|
spdk_jsonrpc_send_error_response_fmt(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS,
|
||||||
"Could not delete secret from CHAP group (%d), %s",
|
"Could not delete secret from CHAP group (%d), %s",
|
||||||
req.tag, spdk_strerror(-rc));
|
req.tag, spdk_strerror(-rc));
|
||||||
free_rpc_delete_auth_secret(&req);
|
free_rpc_remove_auth_secret(&req);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
pthread_mutex_unlock(&g_spdk_iscsi.mutex);
|
pthread_mutex_unlock(&g_spdk_iscsi.mutex);
|
||||||
|
|
||||||
free_rpc_delete_auth_secret(&req);
|
free_rpc_remove_auth_secret(&req);
|
||||||
|
|
||||||
w = spdk_jsonrpc_begin_result(request);
|
w = spdk_jsonrpc_begin_result(request);
|
||||||
spdk_json_write_bool(w, true);
|
spdk_json_write_bool(w, true);
|
||||||
spdk_jsonrpc_end_result(request, w);
|
spdk_jsonrpc_end_result(request, w);
|
||||||
}
|
}
|
||||||
SPDK_RPC_REGISTER("delete_secret_from_iscsi_auth_group",
|
SPDK_RPC_REGISTER("iscsi_auth_group_remove_secret",
|
||||||
spdk_rpc_delete_secret_from_iscsi_auth_group, SPDK_RPC_RUNTIME)
|
spdk_rpc_iscsi_auth_group_remove_secret, SPDK_RPC_RUNTIME)
|
||||||
|
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(iscsi_auth_group_remove_secret,
|
||||||
|
delete_secret_from_iscsi_auth_group)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
spdk_rpc_iscsi_get_auth_groups(struct spdk_jsonrpc_request *request,
|
spdk_rpc_iscsi_get_auth_groups(struct spdk_jsonrpc_request *request,
|
||||||
|
@ -790,13 +790,14 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
|
|||||||
p.add_argument('-r', '--msecret', help='Secret for mutual CHAP authentication')
|
p.add_argument('-r', '--msecret', help='Secret for mutual CHAP authentication')
|
||||||
p.set_defaults(func=iscsi_auth_group_add_secret)
|
p.set_defaults(func=iscsi_auth_group_add_secret)
|
||||||
|
|
||||||
def delete_secret_from_iscsi_auth_group(args):
|
def iscsi_auth_group_remove_secret(args):
|
||||||
rpc.iscsi.delete_secret_from_iscsi_auth_group(args.client, tag=args.tag, user=args.user)
|
rpc.iscsi.iscsi_auth_group_remove_secret(args.client, tag=args.tag, user=args.user)
|
||||||
|
|
||||||
p = subparsers.add_parser('delete_secret_from_iscsi_auth_group', help='Delete a secret from an authentication group.')
|
p = subparsers.add_parser('iscsi_auth_group_remove_secret', aliases=['delete_secret_from_iscsi_auth_group'],
|
||||||
|
help='Remove a secret from an authentication group.')
|
||||||
p.add_argument('tag', help='Authentication group tag', type=int)
|
p.add_argument('tag', help='Authentication group tag', type=int)
|
||||||
p.add_argument('-u', '--user', help='User name for one-way CHAP authentication', required=True)
|
p.add_argument('-u', '--user', help='User name for one-way CHAP authentication', required=True)
|
||||||
p.set_defaults(func=delete_secret_from_iscsi_auth_group)
|
p.set_defaults(func=iscsi_auth_group_remove_secret)
|
||||||
|
|
||||||
def iscsi_get_auth_groups(args):
|
def iscsi_get_auth_groups(args):
|
||||||
print_dict(rpc.iscsi.iscsi_get_auth_groups(args.client))
|
print_dict(rpc.iscsi.iscsi_get_auth_groups(args.client))
|
||||||
|
@ -323,8 +323,9 @@ def iscsi_auth_group_add_secret(client, tag, user, secret, muser=None, msecret=N
|
|||||||
return client.call('iscsi_auth_group_add_secret', params)
|
return client.call('iscsi_auth_group_add_secret', params)
|
||||||
|
|
||||||
|
|
||||||
def delete_secret_from_iscsi_auth_group(client, tag, user):
|
@deprecated_alias('delete_secret_from_iscsi_auth_group')
|
||||||
"""Delete a secret from an authentication group.
|
def iscsi_auth_group_remove_secret(client, tag, user):
|
||||||
|
"""Remove a secret from an authentication group.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
tag: Authentication group tag (unique, integer > 0)
|
tag: Authentication group tag (unique, integer > 0)
|
||||||
@ -334,7 +335,7 @@ def delete_secret_from_iscsi_auth_group(client, tag, user):
|
|||||||
True or False
|
True or False
|
||||||
"""
|
"""
|
||||||
params = {'tag': tag, 'user': user}
|
params = {'tag': tag, 'user': user}
|
||||||
return client.call('delete_secret_from_iscsi_auth_group', params)
|
return client.call('iscsi_auth_group_remove_secret', params)
|
||||||
|
|
||||||
|
|
||||||
@deprecated_alias('delete_pg_ig_maps')
|
@deprecated_alias('delete_pg_ig_maps')
|
||||||
|
@ -526,7 +526,7 @@ class UIISCSIAuthGroups(UINode):
|
|||||||
self.get_root().iscsi_delete_auth_group(tag=tag)
|
self.get_root().iscsi_delete_auth_group(tag=tag)
|
||||||
|
|
||||||
def delete_secret(self, tag, user):
|
def delete_secret(self, tag, user):
|
||||||
self.get_root().delete_secret_from_iscsi_auth_group(
|
self.get_root().iscsi_auth_group_remove_secret(
|
||||||
tag=tag, user=user)
|
tag=tag, user=user)
|
||||||
|
|
||||||
def ui_command_create(self, tag, secrets=None):
|
def ui_command_create(self, tag, secrets=None):
|
||||||
|
@ -448,8 +448,8 @@ class UIRoot(UINode):
|
|||||||
rpc.iscsi.iscsi_auth_group_add_secret(self.client, **kwargs)
|
rpc.iscsi.iscsi_auth_group_add_secret(self.client, **kwargs)
|
||||||
|
|
||||||
@verbose
|
@verbose
|
||||||
def delete_secret_from_iscsi_auth_group(self, **kwargs):
|
def iscsi_auth_group_remove_secret(self, **kwargs):
|
||||||
rpc.iscsi.delete_secret_from_iscsi_auth_group(self.client, **kwargs)
|
rpc.iscsi.iscsi_auth_group_remove_secret(self.client, **kwargs)
|
||||||
|
|
||||||
@verbose
|
@verbose
|
||||||
@is_method_available
|
@is_method_available
|
||||||
|
Loading…
Reference in New Issue
Block a user