Versions Compared

Key

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

...

The API call to device_syncto will start a job running in the background on the API server. To show the progress/output of the job run the last command (/job) until you get a finished result.

Zero-touch provisioning of access switch

First, make sure distribution switches are added as devices. If they are not, add them. Can be done using the API:

curl https://localhost/api/v1.0/device -X POST -H "Content-Type: application/json" -d '{"hostname": "dist0", "management_ip": "192.168.0.10", "platform": "junos", "state": "UNKNOWN", "device_type": "DIST"}'

Once the distribution switches are added, we can create a management domain and assign the distribution switches to it. Of course the IPv4 range, device IDs and VLAN should be replaced with whatever values you want.

curl -H "Content-Type: application/json" -X POST https://localhost/api/v1.0/mgmtdomain -d '{"ipv4_gw": "192.168.0.0/24", "device_a": 9, "device_b": 12, "vlan": 100}'

Then we can power on the access switch, wait for it to boot using DHCP. List new devices that has booted using CNaaS startup config:

curl https://localhost/api/v1.0/device?filter=state,DISCOVERED

If the device serial/MAC matches with a device you want to provision, call the API to initialize the device with a specified hostname and device type:

curl https://localhost/api/v1.0/device_init/20 -d '{"hostname": "ex2300-top", "device_type": "ACCESS"}' -X POST -H "Content-Type: application/json"

Check job status to see progress, there should be two jobs running after each other, step1 and step2.

curl https://localhost/api/v1.0/job?limit=2