Gd2 exposes REST APIs and CLI is one consumer of these APIs.
+------------+ +--------------------+
| gd2 |------REST APIs---------------------------| restclient --- CLI |
+------------+ +--------------------+
restclient is a Go library available in github.com/gluster/glusterd2/pkg/restclient
To add a CLI subcommand,