Esempio n. 1
0
def _get_xml_or_fail(getter_function, args):
    try:
        filters = get_filters_from_args(args)
    except InvalidArgumentsError as e:
        return Response("Invalid arguments: " + str(e), status=400)
    return Response(to_xml_bytes(getter_function(_get_authorized(), filters)),
                    mimetype="text/xml")
Esempio n. 2
0
def rgsummary_xml():
    try:
        filters = get_filters_from_args(request.args)
    except InvalidArgumentsError as e:
        return Response("Invalid arguments: " + str(e), status=400)

    authorized = _get_authorized()
    rgsummary = global_data.get_topology().get_resource_summary(authorized=authorized, filters=filters)
    return Response(to_xml_bytes(rgsummary), mimetype='text/xml')
Esempio n. 3
0
def vosummary_xml():
    try:
        filters = get_filters_from_args(request.args)
    except InvalidArgumentsError as e:
        return Response("Invalid arguments: " + str(e), status=400)

    authorized = _get_authorized()
    vos_xml = to_xml_bytes(global_data.get_vos_data().get_tree(authorized, filters))
    return Response(vos_xml, mimetype='text/xml')
Esempio n. 4
0
def miscuser_xml():
    authorized = _get_authorized()

    if not authorized:
        return Response("Access denied: user cert not found or not accepted",
                        status=403)
    return Response(to_xml_bytes(
        global_data.get_contacts_data().get_tree(authorized)),
                    mimetype='text/xml')
Esempio n. 5
0
def rgdowntime_xml():
    try:
        filters = get_filters_from_args(request.args)
    except InvalidArgumentsError as e:
        return Response("Invalid arguments: " + str(e), status=400)

    authorized = _get_authorized()

    rgdowntime = _get_topology().get_downtimes(authorized=authorized, filters=filters)
    return Response(to_xml_bytes(rgdowntime), mimetype='text/xml')
Esempio n. 6
0
def miscproject_xml():
    return Response(to_xml_bytes(global_data.get_projects()),
                    mimetype='text/xml')
Esempio n. 7
0
def miscuser_xml():
    return Response(to_xml_bytes(global_data.get_contacts_data().get_tree(
        _get_authorized())),
                    mimetype='text/xml')
Esempio n. 8
0
def miscproject_xml():
    global _projects
    if not _projects:
        _projects = get_projects()
    projects_xml = to_xml_bytes(_projects)
    return Response(projects_xml, mimetype='text/xml')