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

MarathonClient().scale_group does not support force parameter #269

Open
Dabbling opened this issue Feb 6, 2020 · 0 comments
Open

MarathonClient().scale_group does not support force parameter #269

Dabbling opened this issue Feb 6, 2020 · 0 comments

Comments

@Dabbling
Copy link

Dabbling commented Feb 6, 2020

MarathonClient().scale_group does not support the force parameter. However, the force parameter is supported by the Marathon REST API in a PUT to /v2/groups/

http://mesosphere.github.io/marathon/api-console/index.html

Happy to do the pull request. Here is my suggested fix to marathon.client.MarathonClient

def scale_group(self, group_id, scale_by, force=False):
    """Scale a group by a factor.

    :param str group_id: group ID
    :param int scale_by: factor to scale by
    :param bool force: apply even if a deployment is in progress

    :returns: a dict containing the deployment id and version
    :rtype: dict
    """
    data = {'scaleBy': scale_by}
    params = {'force': force}
    response = self._do_request(
        'PUT', f'/v2/groups/{group_id}', data=json.dumps(data), params=params)
    return response.json()
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

1 participant