Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
env:
- MARATHONVERSION: 0.8.1
- MARATHONVERSION: 0.8.2
# Not supported yet
# - MARATHONVERSION: 0.9.0
- MARATHONVERSION: 0.9.0

language: python
python: 2.7
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 0.7.2 (<not-yet-released>)

Support for Marathon 0.9.0

Changes:
* Add `accepted_resource_role` field to `MarathonApp`

## 0.7.1 (2015-07-14)

Critical fixes and @solarkennedy has been addded as a contributor!
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This is a Python library for interfacing with [Marathon](https://github.com/meso

marathon-python is primarily developed against Marathon 0.8.x (see [Marathon docs](https://mesosphere.github.io/marathon/))

* For Marathon 0.8.x, use the latest release
* For Marathon 0.8.x-0.9.x, use the latest release
* For Marathon 0.7.x, use marathon-python 0.6.10
* For older versions, please see `CHANGELOG.md`

Expand Down
18 changes: 11 additions & 7 deletions marathon/models/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ class MarathonApp(MarathonResource):

See: https://mesosphere.github.io/marathon/docs/rest-api.html#post-/v2/apps

:param list[str] accepted_resource_roles: a list of resource roles (the resource offer
must contain at least one of these for the app
to be launched on that host)
:param list[str] args: args form of the command to run
:param int backoff_factor: multiplier for subsequent backoff
:param int backoff_seconds: base time, in seconds, for exponential backoff
Expand Down Expand Up @@ -59,20 +62,21 @@ class MarathonApp(MarathonResource):
]
"""List of attributes which may be updated/changed after app creation"""

CREATE_ONLY_ATTRIBUTES = ['id']
CREATE_ONLY_ATTRIBUTES = ['id', 'accepted_resource_roles']
"""List of attributes that should only be passed on creation"""

READ_ONLY_ATTRIBUTES = ['deployments', 'tasks', 'tasks_running', 'tasks_staged', 'tasks_healthy', 'tasks_unhealthy']
"""List of read-only attributes"""

def __init__(self, args=None, backoff_factor=None, backoff_seconds=None, cmd=None, constraints=None, container=None,
cpus=None, dependencies=None, deployments=None, disk=None, env=None, executor=None, health_checks=None,
id=None, instances=None, labels=None, last_task_failure=None, max_launch_delay_seconds=None, mem=None,
ports=None, require_ports=None, store_urls=None, task_rate_limit=None, tasks=None, tasks_running=None,
tasks_staged=None, tasks_healthy=None, tasks_unhealthy=None, upgrade_strategy=None, uris=None, user=None,
version=None):
def __init__(self, accepted_resource_roles=None, args=None, backoff_factor=None, backoff_seconds=None, cmd=None,
constraints=None, container=None, cpus=None, dependencies=None, deployments=None, disk=None, env=None,
executor=None, health_checks=None, id=None, instances=None, labels=None, last_task_failure=None,
max_launch_delay_seconds=None, mem=None, ports=None, require_ports=None, store_urls=None,
task_rate_limit=None, tasks=None, tasks_running=None, tasks_staged=None, tasks_healthy=None,
tasks_unhealthy=None, upgrade_strategy=None, uris=None, user=None, version=None):

# self.args = args or []
self.accepted_resource_roles = accepted_resource_roles
self.args = args
# Marathon 0.7.0-RC1 throws a validation error if this is [] and cmd is passed:
# "error": "AppDefinition must either contain a 'cmd' or a 'container'."
Expand Down