We have a requirement that we need to be able to create Balena Devices via the API, and then manually provision a device that points towards that before created device.
I’ve found the Balena API Function balena.models.devices.register
this allows us to create a new device, with a uuid generated by us. And this works flawlessly as well. We see the device in our Fleet with the “inactive” status.
Now the problem is that i want to link a physical device towards that digital device. Since the register function returns an API key, i tried to replace the API key, in the config.json
that is downloadable when creating a device via the Web UI. Unfortunately, the device is just stuck in the Splashscreen and never appears on the Dashboard.
Using the default API key, which i get when i downloaded that file from balena itself. The system provisioned successfully and also showed up in the Dashboard. The only problem is that it created a new device, with new UUID.
Maybe i’m missing something here, but can someone please give me a hint on how i can achieve what i tried to?
Appreciate any help or pointers, thanks!