def get_system_specs(request): instance_types = specs_helper.get_instance_types(request) security_groups = specs_helper.get_security_groups(request) subnets = specs_helper.get_subnets(request) sorted_subnets = sorted(subnets, key=lambda subnet: subnet["info"]["tag"]) sorted_sgs = sorted(security_groups, key=lambda sg: sg["info"]["name"]) return instance_types, sorted_subnets, sorted_sgs
def get_instance_type_settings(request): instance_types = specs_helper.get_instance_types(request) curr_instance_type = request.GET.get("curr_instance_type", "") contents = render_to_string("groups/get_hosttype.tmpl", {"instance_types": instance_types, "curr_instance_type": curr_instance_type}) return HttpResponse(json.dumps(contents), content_type="application/json")