Exemplo n.º 1
0
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
Exemplo n.º 2
0
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
Exemplo n.º 3
0
def get_sg_settings(request):
    security_groups = specs_helper.get_security_groups(request)
    sorted_sgs = sorted(security_groups, key=lambda sg: sg["info"]["name"])
    curr_sg = request.GET.get("curr_sg", "")
    contents = render_to_string("groups/get_sg.tmpl",
                                {"security_groups": sorted_sgs,
                                 "curr_sg": curr_sg})
    return HttpResponse(json.dumps(contents), content_type="application/json")
Exemplo n.º 4
0
def get_sg_settings(request):
    security_groups = specs_helper.get_security_groups(request)
    sorted_sgs = sorted(security_groups, key=lambda sg: sg["info"]["name"])
    curr_sg = request.GET.get("curr_sg", "")
    contents = render_to_string("groups/get_sg.tmpl",
                                {"security_groups": sorted_sgs,
                                 "curr_sg": curr_sg})
    return HttpResponse(json.dumps(contents), content_type="application/json")