/// Register storage pool json-rpc methods.
Register storage pool json-rpc methods.
Register storage pool json - rpc methods .
pub fn register_pool_methods() {
    // Joining create and import together is questionable and we might split
    // the two operations in future. However not until cache config file
    // feature is implemented and requirements become clear.
    jsonrpc::jsonrpc_register(
        "create_or_import_pool",
        |args: rpc::mayastor::CreatePoolRequest| {
            create_pool(args).boxed_local()
        },
    );
    jsonrpc::jsonrpc_register(
        "destroy_pool",
        |args: rpc::mayastor::DestroyPoolRequest| {
            destroy_pool(args).boxed_local()
        },
    );
    jsonrpc::jsonrpc_register::<(), _, _, jsonrpc::JsonRpcError>(
        "list_pools",
        |_| future::ok(list_pools()).boxed_local(),
    );
}
pub fn register_pool_methods ( ) { // Joining create and import together is questionable and we might split // the two operations in future. However not until cache config file // feature is implemented and requirements become clear. jsonrpc :: jsonrpc_register ( " " , | args : rpc :: mayastor :: CreatePoolRequest | { create_pool ( args ) . boxed_local ( ) } , ) ; jsonrpc :: jsonrpc_register ( " " , | args : rpc :: mayastor :: DestroyPoolRequest | { destroy_pool ( args ) . boxed_local ( ) } , ) ; jsonrpc :: jsonrpc_register :: < ( ) , _ , _ , jsonrpc :: JsonRpcError > ( " " , | _ | future :: ok ( list_pools ( ) ) . boxed_local ( ) , ) ; }
Register storage pool json-rpc methods.
Register storage pool json - rpc methods .