Skip to content

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

@Dabbling

Description

@Dabbling

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions