toolbelt rpc

toolbelt rpc call unicast

Description

Callback Unicast RPC

Usage

toolbelt [global options] rpc call (u | unicast) <target> <func> [<args>...] [-h] [-c <callback-name>] [-w <wait>] [-a <attempts>]

Positional Arguments

target

SNAP address of target node or bridge

func

Name of function to call on targets

args

A list of arguments to pass to the function (space-delimited, use quotes to pass an argument with whitespace.)

Options

-c <name>, --callback-name <name>

Specify which function will be called on a response from the targets

-w <wait>, --wait <wait>

Callback reply timeout/wait between attempts (ms)

-a <attempts>, --attempts <attempts>

Number of attempts

Examples

Ask the bridge node getInfo(5):

toolbelt rpc call u bridge getInfo 5

Ask the bridge node vmStat(6), expect it to return its result via tellVmStat:

toolbelt rpc call u bridge vmStat 6 --callback-name tellVmStat

toolbelt rpc call directed-multicast

Description

Callback Directed Multicast RPC

Usage

toolbelt [global options] rpc call (d | dm | directed-multicast) <targets> <func> [<args>...] [-h] [-g <group>] [-t <ttl>] [-d <delay>] [-c <callback-name>]

Positional Arguments

targets

A comma separated list of SNAP addresses

func

Name of function to call on targets

args

A list of arguments to pass to the function (space-delimited, use quotes to pass an argument with whitespace.)

Options

-g <group>, --group <group>

Override the Network’s default multicast group

-t <ttl>, --ttl <ttl>

Override the Network’s default multicast TTL

-d <delay>, --delay <delay>

Specify a response delay in milliseconds from the targets, default is 0

-c <name>, --callback-name <name>

Specify which function will be called on a response from the targets

-w <wait>, --wait <wait>

Callback reply timeout/wait between attempts (ms)

-a <attempts>, --attempts <attempts>

Number of attempts

Examples

Directed Multicast a request for getInfo(5) to 123456 and 789abc, ask them to delay their responses into 100ms windows:

toolbelt rpc call dm 123456,789abc getInfo 5 --delay 100

toolbelt rpc send unicast

Description

Send Unicast RPC

Usage

toolbelt [global options] rpc send (u | unicast) <target> <func> [<args>...] [-h]

Positional Arguments

target

SNAP address of target node or bridge

func

Name of function to call on targets

args

A list of arguments to pass to the function (space-delimited, use quotes to pass an argument with whitespace.)

Examples

Send ping() to the bridge node:

toolbelt rpc send u bridge ping

toolbelt rpc send multicast

Description

Send Multicast RPC

Usage

toolbelt [global options] rpc send (m | multicast) <func> [<args>...] [-h] [-g <group>] [-t <ttl>]

Positional Arguments

func

Name of function to call on targets

args

A list of arguments to pass to the function (space-delimited, use quotes to pass an argument with whitespace.)

Options

-g <group>, --group <group>

Override the Network’s default multicast group

-t <ttl>, --ttl <ttl>

Override the Network’s default multicast TTL

Examples

Broadcast hunt():

toolbelt rpc send m hunt

toolbelt rpc send directed-multicast

Description

Send Directed Multicast RPC

Usage

toolbelt [global options] rpc send (d | dm | directed-multicast) <targets> <func> [<args>...] [-h] [-g <group>] [-t <ttl>] [-d <delay>]

Positional Arguments

targets

A comma separated list of SNAP addresses

func

Name of function to call on targets

args

A list of arguments to pass to the function (space-delimited, use quotes to pass an argument with whitespace.)

Options

-g <group>, --group <group>

Override the Network’s default multicast group

-t <ttl>, --ttl <ttl>

Override the Network’s default multicast TTL

-d <delay>, --delay <delay>

Specify a response delay in milliseconds from the targets, default is 0

Examples

Send nodes 001122, 334455, and 667788 the RPC getData(17, 'blue', 22):

toolbelt rpc send dm 001122,334455,667788 getData 17 'blue' 22