-
Notifications
You must be signed in to change notification settings - Fork 9
Operations
Ignacio Corderi edited this page Jul 17, 2014
·
3 revisions
All examples assume you have a client c connected to some kinetic target.
import kinetic
c = kinetic.Client('localhost')Kinetic protocol allows us to instruct a device to communicate directly with another device. This set of operations are called P2P operations.
Push allows the client to tell the drive to send a set of keys to a target device
c.push(['key1', 'key2'], '192.168.32.19')The complete set of parameters and the default values are:
-
keys: list of the keys to be sent to the target drive -
hostname='localhost': target device -
port=8123: target port -
tls=False: wether or not to use TLS
PipedPush is similar to Push, but it provides the ability send a target set of keys through a chain of target drives. Piping a key foo on device A through devices [B,C] means that A will send it to B, then it will tell B to send it to C.
from kinetic.common import Peer
c.pipedPush(['key1', 'key2'], [Peer('192.168.32.19'), Peer('localhost', port=8787)])