Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

git init --bare cnaas-settings-origin.git
git clone cnaas-settings-origin.git cnaas-settings
git clone git://gitops.sunet.se/cnaas-lab-settings sunet-integrationtest-settings
cp -r sunet-integrationtest-settings/* cnaas-settings
cd cnaas-settings/
git add .
git commit -a -m "init"
git push

And ask the API to fetch the settings:

curl -ks -H "Authorization: Bearer $JWT_AUTH_TOKEN" https://localhost/api/v1.0/repository/settings -d '{"action": "refresh"}' -X PUT -H "Content-Type: application/json"

Response:

{"status": "success", "data": "Cloned new from remote. Last commit c03813ff000293f606f33f48727b5baf3de68486 master by root at 2021-09-28 11:50:15+00:00"}

Try generating configuration

We'll add a simple device for testing:

curl -ks -H "Authorization: Bearer $JWT_AUTH_TOKEN" https://localhost/api/v1.0/device -X POST -d '{ "hostname": "eosdist1", "management_ip": "10.100.3.0", "platform": "eos", "state": "MANAGED", "device_type": "DIST"}' -H "Content-Type: application/json" | jq 

And generate the configuration:

curl -ks -H "Authorization: Bearer $JWT_AUTH_TOKEN" https://localhost/api/v1.0/device/eosdist1/generate_config -H "Content-Type: application/json" | jq .

Check available variables or text config: