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 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())
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, })
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")