From 6a2803fe0d18c681ddc189b7bbab30724c51f900 Mon Sep 17 00:00:00 2001 From: Kornel Maleszka Date: Wed, 16 May 2018 12:22:33 +0200 Subject: [PATCH] Possibility for send the full json object on create --- marathon/client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/marathon/client.py b/marathon/client.py index 38f5333..dcb6d06 100644 --- a/marathon/client.py +++ b/marathon/client.py @@ -148,17 +148,18 @@ def list_endpoints(self): """ return MarathonEndpoint.from_tasks(self.list_tasks()) - def create_app(self, app_id, app): + def create_app(self, app_id, app, minimal=True): """Create and start an app. :param str app_id: application ID :param :class:`marathon.models.app.MarathonApp` app: the application to create + :param bool minimal: ignore nulls and empty collections :returns: the created app (on success) :rtype: :class:`marathon.models.app.MarathonApp` or False """ app.id = app_id - data = app.to_json() + data = app.to_json(minimal=minimal) response = self._do_request('POST', '/v2/apps', data=data) if response.status_code == 201: return self._parse_response(response, MarathonApp)