如何使用 Apache Marathon REST API 扩展 docker 个实例?

How to scale up docker instances using Apache Marathon REST API.?

是否可以使用 Mesosphere Marathon REST API 增加和减少 docker containers/instances 的数量?

Endpoint GET /deployments 似乎是查看下一个可能操作的唯一选项。 如何使用 REST API 扩展实例(以编程方式:可能使用 curl 脚本而不使用 Marathon Web 界面)?

您应该将 PUT 与 JSON 一起使用,只有字段 "instances" 具有所需的实例数(例如 2)和应用程序 ID(例如 /foo)。

PUT <marathon-url>/v2/apps/foo

{ "id": "/foo", "instances": 2 }

注: Marathon 1.4 deprecates PUT semantic.

A PUT on /v2/apps has a PATCH like semantic: All values that are not defined in the json, will not update existing values. This was always the default behaviour in Marathon versions. For backward compatibility, we will not change this behaviour, but let users opt in for a proper PUT. The next version of Marathon will use PATCH and PUT as two separate actions.