Skydive client library can be installed using pip.
The Library provides two kinds of client. One is the REST client which will be used
to make topology/flow requests. The WebSocket client will be used in order to
interact with the Graph engine of Skydive. With it, we will be able to listen
graph events or to inject graph elements in the Skydive topology.
Rest API
The following example requests nodes named eth0 and print some details
about the first returned interface.
To request any kind of object from the topology API we can use the lookup method.
The following example requests all the ICMPv4 flows.
Captures can be created, listed, deleted thanks to the capture_create, capture_list, capture_delete
methods:
WebSocket API
Thanks to this API we can subcribe to the graph event bus of Skydive being able to
see all the modifications of the topology.
The following example shows how to add two nodes connected with a link.
Command line
A command line tool comes with the client library which allows to listen for graph events.
To get the full graph when connecting :
Dump / inject
It is also possible to inject graph elements. It can be useful to re-inject a dump
from one Skydive instance to an other one.
The dump is easy to achieve, a simple curl will do the job.
To re-inject the following command line can be use.