Register & Update Device at Once
Learn how to register a device and deploy an update at the same time.
Registration and Update deployment is a common JFrog Connect use-case that might be useful for several scenarios, for such cases we created a script by using our REST API to register the device and deploy an update at the same time.
For example, If you would like to make sure that all devices registered to your account are automatically updated with the latest software, or, some kind of configuration that initiates after a successful factory reset.
Instead of registering the device via the installation command or a pre-made image, we will use a Python script on the device that will register and deploy an update to itself.
Prerequisites:
REST API enabled
Be familiar with our API and tokens
An Update Flow is created and ready to deploy
Python3 is installed on the device.
Requests library installed on the device
The script performs the following:
Registers the Device to Connect, according to the selected fleet.
Deploying an update flow that was previously configured in the platform.
Even if the device is already registered, the update will still be deployed.
Instructions:
Take the code below and edit with the following configuration at the top:
USER_TOKEN - Your user token, can be taken from Settings > Account > Show User Token.
PROJECT_NAME - The name of the desired project that the device will be connected to.
UPDATE_FLOW_ID - ID of the desired flow to be deployed on the device, the flow must be a part of the project above.
2. Copy the script to the device
3. Choose when the script would run. Some prefer having it running after the next power-on, while others initiate it with their on-device software.
What's Next?
Learn how to organize your account using fleets, groups, and tags.
Last updated
Was this helpful?

