{"action":"created","issue":{"url":"https://api.github.com/repos/mesosphere/marathon/issues/1418","repository_url":"https://api.github.com/repos/mesosphere/marathon","labels_url":"https://api.github.com/repos/mesosphere/marathon/issues/1418/labels{/name}","comments_url":"https://api.github.com/repos/mesosphere/marathon/issues/1418/comments","events_url":"https://api.github.com/repos/mesosphere/marathon/issues/1418/events","html_url":"https://github.com/mesosphere/marathon/issues/1418","id":70085904,"number":1418,"title":"Support app/group config replacement instead of only updates (PUT semantics)","user":{"login":"kolloch","id":339354,"avatar_url":"https://avatars.githubusercontent.com/u/339354?v=3","gravatar_id":"","url":"https://api.github.com/users/kolloch","html_url":"https://github.com/kolloch","followers_url":"https://api.github.com/users/kolloch/followers","following_url":"https://api.github.com/users/kolloch/following{/other_user}","gists_url":"https://api.github.com/users/kolloch/gists{/gist_id}","starred_url":"https://api.github.com/users/kolloch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kolloch/subscriptions","organizations_url":"https://api.github.com/users/kolloch/orgs","repos_url":"https://api.github.com/users/kolloch/repos","events_url":"https://api.github.com/users/kolloch/events{/privacy}","received_events_url":"https://api.github.com/users/kolloch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/mesosphere/marathon/milestones/12","html_url":"https://github.com/mesosphere/marathon/milestones/Backlog","labels_url":"https://api.github.com/repos/mesosphere/marathon/milestones/12/labels","id":870039,"number":12,"title":"Backlog","description":"","creator":{"login":"ConnorDoyle","id":379372,"avatar_url":"https://avatars.githubusercontent.com/u/379372?v=3","gravatar_id":"","url":"https://api.github.com/users/ConnorDoyle","html_url":"https://github.com/ConnorDoyle","followers_url":"https://api.github.com/users/ConnorDoyle/followers","following_url":"https://api.github.com/users/ConnorDoyle/following{/other_user}","gists_url":"https://api.github.com/users/ConnorDoyle/gists{/gist_id}","starred_url":"https://api.github.com/users/ConnorDoyle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ConnorDoyle/subscriptions","organizations_url":"https://api.github.com/users/ConnorDoyle/orgs","repos_url":"https://api.github.com/users/ConnorDoyle/repos","events_url":"https://api.github.com/users/ConnorDoyle/events{/privacy}","received_events_url":"https://api.github.com/users/ConnorDoyle/received_events","type":"User","site_admin":false},"open_issues":284,"closed_issues":89,"state":"open","created_at":"2014-11-17T19:11:38Z","updated_at":"2016-08-04T10:04:44Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2015-04-22T10:22:27Z","updated_at":"2016-08-04T16:32:06Z","closed_at":null,"body":"Currently, `PUT` requests on apps or groups update current app definitions instead of replacing them. If the app already exists, only the fields mentioned in the request are updated. If a field is not mentioned, it will not be removed but it remains unchanged.\r\n\r\nIf you want to delete a field, it is not possible. Even setting it explicitly to `null` in the JSON does not work. You have to delete the app definition first and thus cannot perform a rolling update.\r\n\r\nIt would be very nice if you could specify a complete definition which completely replaces an old one. This way the app definition could be a build artefact. The developer adjusting the build artefact doesn't have to think in terms of all possible upgrade paths but only has to specify what he wants in the future. \r\n\r\nWe cannot just change the semantics of our `PUT` requests without breaking API compatibility but I propose to\r\n\r\n_[update]_ add a boolean parameter `replace`. The value `false` would correspond to the current semantics and remain the default. If you want to replace an app definition completely, you would use `PUT /v2/apps/service1?replace=true` instead of `PUT /v2/apps/service1`.\r\n\r\n_[initial version]_ ~~add a Parameter `op` which can be either `update` or `replace`. `update` would correspond to the current semantics and remain the default. If you want to replace an app definition completely, you would use `PUT /v2/apps/service1?op=replace` instead of `PUT /v2/apps/service1`.~~\r\n\r\n## Example: Updating an App to a Dockerized Version\r\n\r\nStart a simple non-docker app:\r\n\r\n```http\r\nPUT /v2/apps/service1 HTTP/1.1\r\n<some headers>\r\n\r\n{\r\n    \"cmd\": \"python -m SimpleHTTPServer $PORT0\", \r\n    \"cpus\": 0.0001, \r\n    \"id\": \"service1\", \r\n    \"instances\": 1, \r\n    \"mem\": 32, \r\n    \"ports\": [\r\n        0\r\n    ]\r\n}\r\n\r\nHTTP/1.1 201 Created\r\n<some headers>\r\n\r\n{\r\n    \"deploymentId\": \"552a0b26-9674-4c5d-a39d-528c0db25cf0\", \r\n    \"version\": \"2015-04-22T10:11:16.105Z\"\r\n}\r\n```\r\n\r\nNow try to upgrade it to a dockerized version:\r\n\r\n```http\r\nPUT /v2/apps/service1 HTTP/1.1\r\n<some headers>\r\n\r\n{\r\n    \"args\": [\r\n        \"python\", \r\n        \"-m\", \r\n        \"SimpleHTTPServer\", \r\n        \"8080\"\r\n    ], \r\n    \"cmd\": null, \r\n    \"container\": {\r\n        \"docker\": {\r\n            \"image\": \"python:2.7\", \r\n            \"network\": \"BRIDGE\", \r\n            \"portMappings\": [\r\n                {\r\n                    \"containerPort\": 8080, \r\n                    \"hostPort\": 0, \r\n                    \"protocol\": \"tcp\", \r\n                    \"servicePort\": 0\r\n                }\r\n            ]\r\n        }, \r\n        \"type\": \"DOCKER\"\r\n    }, \r\n    \"cpus\": 0.0001, \r\n    \"id\": \"service1\", \r\n    \"instances\": 1, \r\n    \"mem\": 32\r\n}\r\n\r\nHTTP/1.1 422 \r\n<some headers>\r\n\r\n{\r\n    \"errors\": [\r\n        {\r\n            \"attribute\": \"\", \r\n            \"error\": \"AppDefinition must either contain one of 'cmd' or 'args', and/or a 'container'.\"\r\n        }\r\n    ]\r\n}\r\n```\r\n\r\nIf you `DELETE` the app first and repeat the second request, it works."},"comment":{"url":"https://api.github.com/repos/mesosphere/marathon/issues/comments/237608305","html_url":"https://github.com/mesosphere/marathon/issues/1418#issuecomment-237608305","issue_url":"https://api.github.com/repos/mesosphere/marathon/issues/1418","id":237608305,"user":{"login":"modeyang","id":1850755,"avatar_url":"https://avatars.githubusercontent.com/u/1850755?v=3","gravatar_id":"","url":"https://api.github.com/users/modeyang","html_url":"https://github.com/modeyang","followers_url":"https://api.github.com/users/modeyang/followers","following_url":"https://api.github.com/users/modeyang/following{/other_user}","gists_url":"https://api.github.com/users/modeyang/gists{/gist_id}","starred_url":"https://api.github.com/users/modeyang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/modeyang/subscriptions","organizations_url":"https://api.github.com/users/modeyang/orgs","repos_url":"https://api.github.com/users/modeyang/repos","events_url":"https://api.github.com/users/modeyang/events{/privacy}","received_events_url":"https://api.github.com/users/modeyang/received_events","type":"User","site_admin":false},"created_at":"2016-08-04T16:32:06Z","updated_at":"2016-08-04T16:32:06Z","body":"whether this issue has solution?  marathon version 1.1.0 still confront the bug. can  any one help me ? "}}
{"actor":{"display_login":"modeyang"}}