Example #1
0
def update_scheduled_actions(request, group_name):
    try:
        configs = _parse_actions_configs(request.POST, group_name)
        autoscaling_groups_helper.add_scheduled_actions(request, group_name, configs)
        return get_scheduled_actions(request, group_name)
    except:
        log.error(traceback.format_exc())
        return HttpResponse(json.dumps({'content': ""}), content_type="application/json")
Example #2
0
def update_scheduled_actions(request, group_name):
    try:
        configs = _parse_actions_configs(request.POST, group_name)
        autoscaling_groups_helper.add_scheduled_actions(request, group_name, configs)
        return get_scheduled_actions(request, group_name)
    except:
        log.error(traceback.format_exc())
        return HttpResponse(json.dumps({'content': ""}), content_type="application/json")
Example #3
0
def add_scheduled_actions(request, group_name):
    params = request.POST
    try:
        schedule_action = {}
        schedule_action['clusterName'] = group_name
        schedule_action['schedule'] = params['schedule']
        schedule_action['capacity'] = params['capacity']
        autoscaling_groups_helper.add_scheduled_actions(request, group_name, [schedule_action])
    except:
        log.error(traceback.format_exc())
    return redirect("/groups/{}/config/".format(group_name))
Example #4
0
def add_scheduled_actions(request, group_name):
    params = request.POST
    try:
        schedule_action = {}
        schedule_action['clusterName'] = group_name
        schedule_action['schedule'] = params['schedule']
        schedule_action['capacity'] = params['capacity']
        autoscaling_groups_helper.add_scheduled_actions(request, group_name, [schedule_action])
    except:
        log.error(traceback.format_exc())
    return redirect("/groups/{}/config/".format(group_name))