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:
Maciej Wawryk 2019-09-20 10:24:52 +02:00 committed by Jim Harris
parent 416310d543
commit c7174d9e07
6 changed files with 21 additions and 15 deletions

View File

@ -5494,7 +5494,7 @@ Example response:
# Notifications
## get_notification_types {#rpc_get_notification_types}
## notify_get_types {#rpc_notify_get_types}
Return list of all supported notification types.
@ -5513,7 +5513,7 @@ Example request:
~~~
{
"jsonrpc": "2.0",
"method": "get_notification_types",
"method": "notify_get_types",
"id": 1
}
~~~

View File

@ -36,4 +36,4 @@ for example "Nvme0n1"
# RPC Calls {#rpc_calls}
See [JSON-RPC documentation](jsonrpc.md/#rpc_get_notification_types)
See [JSON-RPC documentation](jsonrpc.md/#rpc_notify_get_types)

View File

@ -41,15 +41,15 @@
#include "spdk_internal/log.h"
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));
return 0;
}
static void
spdk_rpc_get_notification_types(struct spdk_jsonrpc_request *request,
const struct spdk_json_val *params)
spdk_rpc_notify_get_types(struct spdk_jsonrpc_request *request,
const struct spdk_json_val *params)
{
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);
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_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 {
uint64_t id;

View File

@ -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)
# Notifications
def get_notification_types(args):
print_dict(rpc.notify.get_notification_types(args.client))
def notify_get_types(args):
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.set_defaults(func=get_notification_types)
p = subparsers.add_parser('notify_get_types', aliases=['get_notification_types'],
help='List available notifications that user can subscribe to.')
p.set_defaults(func=notify_get_types)
def get_notifications(args):
ret = rpc.notify.get_notifications(args.client,

View File

@ -1,5 +1,9 @@
def get_notification_types(client):
return client.call("get_notification_types")
from .helpers import deprecated_alias
@deprecated_alias('get_notification_types')
def notify_get_types(client):
return client.call("notify_get_types")
def get_notifications(client,

View File

@ -50,7 +50,7 @@ function tgt_check_notification_types() {
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
echo "ERROR: expected types:" $enabled_types ", but got:" $get_types
ret=1