What schema should I use to pause before install when creating a deployment via REST API?

I used an update control map as defined here - Mender Update Management API v1 | Mender documentation but ended up with a pause I couldn’t choose to continue via the WEB UI. After a couple of minutes the deployment was paused and waiting, I got an error saying - “Device does not support Update Control.” But I don’t want the device to deal with the pause, I want to manage that from the WEB UI. Moreover, when I created the deployment via the WEB UI and chose to pause before install - it worked, with the same device. Any idea???

The pausing requests from the UI and from the device are independent. Mender will pause if at least one of the two sources are requesting a pause, but it’s not possible to continue a pause from the UI that was initiated from the device (if you didn’t set a pause in the UI, it is already in the “continue” state).

It is possible to override a pause though, but for this you need to use the server API directly, it is not supported from the UI. Use the Patch Deployment endpoint to submit a new Update Control Map to an existing deployment. Make sure that priority is set higher than what you set on the device (if you didn’t set anything, it’s zero), and make sure action is set to force_continue.

Thanks. Just one thing I’m not sure I understand - is a deployment pause defined via the Management REST API (https://docs.mender.io/api/#management-api-deployments-create-deployment) considered a pause initiated by the device?

I’m trying to set up a CD pipeline whereas the release and deployment are created automatically via some GitHub action. I’m able to create the deployment but, I want to be able to manage the created deployment via the Web UI. Is that impossible? Do I have to unpause via the Patch Deployment REST API a deployment created via the Management API?

No, this is a pause by the server. To pause from the client, one has to use the Device-side D-Bus API.

It sounds like you should not use the Device-side API at all, but just concentrate on the server. If you submit the Update Control Map when you create the deployment with the API, then this is a server-initiated pause, and can therefore be continued from the server as well (and from the UI).

I’m using this https://hosted.mender.io/api/management/v1/deployments/deployments URL.
Is this the device API? I was under the impression Management API is the Server API.
Can you please refer me to the correct place in your docs?
Thanks!

There are three APIs, grouped in two categories:

  • Server-side API (HTTP REST API):
    • The Management API, which is used to upload and initiate deployments, submit Update Control Maps, administrate users, and so on. This API is used by the UI. The link you posted is part of this API.
    • The Device API: This is used by devices to request updates from the server and submit inventory.
  • Device-side API (D-Bus API):
    • This is an API which only local processes on the device can use. It is used to request authorization information from Mender, and to submit local Update Control Maps.

The Patch Deployment endpoint is the one you need to use.

Thanks. I believe I’ve figured out what my issue was.

I was trying to set up a deployment with both pause before install as well as 2 deployment phases.
When tried that from the UI - I got an error message saying this is not possible - either pause between steps OR deployment phases. Indeed, when I removed the deployment phases, I was able to unpause the deployment from the UI.

Is there any plan to support this combination (i.e., deployment phases with a pause before install in each phase) in the future?

There have been some talks, but there are no concrete plans at the moment. Deployment phases and pauses are tricky to support together in a meaningful way, since one is time based, and the other is action based. What happens if the next phase begins while the previous is still paused, for instance? For now we have chosen to keep it simple.

1 Like