예제 #1
0
def get_more_scaling_activities(request, group_name):
    params = request.GET
    token = params.get("token", "")
    try:
        scaling_activities_info = autoscaling_groups_helper.get_scaling_activities(
            request, group_name, 50, token)
        activities = scaling_activities_info["activities"]
        next_token = scaling_activities_info["nextToken"]

        if next_token:
            disableNext = False
        else:
            disableNext = True

        content = render_to_string(
            "groups/scaling_activities.tmpl", {
                "token": token,
                "group_name": group_name,
                "next_token": next_token,
                "activities": activities,
                "disableNext": disableNext,
            })
        return HttpResponse(json.dumps({"html": content}),
                            content_type="application/json")
    except:
        log.error(traceback.format_exc())
예제 #2
0
def get_scaling_activities(request, group_name):
    try:
        scaling_activities = autoscaling_groups_helper.get_scaling_activities(request, group_name, 10, "")
        content = render_to_string("groups/scaling_details.tmpl", {
            "group_name": group_name,
            "activities": scaling_activities["activities"],
        })
        return HttpResponse(json.dumps({"html": content}), content_type="application/json")
    except:
        log.error(traceback.format_exc())
예제 #3
0
def get_scaling_activities(request, group_name):
    try:
        scaling_activities = autoscaling_groups_helper.get_scaling_activities(request, group_name, 10, "")
        content = render_to_string("groups/scaling_details.tmpl", {
            "group_name": group_name,
            "activities": scaling_activities["activities"],
        })
        return HttpResponse(json.dumps({"html": content}), content_type="application/json")
    except:
        log.error(traceback.format_exc())
예제 #4
0
 def get(self, request, group_name):
     scaling_activities_info = autoscaling_groups_helper.get_scaling_activities(request, group_name, 50, "")
     activities = scaling_activities_info["activities"]
     next_token = scaling_activities_info["nextToken"]
     if next_token:
         disableNext = False
     else:
         disableNext = True
     return render(request, 'groups/scaling_activities.html', {
         "activities": activities,
         "next_token": next_token,
         "group_name": group_name,
         "disableNext": disableNext,
     })
예제 #5
0
 def get(self, request, group_name):
     scaling_activities_info = autoscaling_groups_helper.get_scaling_activities(request, group_name, 50, "")
     activities = scaling_activities_info["activities"]
     next_token = scaling_activities_info["nextToken"]
     if next_token:
         disableNext = False
     else:
         disableNext = True
     return render(request, 'groups/scaling_activities.html', {
         "activities": activities,
         "next_token": next_token,
         "group_name": group_name,
         "disableNext": disableNext,
     })
예제 #6
0
def get_more_scaling_activities(request, group_name):
    params = request.GET
    token = params.get("token", "")
    try:
        scaling_activities_info = autoscaling_groups_helper.get_scaling_activities(request, group_name, 50, token)
        activities = scaling_activities_info["activities"]
        next_token = scaling_activities_info["nextToken"]

        if next_token:
            disableNext = False
        else:
            disableNext = True

        content = render_to_string("groups/scaling_activities.tmpl", {
            "token": token,
            "group_name": group_name,
            "next_token": next_token,
            "activities": activities,
            "disableNext": disableNext,
        })
        return HttpResponse(json.dumps({"html": content}), content_type="application/json")
    except:
        log.error(traceback.format_exc())
def view_cluster_replacement_scaling_activities(request, name, stage):
    cluster_name = '{}-{}'.format(name, stage)
    scaling_activities = autoscaling_groups_helper.get_scaling_activities(
        request, cluster_name, 20, '')
    activities = json.dumps(scaling_activities["activities"])
    return HttpResponse(activities, content_type="application/json")
예제 #8
0
def view_cluster_replacement_scaling_activities(request, name, stage):
    cluster_name = '{}-{}'.format(name, stage)
    scaling_activities = autoscaling_groups_helper.get_scaling_activities(
        request, cluster_name, 20, '')
    activities = json.dumps(scaling_activities["activities"])
    return HttpResponse(activities, content_type="application/json")