def get_hosts():
"""Return all hosts."""
#Check for query string, redirect to endpoint with trailling '/'.
if request.query_string:
return redirect(url_for('run_cmd') + '?' + request.query_string)
hosts = RSPET_API.get_hosts()
return jsonify({'hosts': [make_public_host(hosts[h_id], h_id) for h_id in hosts]})
评论列表
文章目录