@server_blueprint.route('/power-actions', methods=['POST'])
@login_required
def power_actions():
    request_data = request.get_json()
    pz_user_home = current_app.config['PZ_USER_HOME']
    power_action = request_data.get('power_action', None)
    if (not is_valid_power_action(power_action)):
        return (jsonify(error='Unknown action'), 400)
    if (not execute_action(power_action, pz_user_home)):
        return ('', 500)
    return jsonify(server_state=pz_server_state.state)
@server_blueprint.route('/power-actions', methods=['POST'])
@login_required
def power_actions():
    request_data = request.get_json()
    pz_user_home = current_app.config['PZ_USER_HOME']
    power_action = request_data.get('power_action', None)
    if (not is_valid_power_action(power_action)):
        return (jsonify(error='Unknown action'), 400)
    if (not execute_action(power_action, pz_user_home)):
        return (, 500)
    return jsonify(server_state=pz_server_state.state)