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

Added two app parameters - tasks_healthy, tasks_unhealthy (marathon-0.8.1-RC2) #21

Merged
merged 1 commit into from
Mar 10, 2015
Merged
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
9 changes: 7 additions & 2 deletions marathon/models/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class MarathonApp(MarathonResource):
:type tasks: list[:class:`marathon.models.task.MarathonTask`]
:param int tasks_running: (read-only) the number of running tasks
:param int tasks_staged: (read-only) the number of staged tasks
:param int tasks_healthy: (read-only) the number of healthy tasks
:param int tasks_unhealthy: (read-only) the number of unhealthy tasks
:param upgrade_strategy: strategy by which app instances are replaced during a deployment
:type upgrade_strategy: :class:`marathon.models.app.MarathonUpgradeStrategy` or dict
:param list[str] uris: uris
Expand All @@ -60,14 +62,15 @@ class MarathonApp(MarathonResource):
CREATE_ONLY_ATTRIBUTES = ['id']
"""List of attributes that should only be passed on creation"""

READ_ONLY_ATTRIBUTES = ['deployments', 'tasks', 'tasks_running', 'tasks_staging']
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, upgrade_strategy=None, uris=None, user=None, version=None):
tasks_staged=None, tasks_healthy=None, tasks_unhealthy=None, upgrade_strategy=None, uris=None, user=None,
version=None):

# self.args = args or []
self.args = args
Expand Down Expand Up @@ -114,6 +117,8 @@ def __init__(self, args=None, backoff_factor=None, backoff_seconds=None, cmd=Non
]
self.tasks_running = tasks_running
self.tasks_staged = tasks_staged
self.tasks_healthy = tasks_healthy
self.tasks_unhealthy = tasks_unhealthy
self.upgrade_strategy = upgrade_strategy if (isinstance(upgrade_strategy, MarathonUpgradeStrategy) or upgrade_strategy is None) \
else MarathonUpgradeStrategy.from_json(upgrade_strategy)
self.uris = uris or []
Expand Down