Device Upgrade from CLI

How can I manage device upgrades remotely, from a command line?

I have a fleet, where the devices are pinned to a specific release (auto upgrades off)
I want to upgrade a specific device or fleet to a different release.

I did not find a relevant command in balena cli.
The command “balena device os-update ” is for updating the Balena OS, and not the release.

Hi there, I’ve just taken a look, and it turns out these CLI commands do exist, but it seems we haven’t documented them!

I found this command

Pin a device to a release.

USAGE
  $ balena device pin <uuid> [releaseToPinTo]

ARGUMENTS
  <uuid>            the uuid of the device to pin to a release
  [releaseToPinTo]  the commit of the release for the device to get pinned to

and

Pin a fleet to a release.

USAGE
  $ balena fleet pin <slug> [releaseToPinTo]

ARGUMENTS
  <slug>            the slug of the fleet to pin to a release
  [releaseToPinTo]  the commit of the release for the fleet to get pinned to

These will allow you to pin a specific fleet or device to a specified release.

Just to correct myself, the CLI commands for pinning a device and fleet are documented here: Release policy - Balena Documentation

However I see how this is easily missed as the CLI docs page itself doesn’t document them. We will look into adding them there

Hi,
Is that CLI command also exposed as HTTP endpoint?

Hello @LiorVahav first of all welcome to the balena community!

did you check the API documentation? Resources - Balena Documentation

Let us know if that works for you!