Mentions légales du service

Skip to content
Snippets Groups Projects
Verified Commit 894eb0d2 authored by Philippe Virouleau's avatar Philippe Virouleau
Browse files

refapi: add a global json file for RE

parent c85613d7
No related branches found
No related tags found
1 merge request!728Generate access rules data in reference repository
...@@ -172,15 +172,26 @@ def generate_reference_api ...@@ -172,15 +172,26 @@ def generate_reference_api
) )
# # Generate the all-in-one json with just enough information for resources-explorer.
# Write the all-in-one json file all_in_one_hash = {
# "sites" => global_hash["sites"].to_h do |site_uid, site|
[site_uid, {
# rename entry for the all-in-on json file "uid" => site_uid,
global_hash["sites"].each do |_site_uid, site| "clusters" => site["clusters"].to_h do |cluster_uid, cluster|
site["network_equipments"] = site.delete("networks") [cluster_uid, {
end "uid" => cluster_uid,
"queues" => cluster["queues"],
"nodes" => cluster["nodes"].to_h do |node_uid, node|
[node_uid, node.select { |key| %w[uid nodeset gpu_devices processor architecture].include?(key) }]
end
}]
end
}]
end
}
# Write global json file - Disable this for now, see https://www.grid5000.fr/w/TechTeam:CT-220 # Write the global json file.
#write_json(grid_path.join(File.expand_path("../../#{global_hash['uid']}-all.json", File.dirname(__FILE__))), global_hash) # Writing the file at the root of the repository makes the full refrepo show
# up when GET-ing "/" in g5k-api, which we don't want; arbitrarily put it in accesses.
write_json(Pathname.new(refapi_path).join("accesses", "refrepo.json"), all_in_one_hash)
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment