I’m trying to setup a fleet of local pi3 servers which all need to communicate with a distant api server.
They all need to authenticate with their own credentials, so I thought I’d use device environment variables to store these individual credentials and get them from the node sdk on boot.
Now I’m actually getting the environment variables successfully using
balena.models.device.envVar.getAllByApplication('my-app'), but I expected to get only the variables of the machine performing the call to the balena api through the sdk.
Instead of this I get the environment variables of all the devices.
It seems I could pick the right ones if only I knew the device’s uuid, but I can’t figure out how to get this uuid from my node program.
Is this even possible, or am I supposed to create an application per server (which doesn’t sound like the right thing to do for the exact same node program) ?
Maybe I missed a specific method in the documentation ?