Hi there,
I am using the latest balena-sdk
v10.1.1 python library with python3.6.
When I call the API balena.models.environment_variables.device_service_environment_variable.get_all_by_application(id)
It should return something shown in the API doc:
[{'name': u'device1', u'__metadata': {u'type': u'', u'uri': u'/balena/device_environment_variable(40794)'}, u'value': u'test', u'device': {u'__deferred': {u'uri': u'/balena/device(115792)'}, u'__id': 115792}, u'id': 40794}, {'name': u'BALENA_DEVICE_RESTART', u'__metadata': {u'type': u'', u'uri': u'/balena/device_environment_variable(1524)'}, u'value': u'961506585823372', u'device': {u'__deferred': {u'uri': u'/balena/device(121794)'}, u'__id': 121794}, u'id': 1524}]
reference: Balena Python SDK - Balena Documentation
But I got the result like:
[{'id': #, 'created_at': '2021-04-14T03:28:33.633Z', 'service_install': {'__id': #, '__deferred': {'uri': '/resin/service_install(@id)?@id=#'}}, 'value': 'Test', 'name': 'TEST', '__metadata': {'uri': '/resin/device_service_environment_variable(@id)?@id=#'}}]
I.E. there is no device information for the environment variables. Do you have advice for getting variables information? The get_all
API works but then I have to call it for each devices. That will cost a long time if there are many devices.
Thanks for advice!
Jason