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")
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')
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')
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')
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')
def miscproject_xml(): return Response(to_xml_bytes(global_data.get_projects()), mimetype='text/xml')
def miscuser_xml(): return Response(to_xml_bytes(global_data.get_contacts_data().get_tree( _get_authorized())), mimetype='text/xml')
def miscproject_xml(): global _projects if not _projects: _projects = get_projects() projects_xml = to_xml_bytes(_projects) return Response(projects_xml, mimetype='text/xml')