Hello,
I’m trying to figure out how to restart a container running on one device from another container using the supervisor API. The balena supervisor docs describe a restart endpoint that is a bit of overkill; it will restart the service on the entire fleet. I would like however only to restart the service on the device that the API call is being called from.
I can do this successfully using the balena-cloud API from within a container. This call will call out to balena cloud and command to restart the service, but requires connectivity out to the external endpoint, and then returns back to the local device. The API call is:
curl -X POST --header "Content-Type:application/json" --header "Authorization: Bearer $EXTERNAL_BALENA_API_TOKEN" --data '{ "uuid" : <device uuid>, "data" : { "serviceName" : <local-service-name> } }' "https://api.balena-cloud.com/supervisor/v2/applications/$BALENA_APP_ID/restart-service"
I’d like to just be able to do this from within the device itself.