Mender Server updating device configure by API

Hello,

TL;DR How to change mender device configure using API ?

I am trying to write a script to post a device configuation update via a script.
Chaining config in the UI works

So I do this (with JWT headers etc)
PUT https://{menderserver}/api/management/v1//configurations/device/{device_id}
body : { a:b }
That works server end
When I pull
GET https://{menderserver}/api/management/v1/deviceconfig/configurations/device/{device_id}
It return something like:
{
“id”: “{device_id}”,
“configured”: { “a”:“b” }
“reported”: {“old”:“config”}
“deployment_id”: {old depolyment id from UI}",
“updated_ts”: “2024-12-10T11:45:41.655Z”,
“reported_ts”: “2024-12-10T11:45:45.559Z”
}

But I doesn’t create a new deployment.

Should I be trying to make PUT https://mender.cellink.dev/api/management/v1/deployments/deployments
whenever I try this is seem to be annoyed with me for no artffacts
here
However this seems to be another internal API for the UI
deployments/tests/tests/test_configuration_deployments.py at 167e338b9004cf824b5c982092ee279cf6c616e3 · mendersoftware/deployments · GitHub

What should I do?

Thanks

I would like to thank you rubber :duck:s

I found in the documenation in the end
https://docs.mender.io/api/?python#management-api-device-configure-deploy-device-configuration

https://{{menderserver}}//api/management/v1/deviceconfig/configurations/device/{{device_id}}/deploy
body
{
“retries”: 0,
“update_control_map”: {}
}

This works great.

2 Likes

Happy to :duck:!