golang API bindings for OpenContrail
The library consists on the contrail package plus an autogenerated package "contrail-go-api/types" that contains types corresponding to the OpenContrail datamodel defined in contrail-controller/src/schema.
The contail-go-api package can be installed with the "go get" command:
go get github.com/Juniper/contrail-go-api
The types package is generated using the command:
tools/generateds/generateDS.py -f -o $GOPATH/src/github.com/Juniper/contrail-go-api/types -g golang-api controller/src/schema/vnc_cfg.xsd
Pre-generated tar files with the generated types are also available as part of each release. The golang types corresponding to the schema defined by OpenContrail R2.20 are available at:
To build the CLI command:
go install github.com/Juniper/contrail-go-api/cli
TODO items:
- Links between two identifiers often have metadata which consists of a list of elements (e.g. association between virtual-network and network-ipam is a list of subnets). Currently the way to modify this metadata on a link is to delete it and re-add it; the generator should generate helper methods to make manipulating these lists simpler.
- VRouter API: The library needs to be extended in order to have a class that communicates with the vrouter-agent process in order to add/delete ports.
- Provisioning taks: there is the need to capture common provisining tasks such as configuring BGP routers.
- CLI: The CLI currently supports operations on networks, policies and virtual-routers. Additional support needs to be added for other common configuration and provisioning tasks.