RPC: rename get_notification_types to notify_get_types
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com> Change-Id: I564678a0cff1cf63b2287713b163138bfb17d9ac Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468934 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
416310d543
commit
c7174d9e07
@ -5494,7 +5494,7 @@ Example response:
|
|||||||
|
|
||||||
# Notifications
|
# Notifications
|
||||||
|
|
||||||
## get_notification_types {#rpc_get_notification_types}
|
## notify_get_types {#rpc_notify_get_types}
|
||||||
|
|
||||||
Return list of all supported notification types.
|
Return list of all supported notification types.
|
||||||
|
|
||||||
@ -5513,7 +5513,7 @@ Example request:
|
|||||||
~~~
|
~~~
|
||||||
{
|
{
|
||||||
"jsonrpc": "2.0",
|
"jsonrpc": "2.0",
|
||||||
"method": "get_notification_types",
|
"method": "notify_get_types",
|
||||||
"id": 1
|
"id": 1
|
||||||
}
|
}
|
||||||
~~~
|
~~~
|
||||||
|
@ -36,4 +36,4 @@ for example "Nvme0n1"
|
|||||||
|
|
||||||
# RPC Calls {#rpc_calls}
|
# RPC Calls {#rpc_calls}
|
||||||
|
|
||||||
See [JSON-RPC documentation](jsonrpc.md/#rpc_get_notification_types)
|
See [JSON-RPC documentation](jsonrpc.md/#rpc_notify_get_types)
|
||||||
|
@ -41,14 +41,14 @@
|
|||||||
#include "spdk_internal/log.h"
|
#include "spdk_internal/log.h"
|
||||||
|
|
||||||
static int
|
static int
|
||||||
get_notification_types_cb(const struct spdk_notify_type *type, void *ctx)
|
notify_get_types_cb(const struct spdk_notify_type *type, void *ctx)
|
||||||
{
|
{
|
||||||
spdk_json_write_string((struct spdk_json_write_ctx *)ctx, spdk_notify_type_get_name(type));
|
spdk_json_write_string((struct spdk_json_write_ctx *)ctx, spdk_notify_type_get_name(type));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
spdk_rpc_get_notification_types(struct spdk_jsonrpc_request *request,
|
spdk_rpc_notify_get_types(struct spdk_jsonrpc_request *request,
|
||||||
const struct spdk_json_val *params)
|
const struct spdk_json_val *params)
|
||||||
{
|
{
|
||||||
struct spdk_json_write_ctx *w;
|
struct spdk_json_write_ctx *w;
|
||||||
@ -61,12 +61,13 @@ spdk_rpc_get_notification_types(struct spdk_jsonrpc_request *request,
|
|||||||
|
|
||||||
w = spdk_jsonrpc_begin_result(request);
|
w = spdk_jsonrpc_begin_result(request);
|
||||||
spdk_json_write_array_begin(w);
|
spdk_json_write_array_begin(w);
|
||||||
spdk_notify_foreach_type(get_notification_types_cb, w);
|
spdk_notify_foreach_type(notify_get_types_cb, w);
|
||||||
spdk_json_write_array_end(w);
|
spdk_json_write_array_end(w);
|
||||||
|
|
||||||
spdk_jsonrpc_end_result(request, w);
|
spdk_jsonrpc_end_result(request, w);
|
||||||
}
|
}
|
||||||
SPDK_RPC_REGISTER("get_notification_types", spdk_rpc_get_notification_types, SPDK_RPC_RUNTIME)
|
SPDK_RPC_REGISTER("notify_get_types", spdk_rpc_notify_get_types, SPDK_RPC_RUNTIME)
|
||||||
|
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(notify_get_types, get_notification_types)
|
||||||
|
|
||||||
struct rpc_get_notifications {
|
struct rpc_get_notifications {
|
||||||
uint64_t id;
|
uint64_t id;
|
||||||
|
@ -2011,11 +2011,12 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
|
|||||||
p.set_defaults(func=bdev_nvme_send_cmd)
|
p.set_defaults(func=bdev_nvme_send_cmd)
|
||||||
|
|
||||||
# Notifications
|
# Notifications
|
||||||
def get_notification_types(args):
|
def notify_get_types(args):
|
||||||
print_dict(rpc.notify.get_notification_types(args.client))
|
print_dict(rpc.notify.notify_get_types(args.client))
|
||||||
|
|
||||||
p = subparsers.add_parser('get_notification_types', help='List available notifications that user can subscribe to.')
|
p = subparsers.add_parser('notify_get_types', aliases=['get_notification_types'],
|
||||||
p.set_defaults(func=get_notification_types)
|
help='List available notifications that user can subscribe to.')
|
||||||
|
p.set_defaults(func=notify_get_types)
|
||||||
|
|
||||||
def get_notifications(args):
|
def get_notifications(args):
|
||||||
ret = rpc.notify.get_notifications(args.client,
|
ret = rpc.notify.get_notifications(args.client,
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
def get_notification_types(client):
|
from .helpers import deprecated_alias
|
||||||
return client.call("get_notification_types")
|
|
||||||
|
|
||||||
|
@deprecated_alias('get_notification_types')
|
||||||
|
def notify_get_types(client):
|
||||||
|
return client.call("notify_get_types")
|
||||||
|
|
||||||
|
|
||||||
def get_notifications(client,
|
def get_notifications(client,
|
||||||
|
@ -50,7 +50,7 @@ function tgt_check_notification_types() {
|
|||||||
bdev_unregister
|
bdev_unregister
|
||||||
"
|
"
|
||||||
|
|
||||||
get_types=$(tgt_rpc get_notification_types | jq -r '.[]')
|
get_types=$(tgt_rpc notify_get_types | jq -r '.[]')
|
||||||
if [ "$(echo $enabled_types)" != "$(echo $get_types)" ]; then
|
if [ "$(echo $enabled_types)" != "$(echo $get_types)" ]; then
|
||||||
echo "ERROR: expected types:" $enabled_types ", but got:" $get_types
|
echo "ERROR: expected types:" $enabled_types ", but got:" $get_types
|
||||||
ret=1
|
ret=1
|
||||||
|
Loading…
Reference in New Issue
Block a user