Flock Routing Suite Client flockc
flockc is the client provided to query the current state of flockd. By design flockc can be run by a user with no special privileges. flockc connects to a Read-Only connection on flockd. flockd state can be viewed but cannot be changed. All output is in JSON format, making it suitable for consumption by humans or machines.
flockc connects to a REST API on flockd. This REST API will talk to any HTTP based client. This means any HTTP based client can be used to monitor flockd.
See here for more information on using the REST API.
Local Connectivity
flockc uses the REST API via the local IP Loopback address to retrieve state information from the local flockd.
This command shows all the IPv4 Prefixes in the RIB of the local flocknet1 router.
flock@flocknet1:~$ flockc rib -v default --af ipv4 -p
[["50.0.0.0/8",{"protos":[{"admin_dist":20,"origin":"Bgp", ...,"ip_nhs":[{"RecursiveNh":{"table_id":{"vrf_id":254,"afi":"ipv4-unicast"},"ip_addr":"90.0.93.61", ...}}], ...}],"fib_ip_nhs":[...], ...}], ...]
General Command Flags
General Flags can be included in any flockc command.
-d, --detail
-h, --help
-j, --json-pretty Output in Pretty Print JSON
-y, --yaml Output in YAML
Changing the output format
By default the output is in JSON Lines format, which is JSON with newlines added to aid reading by a human. The output can also be changed to JSON Pretty Print or YAML.
JSON Lines format
flock@r70:~$ flockc ospfv2 -n
{"r70-n75":[{"ip_addr":"70.0.75.71","router_id":"70.0.100.71", ...,"state":"Full", ...}], ...}
JSON Pretty format
Using the -j, --json-pretty flag the output is pretty printed JSON.
flock@r70:~$ flockc bgp -j
{
"overview": {
"id": "70.0.100.70",
"asn": 70,
"cluster_id": null,
"route_server": false,
...
},
...
}
YAML format
Using the -y, --yaml flag the output is in YAML format.
flock@r70:~$ flockc bgp -y