Exemplo n.º 1
0
def cluster_restart(r):
    """Start a cluster which should be in stopped status currently.

    :param r:
    :return:
    """
    cluster_id = request_get(r, "cluster_id")
    if not cluster_id:
        logger.warning("No cluster_id is given")
        return make_fail_resp("No cluster_id is given")
    if cluster_handler.restart(cluster_id):
        return make_ok_resp()

    return make_fail_resp("cluster restart failed")
Exemplo n.º 2
0
def cluster_restart(r):
    """Start a cluster which should be in stopped status currently.

    :param r:
    :return:
    """
    cluster_id = request_get(r, "cluster_id")
    if not cluster_id:
        logger.warning("No cluster_id is given")
        return make_fail_response("No cluster_id is given")
    if cluster_handler.restart(cluster_id):
        return make_ok_response()

    return make_fail_response("cluster restart failed")