Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting creating applications with a json file (or json-formatted string, or json object) #112

Closed
vincepii opened this issue Jun 16, 2016 · 2 comments

Comments

@vincepii
Copy link

The marathon.MarathonApp object can be built by passing all the parameters defining an application.

It would be nice if there was a way to create marathon.MarathonApp with json content directly.

A workaround, given a json object, would be to use marathon.MarathonApp(**myapp_json), but there would still be issues for method parameters using snake-case and json keys using camelCase:

E.g.,

TypeError: __init__() got an unexpected keyword argument 'upgradeStrategy'
@oilbeater
Copy link
Contributor

Try MarathonApp.from_json()

@vincepii
Copy link
Author

Thanks, for reference, the following works:

    c = marathon.MarathonClient(uri)
    app = marathon.MarathonApp.from_json(json.loads(json_definition))
    ret = c.create_app(appid, app)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants