- Apply lint tools
- Go get must simply work
- Follow best practices Effective Go: https://golang.org/doc/effective_go.html
The following software is required to build this project:
- Install git
- Install go
- Install dep
- Install mysql
- Install fpm, only required if building packages (described below)
go get github.com/Juniper/contrail
make generate
Templates are stored in tools/templates Template configuraion You can add your template on template_config.yaml.
Note that schema stored here is just a cache for helping development. Developers should make sure download latest schema from http://github.com/Juniper/contrail-api-client
JSON version stored in public/schema.json
You need to run a local mysql instance running with test configuraion.
It is expected that the root password is 'contrail123', you can set this on an existing installation from the mysql prompt as follows:
MariaDB [(none)]> ALTER USER 'root'@'localhost' IDENTIFIED BY 'contrail123';
Executing the script below, will drop the contrail_test schema if it exists, recreate it and initialise this schema
./tools/reset_db.sh
At this point the tests can be executed
make test
You can run API server using this command.
go run cmd/contrail/main.go server -c packaging/apisrv.yml
API Server supports Keystone V3 authentication and RBAC. API Server has minimal Keystone API V3 support for standalone usecase. see a configuraion example in tools/test_config.yml
Dep, RPM and Binaries are stored in release page.
See releases
- contrail command for running intent api server/intent compiler etc
Contrail command
Usage:
contrail [flags]
contrail [command]
Available Commands:
help Help about any command
server Start API Server
Flags:
-c, --config string Configuraion File
-h, --help help for contrail
Use "contrail [command] --help" for more information about a command.
- contrailutil utility command for help developments
Contrail Utility Command
Usage:
contrailutil [flags]
contrailutil [command]
Available Commands:
generate generate code from schema
help Help about any command
package make a dep and rpm package
Flags:
-h, --help help for contrailutil
Build the packages
make package