numam-spdk/scripts/rpc/nbd.py
Ben Walker 4dd3f4a7fa rpc: Break rpc client into individual python files
The top level client is unchanged. This is primarily just
moving code around. The client.py file is the only location
with new code, which converts the old jsonrpc_call function
into a class.

Change-Id: I5fb7cd48f77f6affa3d9439128009bf63148acda
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/364316
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-01-25 10:24:46 -05:00

22 lines
513 B
Python
Executable File

from client import print_dict, print_array, int_arg
def start_nbd_disk(args):
params = {
'bdev_name': args.bdev_name,
'nbd_device': args.nbd_device
}
args.client.call('start_nbd_disk', params)
def stop_nbd_disk(args):
params = {'nbd_device': args.nbd_device}
args.client.call('stop_nbd_disk', params)
def get_nbd_disks(args):
params = {}
if args.nbd_device:
params['nbd_device'] = args.nbd_device
print_dict(args.client.call('get_nbd_disks', params))