Commit c7174d9e authored by Maciej Wawryk's avatar Maciej Wawryk Committed by Jim Harris
Browse files

RPC: rename get_notification_types to notify_get_types



Signed-off-by: default avatarMaciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I564678a0cff1cf63b2287713b163138bfb17d9ac
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468934


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 416310d5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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
}
~~~
+1 −1
Original line number Diff line number Diff line
@@ -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)
+6 −5
Original line number Diff line number Diff line
@@ -41,14 +41,14 @@
#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,
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;
+5 −4
Original line number Diff line number Diff line
@@ -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,
+6 −2
Original line number Diff line number Diff line
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,
Loading