Exemplo n.º 1
0
def oasis_managers():
    if not _get_authorized():
        return Response("Not authorized", status=403)
    vo = request.args.get("vo")
    if not vo:
        return Response("'vo' argument is required", status=400)
    if not cilogon_pass:
        return Response("CILOGON_LDAP_PASSFILE not configured; "
                        "OASIS Managers info unavailable", status=503)
    mgrs = get_oasis_manager_endpoint_info(global_data, vo, cilogon_pass)
    return Response(to_json_bytes(mgrs), mimetype='application/json')
Exemplo n.º 2
0
def miscresource_json():
    resources = {}
    topology = global_data.get_topology()
    for rg in topology.rgs.values():
        for resource in rg.resources_by_name.values():
            resources[resource.name] = {
                "Name": resource.name,
                "Site": rg.site.name,
                "Facility": rg.site.facility.name,
                "ResourceGroup": rg.name,
                **resource.get_tree()
            }

    return Response(to_json_bytes(resources), mimetype='application/json')
Exemplo n.º 3
0
def vosummary_json():
    return Response(to_json_bytes(
        simplify_attr_list(global_data.get_vos_data().get_expansion(),
                           namekey='Name')),
                    mimetype="application/json")
Exemplo n.º 4
0
def miscproject_json():
    projects = simplify_attr_list(
        global_data.get_projects()["Projects"]["Project"],
        namekey="Name",
        del_name=False)
    return Response(to_json_bytes(projects), mimetype='text/json')
Exemplo n.º 5
0
def miscproject_json():
    return Response(to_json_bytes(global_data.get_projects()),
                    mimetype='application/json')