I'm trying to update a marathon app via update_app
call in Python (I just want to change docker image) but unless I remove version
field from the dict returned by get_app
I get the error mentioned in the topic.
Please explain how app updates should be done and how version & id is related to this.
I've read https://mesosphere.github.io/marathon/docs/rest-api.html but it's still not clear to me.
Thank you!
-marek
Here is some of my code:
app = marathon_client.get_app(CONF.application)
# won't work without deleting "version"
# del app["version"]
app["container"]["docker"]["image"] = CONF.docker_image
deployment_id = marathon_client.update_app(CONF.application,
app)
And here is an error:
Traceback (most recent call last):
File "./update.py", line 122, in <module>
main()
File "./update.py", line 104, in main
deployment_id = marathon_client.update_app(CONF.application, app)
File "/usr/local/lib/python2.7/dist-packages/dcos/marathon.py", line 343, in update_app
return self._update(app_id, payload, force)
File "/usr/local/lib/python2.7/dist-packages/dcos/marathon.py", line 326, in _update
timeout=self._timeout)
File "/usr/local/lib/python2.7/dist-packages/dcos/marathon.py", line 121, in _http_req
raise _to_exception(e.response)
dcos.errors.DCOSException: Error: requirement failed: The 'version' field may only be combined with the 'id' field.