From c189ac102f78dcabdcc45d2000425202332d0e0a Mon Sep 17 00:00:00 2001 From: Gaetan SIMO <gaetan.simo@inria.fr> Date: Mon, 2 Apr 2012 17:34:37 +0200 Subject: [PATCH] [network_equipments] added nancy network equipments --- Rakefile | 82 ++- .../sites/nancy/network_equipments/gw.json | 54 +- .../nancy/network_equipments/sgraphene1.json | 110 +--- .../nancy/network_equipments/sgraphene2.json | 102 +-- .../nancy/network_equipments/sgraphene3.json | 92 +-- .../nancy/network_equipments/sgraphene4.json | 109 +--- .../nancy/network_equipments/sgriffon1.json | 96 +-- .../nancy/network_equipments/sgriffon2.json | 85 +-- .../nancy/network_equipments/sgriffon3.json | 93 +-- .../nancy/network_equipments/stalc1.json | 158 +++++ .../nancy/network_equipments/stalc2.json | 155 +++++ .../nancy/network_equipments/stalc3.json | 155 +++++ generators/input/nancy/net-links.yaml | 589 ++++++++++++++++++ generators/input/net-links-generator.rb | 46 +- generators/input/toulouse/net-links/gw.yaml | 33 +- 15 files changed, 1345 insertions(+), 614 deletions(-) create mode 100644 data/grid5000/sites/nancy/network_equipments/stalc1.json create mode 100644 data/grid5000/sites/nancy/network_equipments/stalc2.json create mode 100644 data/grid5000/sites/nancy/network_equipments/stalc3.json create mode 100644 generators/input/nancy/net-links.yaml diff --git a/Rakefile b/Rakefile index 8edd97511e3..9f67625cdd4 100644 --- a/Rakefile +++ b/Rakefile @@ -14,7 +14,6 @@ $LOAD_PATH.unshift(EXTRA_DIR) unless $LOAD_PATH.include?(EXTRA_DIR) Rake.application.options.trace = true - require 'grid5000' require 'naming-pattern' @@ -112,7 +111,7 @@ namespace :netlinks do end return if neighbor.nil? - l = coord["linecard"] + l = (coord["linecard"]||0) p = coord["port"] linecards[l] = {"ports"=>{}} unless linecards.has_key? l ports = linecards[l]["ports"] @@ -211,7 +210,84 @@ namespace :netlinks do end # Print the result on a pretty message if message.empty? - @logger.warn "No host net-link has been formated. Please correct warnings first and your cli parameters." + @logger.warn "No host net-link has been formated. Please correct warnings and your cli parameters." + else + message.map!{|m| "* #{m}"} + message.unshift "Formated Network links were saved into the following files : " + message_size = message.max{|a,b|a.size <=> b.size}.size + puts "+-#{"-" * message_size}-+" + puts message.map{|m| "| #{m} "}.join("\n") + puts "+-#{"-" * message_size}-+" + end + end + desc "Update net-links.yaml with the kavlan like config file." + task :kavlan => [:environment,:hosts] do + config_file = ENV['CONF'] + abort "You must provide a CONF=, which is the path to the kavlan like config file." if config_file.nil? + host,site = @host.scan(/(\S+)\.(\S+)/).flatten + dirs = Dir.glob("generators/input/#{site}/") + if dirs.empty? + @logger.error "Failed to find a directory containing the net-links yaml file for your site '#{site}'" + next + end + message = [] + dirs.each do |dir| + site = File.basename(dir) + net_links_file = File.join(dir,"net-links.yaml") + net_links_dir = File.join(dir,"net-links") + + net_links = YAML::load_file(net_links_file) + net_links.keep_if do |uid,properties| + uid.match(Regexp.new(host.gsub(/\*/,'\S+'))) != nil + end + if net_links.empty? + @logger.warn "Failed to find any host described within the file #{net_links_file}." + else + # parse the kavlan like config file + config = {} + File.read(config_file).lines.each do |line| + if ((scan = line.strip.scan(/^([^.]+)\.([^.]+)\.grid5000\.fr\s+(\S+)\s+(\S+)$/)).size > 0) + uid,site,ifname,router = scan.flatten + config[router] = [] unless config.has_key? router + config[router].push({:uid=>uid,:ifname=>ifname}) + end + end + + updated = [] + # Update the net-links with kavlan config file + net_links.each do |uid,properties| + router = config[uid] + next if router.nil? + updated.push uid + # register interfaces naming patterns + patterns = {} + browse_naming_patterns(properties["linecards"],patterns) do |dict,raw_port| + format_port(dict,raw_port,properties["linecards"]) + end + # parse the ifname + router.each do |neighbor| + ifname = neighbor[:ifname] + # find the naming_pattern that correspond to this ifname + patterns.each do |np,cb| + # scan the ifname with each naming_pattern + dict = NamingPattern.encode(np,ifname) + unless dict.empty? + # Found the naming_pattern for this ifname + # So Place it where it belongs + cb.call(dict,neighbor) + break + end + end + end + end + # When all net links in a site are formated, we write them in they file. + File.open(net_links_file,'w'){|f| YAML::dump(net_links,f)} + message.push "#{net_links_file} hosts=#{updated.inspect}" + end + end + # Print the result on a pretty message + if message.empty? + @logger.warn "No host net-link has been formated. Please correct warnings and/or your cli parameters." else message.map!{|m| "* #{m}"} message.unshift "Formated Network links were saved into the following files : " diff --git a/data/grid5000/sites/nancy/network_equipments/gw.json b/data/grid5000/sites/nancy/network_equipments/gw.json index ca55aa513c9..4912d7cacf0 100644 --- a/data/grid5000/sites/nancy/network_equipments/gw.json +++ b/data/grid5000/sites/nancy/network_equipments/gw.json @@ -1,10 +1,15 @@ { + "channels": { + "naming_pattern": "Po%CHANNELID%" + }, "kind": "router", "linecards": [ { }, { + "kind": "switch", + "naming_pattern": "%LINECARD:A%%PORT%", "ports": [ { @@ -16,43 +21,39 @@ }, { - "kind": "switch", - "rate": 10000000000, "uid": "sgraphene3" }, { - "kind": "switch", - "rate": 10000000000, "uid": "sgriffon2" } - ] + ], + "rate": 10000 }, { + "kind": "switch", + "naming_pattern": "%LINECARD:A%%PORT%", "ports": [ { }, { - "kind": "switch", - "rate": 10000000000, "uid": "sgraphene1" }, { - "kind": "switch", - "rate": 10000000000, "uid": "sgraphene2" }, { }, { - "kind": "switch", - "rate": 10000000000, "uid": "sgraphene4" } - ] + ], + "rate": 10000 }, { + "kind": "switch", + "naming_pattern": "%LINECARD:A%%PORT%", "ports": [ { @@ -64,33 +65,24 @@ }, { - "kind": "switch", - "rate": 10000000000, "uid": "sgriffon3" }, { - "kind": "switch", - "rate": 10000000000, "uid": "sgriffon1" } - ] + ], + "rate": 10000 } ], - "mac": "00:18:71:d7:e9:00", "model": "HP Procurve 5406zl", - "networks": [ - { - "cidr": "172.16.64.0/20", - "kind": "default" - }, - { - "cidr": "10.144.0.0/14", - "kind": "virtual" - } - ], - "trunks": [ + "routes": { - ], + }, + "site_uid": "nancy", + "snmp_community": "public", "type": "network_equipment", - "uid": "gw" + "uid": "gw", + "vlans": { + "naming_pattern": "Vlan%VLANID%" + } } \ No newline at end of file diff --git a/data/grid5000/sites/nancy/network_equipments/sgraphene1.json b/data/grid5000/sites/nancy/network_equipments/sgraphene1.json index b6eaded4734..7606f81c53b 100644 --- a/data/grid5000/sites/nancy/network_equipments/sgraphene1.json +++ b/data/grid5000/sites/nancy/network_equipments/sgraphene1.json @@ -1,229 +1,165 @@ { + "channels": { + "naming_pattern": "Po%CHANNELID%" + }, "kind": "switch", "linecards": [ { + "kind": "node", + "naming_pattern": "%PORT%", "ports": [ { }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-2" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-1" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-4" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-3" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-6" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-5" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-10" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-7" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-12" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-11" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-9" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-8" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-14" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-13" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-16" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-15" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-18" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-17" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-20" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-19" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-22" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-21" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-24" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-23" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-26" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-25" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-28" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-27" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-30" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-29" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-32" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-31" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-34" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-33" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-36" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-35" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-38" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-37" }, { }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-39" } - ] + ], + "rate": 1000 }, { + "kind": "router", + "naming_pattern": "%LINECARD:A%%PORT%", "ports": [ { }, { - "kind": "switch", - "rate": 10000000000, - "uid": "sgravillon1" + + }, + { + "uid": "gw" } - ] + ], + "rate": 10000 } ], - "mac": "40:01:c6:8b:e4:81", "model": "3com 4500g", - "trunks": [ + "routes": { - ], + }, + "site_uid": "nancy", + "snmp_community": "public", "type": "network_equipment", - "uid": "sgraphene1" + "uid": "sgraphene1", + "vlans": { + "naming_pattern": "Vlan%VLANID%" + } } \ No newline at end of file diff --git a/data/grid5000/sites/nancy/network_equipments/sgraphene2.json b/data/grid5000/sites/nancy/network_equipments/sgraphene2.json index ba93f73b66f..3f60b6f75d1 100644 --- a/data/grid5000/sites/nancy/network_equipments/sgraphene2.json +++ b/data/grid5000/sites/nancy/network_equipments/sgraphene2.json @@ -1,206 +1,150 @@ { + "channels": { + "naming_pattern": "Po%CHANNELID%" + }, "kind": "switch", "linecards": [ { + "kind": "node", + "naming_pattern": "%PORT%", "ports": [ { }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-40" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-41" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-42" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-43" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-44" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-45" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-46" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-47" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-48" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-49" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-50" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-51" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-52" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-53" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-54" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-55" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-56" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-57" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-58" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-59" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-60" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-61" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-62" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-63" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-64" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-65" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-66" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-67" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-68" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-69" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-70" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-71" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-72" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-73" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-74" } - ] + ], + "rate": 1000 }, { + "kind": "router", + "naming_pattern": "%LINECARD:A%%PORT%", "ports": [ { }, { - "kind": "switch", - "rate": 10000000000, - "uid": "sgravillon1" + + }, + { + "uid": "gw" } - ] + ], + "rate": 10000 } ], - "mac": "40:01:c6:8c:06:01", "model": "3com 4500g", - "trunks": [ + "routes": { - ], + }, + "site_uid": "nancy", + "snmp_community": "public", "type": "network_equipment", - "uid": "sgraphene2" + "uid": "sgraphene2", + "vlans": { + "naming_pattern": "Vlan%VLANID%" + } } \ No newline at end of file diff --git a/data/grid5000/sites/nancy/network_equipments/sgraphene3.json b/data/grid5000/sites/nancy/network_equipments/sgraphene3.json index 86ad280a0cf..d24575e727d 100644 --- a/data/grid5000/sites/nancy/network_equipments/sgraphene3.json +++ b/data/grid5000/sites/nancy/network_equipments/sgraphene3.json @@ -1,181 +1,135 @@ { + "channels": { + "naming_pattern": "Po%CHANNELID%" + }, "kind": "switch", "linecards": [ { + "kind": "node", + "naming_pattern": "%PORT%", "ports": [ { }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-76" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-75" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-78" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-77" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-80" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-79" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-82" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-81" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-84" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-83" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-86" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-85" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-88" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-87" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-90" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-89" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-92" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-91" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-94" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-93" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-96" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-95" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-98" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-97" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-100" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-99" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-102" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-101" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-104" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-103" } - ] + ], + "rate": 1000 }, { + "kind": "router", + "naming_pattern": "%LINECARD:A%%PORT%", "ports": [ { }, { - "kind": "switch", - "rate": 10000000000, - "uid": "sgravillon1" + + }, + { + "uid": "gw" } - ] + ], + "rate": 10000 } ], - "mac": "40:01:c6:8b:c2:01", "model": "3com 4500g", - "trunks": [ + "routes": { - ], + }, + "site_uid": "nancy", + "snmp_community": "public", "type": "network_equipment", - "uid": "sgraphene3" + "uid": "sgraphene3", + "vlans": { + "naming_pattern": "Vlan%VLANID%" + } } \ No newline at end of file diff --git a/data/grid5000/sites/nancy/network_equipments/sgraphene4.json b/data/grid5000/sites/nancy/network_equipments/sgraphene4.json index d82f8a54d9b..2c1c598ae6b 100644 --- a/data/grid5000/sites/nancy/network_equipments/sgraphene4.json +++ b/data/grid5000/sites/nancy/network_equipments/sgraphene4.json @@ -1,231 +1,162 @@ { + "channels": { + "naming_pattern": "Po%CHANNELID%" + }, "kind": "switch", "linecards": [ { + "kind": "node", + "naming_pattern": "%PORT%", "ports": [ { }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-105" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-106" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-107" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-108" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-109" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-110" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-111" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-112" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-113" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-114" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-115" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-116" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-117" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-118" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-119" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-120" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-121" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-122" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-123" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-124" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-125" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-126" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-127" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-128" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-129" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-130" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-131" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-132" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-133" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-134" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-135" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-136" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-137" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-138" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-139" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-140" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-141" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-142" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-143" }, { - "kind": "node", - "rate": 1000000000, "uid": "graphene-144" } - ] + ], + "rate": 1000 }, { + "kind": "router", + "naming_pattern": "%LINECARD:A%%PORT%", "ports": [ { }, { - "kind": "switch", - "rate": 10000000000, - "uid": "sgravillon1" + "uid": "gw" } - ] + ], + "rate": 10000 } ], - "mac": "40:01:c6:8b:ee:01", "model": "3com 4500g", - "trunks": [ + "routes": { - ], + }, + "site_uid": "nancy", + "snmp_community": "public", "type": "network_equipment", - "uid": "sgraphene4" + "uid": "sgraphene4", + "vlans": { + "naming_pattern": "Vlan%VLANID%" + } } \ No newline at end of file diff --git a/data/grid5000/sites/nancy/network_equipments/sgriffon1.json b/data/grid5000/sites/nancy/network_equipments/sgriffon1.json index e6dc8719c4e..5a2e7408147 100644 --- a/data/grid5000/sites/nancy/network_equipments/sgriffon1.json +++ b/data/grid5000/sites/nancy/network_equipments/sgriffon1.json @@ -1,74 +1,53 @@ { + "channels": { + "naming_pattern": "Po%CHANNELID%" + }, "kind": "switch", "linecards": [ { + "kind": "node", + "naming_pattern": "%PORT%", "ports": [ { }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-1" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-2" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-3" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-4" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-5" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-6" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-7" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-8" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-10" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-9" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-58" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-59" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-60" }, { @@ -105,106 +84,68 @@ }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-11" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-12" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-13" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-14" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-15" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-16" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-17" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-18" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-19" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-20" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-21" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-22" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-23" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-24" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-25" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-26" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-27" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-28" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-29" } - ] - }, - { - + ], + "rate": 1000 }, { + "kind": "router", + "naming_pattern": "%LINECARD:A%%PORT%", "ports": [ { @@ -213,18 +154,21 @@ }, { - "kind": "switch", - "rate": 10000000000, - "uid": "sgravillon1" + "uid": "gw" } - ] + ], + "rate": 10000 } ], - "mac": "00:22:57:39:f1:81", "model": "3com 4500g", - "trunks": [ + "routes": { - ], + }, + "site_uid": "nancy", + "snmp_community": "public", "type": "network_equipment", - "uid": "sgriffon1" + "uid": "sgriffon1", + "vlans": { + "naming_pattern": "Vlan%VLANID%" + } } \ No newline at end of file diff --git a/data/grid5000/sites/nancy/network_equipments/sgriffon2.json b/data/grid5000/sites/nancy/network_equipments/sgriffon2.json index 6c6b1999408..12f3a9470d8 100644 --- a/data/grid5000/sites/nancy/network_equipments/sgriffon2.json +++ b/data/grid5000/sites/nancy/network_equipments/sgriffon2.json @@ -1,54 +1,41 @@ { + "channels": { + "naming_pattern": "Po%CHANNELID%" + }, "kind": "switch", "linecards": [ { + "kind": "node", + "naming_pattern": "%PORT%", "ports": [ { }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-30" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-31" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-32" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-33" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-34" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-35" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-36" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-37" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-38" }, { @@ -97,120 +84,88 @@ }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-39" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-40" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-41" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-42" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-43" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-44" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-45" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-46" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-47" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-48" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-49" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-51" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-50" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-52" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-53" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-54" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-55" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-56" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-57" } - ] + ], + "rate": 1000 }, { + "kind": "router", + "naming_pattern": "%LINECARD:A%%PORT%", "ports": [ { }, { - "kind": "switch", - "rate": 10000000000, - "uid": "sgravillon1" + "uid": "gw" } - ] + ], + "rate": 10000 } ], - "mac": "00:22:57:39:eb:81", "model": "3com 4500g", - "trunks": [ + "routes": { - ], + }, + "site_uid": "nancy", + "snmp_community": "public", "type": "network_equipment", - "uid": "sgriffon2" + "uid": "sgriffon2", + "vlans": { + "naming_pattern": "Vlan%VLANID%" + } } \ No newline at end of file diff --git a/data/grid5000/sites/nancy/network_equipments/sgriffon3.json b/data/grid5000/sites/nancy/network_equipments/sgriffon3.json index 275c9ba2a20..8b479d7e225 100644 --- a/data/grid5000/sites/nancy/network_equipments/sgriffon3.json +++ b/data/grid5000/sites/nancy/network_equipments/sgriffon3.json @@ -1,7 +1,12 @@ { + "channels": { + "naming_pattern": "Po%CHANNELID%" + }, "kind": "switch", "linecards": [ { + "kind": "node", + "naming_pattern": "%PORT%", "ports": [ { @@ -16,63 +21,39 @@ }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-61" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-62" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-63" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-64" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-65" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-66" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-67" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-68" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-69" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-70" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-71" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-72" }, { @@ -103,125 +84,91 @@ }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-73" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-74" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-75" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-76" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-77" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-78" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-79" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-80" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-81" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-82" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-83" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-84" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-85" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-86" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-87" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-88" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-89" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-90" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-91" }, { - "kind": "node", - "rate": 1000000000, "uid": "griffon-92" } - ] + ], + "rate": 1000 }, { + "kind": "router", + "naming_pattern": "%LINECARD:A%%PORT%", "ports": [ { }, { - "kind": "switch", - "rate": 10000000000, - "uid": "sgravillon1" + "uid": "gw" } - ] + ], + "rate": 10000 } ], - "mac": "00:22:57:39:e6:01", "model": "3com 4500g", - "trunks": [ + "routes": { - ], + }, + "site_uid": "nancy", + "snmp_community": "public", "type": "network_equipment", - "uid": "sgriffon3" + "uid": "sgriffon3", + "vlans": { + "naming_pattern": "Vlan%VLANID%" + } } \ No newline at end of file diff --git a/data/grid5000/sites/nancy/network_equipments/stalc1.json b/data/grid5000/sites/nancy/network_equipments/stalc1.json new file mode 100644 index 00000000000..76c1480918f --- /dev/null +++ b/data/grid5000/sites/nancy/network_equipments/stalc1.json @@ -0,0 +1,158 @@ +{ + "channels": { + "naming_pattern": "Po%CHANNELID%" + }, + "kind": "switch", + "linecards": [ + { + "kind": "node", + "naming_pattern": "%PORT%", + "ports": [ + { + + }, + { + "uid": "talc-1" + }, + { + + }, + { + "uid": "talc-2" + }, + { + + }, + { + "uid": "talc-134" + }, + { + "uid": "talc-3" + }, + { + "uid": "talc-4" + }, + { + "uid": "talc-5" + }, + { + "uid": "talc-6" + }, + { + "uid": "talc-7" + }, + { + "uid": "talc-8" + }, + { + "uid": "talc-9" + }, + { + "uid": "talc-10" + }, + { + "uid": "talc-11" + }, + { + "uid": "talc-12" + }, + { + "uid": "talc-13" + }, + { + "uid": "talc-14" + }, + { + "uid": "talc-15" + }, + { + "uid": "talc-16" + }, + { + "uid": "talc-17" + }, + { + "uid": "talc-18" + }, + { + + }, + { + + }, + { + + }, + { + "uid": "talc-19" + }, + { + "uid": "talc-20" + }, + { + "uid": "talc-21" + }, + { + "uid": "talc-22" + }, + { + "uid": "talc-23" + }, + { + "uid": "talc-24" + }, + { + "uid": "talc-25" + }, + { + "uid": "talc-26" + }, + { + "uid": "talc-27" + }, + { + "uid": "talc-28" + }, + { + "uid": "talc-29" + }, + { + "uid": "talc-30" + }, + { + "uid": "talc-31" + }, + { + "uid": "talc-32" + }, + { + "uid": "talc-33" + }, + { + "uid": "talc-34" + }, + { + "uid": "talc-35" + }, + { + "uid": "talc-36" + }, + { + "uid": "talc-37" + } + ], + "rate": 1000 + } + ], + "model": "hp procurve", + "routes": { + + }, + "site_uid": "nancy", + "snmp_community": "public", + "type": "network_equipment", + "uid": "stalc1", + "vlans": { + "naming_pattern": "Vlan%VLANID%" + } +} \ No newline at end of file diff --git a/data/grid5000/sites/nancy/network_equipments/stalc2.json b/data/grid5000/sites/nancy/network_equipments/stalc2.json new file mode 100644 index 00000000000..7087b2d0f5e --- /dev/null +++ b/data/grid5000/sites/nancy/network_equipments/stalc2.json @@ -0,0 +1,155 @@ +{ + "channels": { + "naming_pattern": "Po%CHANNELID%" + }, + "kind": "switch", + "linecards": [ + { + "kind": "node", + "naming_pattern": "%PORT%", + "ports": [ + { + + }, + { + + }, + { + + }, + { + "uid": "talc-38" + }, + { + "uid": "talc-39" + }, + { + "uid": "talc-40" + }, + { + "uid": "talc-41" + }, + { + "uid": "talc-42" + }, + { + "uid": "talc-43" + }, + { + "uid": "talc-44" + }, + { + "uid": "talc-45" + }, + { + "uid": "talc-46" + }, + { + "uid": "talc-47" + }, + { + "uid": "talc-48" + }, + { + "uid": "talc-49" + }, + { + + }, + { + + }, + { + + }, + { + + }, + { + + }, + { + + }, + { + + }, + { + + }, + { + + }, + { + + }, + { + "uid": "talc-50" + }, + { + "uid": "talc-51" + }, + { + "uid": "talc-52" + }, + { + "uid": "talc-53" + }, + { + "uid": "talc-54" + }, + { + "uid": "talc-55" + }, + { + "uid": "talc-56" + }, + { + "uid": "talc-57" + }, + { + "uid": "talc-58" + }, + { + "uid": "talc-59" + }, + { + "uid": "talc-60" + }, + { + "uid": "talc-61" + }, + { + "uid": "talc-62" + }, + { + "uid": "talc-63" + }, + { + "uid": "talc-64" + }, + { + "uid": "talc-65" + }, + { + "uid": "talc-66" + }, + { + "uid": "talc-67" + } + ], + "rate": 1000 + } + ], + "model": "hp procurve", + "routes": { + + }, + "site_uid": "nancy", + "snmp_community": "public", + "type": "network_equipment", + "uid": "stalc2", + "vlans": { + "naming_pattern": "Vlan%VLANID%" + } +} \ No newline at end of file diff --git a/data/grid5000/sites/nancy/network_equipments/stalc3.json b/data/grid5000/sites/nancy/network_equipments/stalc3.json new file mode 100644 index 00000000000..6f48696ccd2 --- /dev/null +++ b/data/grid5000/sites/nancy/network_equipments/stalc3.json @@ -0,0 +1,155 @@ +{ + "channels": { + "naming_pattern": "Po%CHANNELID%" + }, + "kind": "switch", + "linecards": [ + { + "kind": "node", + "naming_pattern": "%PORT%", + "ports": [ + { + + }, + { + "uid": "talc-68" + }, + { + "uid": "talc-69" + }, + { + "uid": "talc-70" + }, + { + "uid": "talc-71" + }, + { + "uid": "talc-72" + }, + { + "uid": "talc-73" + }, + { + "uid": "talc-74" + }, + { + "uid": "talc-75" + }, + { + "uid": "talc-76" + }, + { + "uid": "talc-77" + }, + { + "uid": "talc-78" + }, + { + "uid": "talc-79" + }, + { + "uid": "talc-80" + }, + { + "uid": "talc-81" + }, + { + "uid": "talc-82" + }, + { + "uid": "talc-83" + }, + { + "uid": "talc-84" + }, + { + "uid": "talc-85" + }, + { + "uid": "talc-86" + }, + { + "uid": "talc-87" + }, + { + + }, + { + + }, + { + + }, + { + + }, + { + "uid": "talc-88" + }, + { + "uid": "talc-89" + }, + { + "uid": "talc-90" + }, + { + "uid": "talc-91" + }, + { + "uid": "talc-92" + }, + { + "uid": "talc-93" + }, + { + "uid": "talc-94" + }, + { + "uid": "talc-95" + }, + { + "uid": "talc-96" + }, + { + "uid": "talc-97" + }, + { + "uid": "talc-98" + }, + { + "uid": "talc-99" + }, + { + "uid": "talc-100" + }, + { + "uid": "talc-101" + }, + { + "uid": "talc-102" + }, + { + "uid": "talc-103" + }, + { + "uid": "talc-104" + }, + { + "uid": "talc-133" + } + ], + "rate": 1000 + } + ], + "model": "hp procurve", + "routes": { + + }, + "site_uid": "nancy", + "snmp_community": "public", + "type": "network_equipment", + "uid": "stalc3", + "vlans": { + "naming_pattern": "Vlan%VLANID%" + } +} \ No newline at end of file diff --git a/generators/input/nancy/net-links.yaml b/generators/input/nancy/net-links.yaml new file mode 100644 index 00000000000..7a279c9300c --- /dev/null +++ b/generators/input/nancy/net-links.yaml @@ -0,0 +1,589 @@ +--- +gw: + model: HP Procurve 5406zl + kind: router + site: nancy + snmp_community: public + vlans: + naming_pattern: Vlan%VLANID% + routes: {} + + linecards: + 1: + naming_pattern: "%LINECARD:A%%PORT%" + kind: switch + rate: 10000 + ports: + 3: sgraphene3 + 4: sgriffon2 + 2: + naming_pattern: "%LINECARD:A%%PORT%" + kind: switch + rate: 10000 + ports: + 1: sgraphene1 + 2: sgraphene2 + 4: sgraphene4 + 3: + naming_pattern: "%LINECARD:A%%PORT%" + kind: switch + rate: 10000 + ports: + 3: sgriffon3 + 4: sgriffon1 + channels: + naming_pattern: Po%CHANNELID% +sgraphene1: + model: 3com 4500g + kind: switch + site: nancy + snmp_community: public + vlans: + naming_pattern: Vlan%VLANID% + routes: {} + + linecards: + 0: + naming_pattern: "%PORT%" + kind: node + rate: 1000 + ports: + 2: graphene-1 + 1: graphene-2 + 4: graphene-3 + 3: graphene-4 + 6: graphene-5 + 5: graphene-6 + 8: graphene-7 + 12: graphene-8 + 11: graphene-9 + 7: graphene-10 + 10: graphene-11 + 9: graphene-12 + 14: graphene-13 + 13: graphene-14 + 16: graphene-15 + 15: graphene-16 + 18: graphene-17 + 17: graphene-18 + 20: graphene-19 + 19: graphene-20 + 22: graphene-21 + 21: graphene-22 + 24: graphene-23 + 23: graphene-24 + 26: graphene-25 + 25: graphene-26 + 28: graphene-27 + 27: graphene-28 + 30: graphene-29 + 29: graphene-30 + 32: graphene-31 + 31: graphene-32 + 34: graphene-33 + 33: graphene-34 + 36: graphene-35 + 35: graphene-36 + 38: graphene-37 + 37: graphene-38 + 40: graphene-39 + 1: + naming_pattern: "%LINECARD:A%%PORT%" + kind: router + rate: 10000 + ports: + 2: gw + channels: + naming_pattern: Po%CHANNELID% +sgraphene2: + model: 3com 4500g + kind: switch + site: nancy + snmp_community: public + vlans: + naming_pattern: Vlan%VLANID% + routes: {} + + linecards: + 0: + naming_pattern: "%PORT%" + kind: node + rate: 1000 + ports: + 2: graphene-41 + 1: graphene-40 + 3: graphene-42 + 4: graphene-43 + 5: graphene-44 + 6: graphene-45 + 7: graphene-46 + 8: graphene-47 + 9: graphene-48 + 10: graphene-49 + 11: graphene-50 + 12: graphene-51 + 13: graphene-52 + 14: graphene-53 + 15: graphene-54 + 16: graphene-55 + 17: graphene-56 + 18: graphene-57 + 19: graphene-58 + 20: graphene-59 + 21: graphene-60 + 22: graphene-61 + 23: graphene-62 + 24: graphene-63 + 25: graphene-64 + 26: graphene-65 + 27: graphene-66 + 28: graphene-67 + 29: graphene-68 + 30: graphene-69 + 31: graphene-70 + 32: graphene-71 + 33: graphene-72 + 34: graphene-73 + 35: graphene-74 + 1: + naming_pattern: "%LINECARD:A%%PORT%" + kind: router + rate: 10000 + ports: + 2: gw + channels: + naming_pattern: Po%CHANNELID% +sgraphene3: + model: 3com 4500g + kind: switch + site: nancy + snmp_community: public + vlans: + naming_pattern: Vlan%VLANID% + routes: {} + + linecards: + 0: + naming_pattern: "%PORT%" + kind: node + rate: 1000 + ports: + 2: graphene-75 + 1: graphene-76 + 4: graphene-77 + 3: graphene-78 + 6: graphene-79 + 5: graphene-80 + 8: graphene-81 + 7: graphene-82 + 10: graphene-83 + 9: graphene-84 + 12: graphene-85 + 11: graphene-86 + 14: graphene-87 + 13: graphene-88 + 16: graphene-89 + 15: graphene-90 + 18: graphene-91 + 17: graphene-92 + 20: graphene-93 + 19: graphene-94 + 22: graphene-95 + 21: graphene-96 + 24: graphene-97 + 23: graphene-98 + 26: graphene-99 + 25: graphene-100 + 28: graphene-101 + 27: graphene-102 + 30: graphene-103 + 29: graphene-104 + 1: + naming_pattern: "%LINECARD:A%%PORT%" + kind: router + rate: 10000 + ports: + 2: gw + channels: + naming_pattern: Po%CHANNELID% +sgraphene4: + model: 3com 4500g + kind: switch + site: nancy + snmp_community: public + vlans: + naming_pattern: Vlan%VLANID% + routes: {} + + linecards: + 0: + naming_pattern: "%PORT%" + kind: node + rate: 1000 + ports: + 2: graphene-106 + 1: graphene-105 + 3: graphene-107 + 4: graphene-108 + 5: graphene-109 + 6: graphene-110 + 7: graphene-111 + 8: graphene-112 + 9: graphene-113 + 10: graphene-114 + 11: graphene-115 + 12: graphene-116 + 13: graphene-117 + 14: graphene-118 + 15: graphene-119 + 16: graphene-120 + 17: graphene-121 + 18: graphene-122 + 19: graphene-123 + 20: graphene-124 + 21: graphene-125 + 22: graphene-126 + 23: graphene-127 + 24: graphene-128 + 25: graphene-129 + 26: graphene-130 + 27: graphene-131 + 28: graphene-132 + 29: graphene-133 + 30: graphene-134 + 31: graphene-135 + 32: graphene-136 + 33: graphene-137 + 34: graphene-138 + 35: graphene-139 + 36: graphene-140 + 37: graphene-141 + 38: graphene-142 + 39: graphene-143 + 40: graphene-144 + 1: + naming_pattern: "%LINECARD:A%%PORT%" + kind: router + rate: 10000 + ports: + 1: gw + channels: + naming_pattern: Po%CHANNELID% +sgriffon1: + model: 3com 4500g + kind: switch + site: nancy + snmp_community: public + vlans: + naming_pattern: Vlan%VLANID% + routes: {} + + linecards: + 0: + naming_pattern: "%PORT%" + kind: node + rate: 1000 + ports: + 2: griffon-2 + 1: griffon-1 + 3: griffon-3 + 4: griffon-4 + 5: griffon-5 + 6: griffon-6 + 7: griffon-7 + 8: griffon-8 + 10: griffon-9 + 9: griffon-10 + 25: griffon-11 + 26: griffon-12 + 27: griffon-13 + 28: griffon-14 + 29: griffon-15 + 30: griffon-16 + 31: griffon-17 + 32: griffon-18 + 33: griffon-19 + 34: griffon-20 + 35: griffon-21 + 36: griffon-22 + 37: griffon-23 + 38: griffon-24 + 39: griffon-25 + 40: griffon-26 + 41: griffon-27 + 42: griffon-28 + 43: griffon-29 + 11: griffon-58 + 12: griffon-59 + 13: griffon-60 + 1: + naming_pattern: "%LINECARD:A%%PORT%" + kind: router + rate: 10000 + ports: + 2: gw + channels: + naming_pattern: Po%CHANNELID% +sgriffon2: + model: 3com 4500g + kind: switch + site: nancy + snmp_community: public + vlans: + naming_pattern: Vlan%VLANID% + routes: {} + + linecards: + 0: + naming_pattern: "%PORT%" + kind: node + rate: 1000 + ports: + 2: griffon-31 + 1: griffon-30 + 3: griffon-32 + 4: griffon-33 + 5: griffon-34 + 6: griffon-35 + 7: griffon-36 + 8: griffon-37 + 9: griffon-38 + 25: griffon-39 + 26: griffon-40 + 27: griffon-41 + 28: griffon-42 + 29: griffon-43 + 30: griffon-44 + 31: griffon-45 + 32: griffon-46 + 33: griffon-47 + 34: griffon-48 + 35: griffon-49 + 37: griffon-50 + 36: griffon-51 + 38: griffon-52 + 39: griffon-53 + 40: griffon-54 + 41: griffon-55 + 42: griffon-56 + 43: griffon-57 + 1: + naming_pattern: "%LINECARD:A%%PORT%" + kind: router + rate: 10000 + ports: + 1: gw + channels: + naming_pattern: Po%CHANNELID% +sgriffon3: + model: 3com 4500g + kind: switch + site: nancy + snmp_community: public + vlans: + naming_pattern: Vlan%VLANID% + routes: {} + + linecards: + 0: + naming_pattern: "%PORT%" + kind: node + rate: 1000 + ports: + 4: griffon-61 + 5: griffon-62 + 6: griffon-63 + 7: griffon-64 + 8: griffon-65 + 9: griffon-66 + 10: griffon-67 + 11: griffon-68 + 12: griffon-69 + 13: griffon-70 + 14: griffon-71 + 15: griffon-72 + 25: griffon-73 + 26: griffon-74 + 27: griffon-75 + 28: griffon-76 + 29: griffon-77 + 30: griffon-78 + 31: griffon-79 + 32: griffon-80 + 33: griffon-81 + 34: griffon-82 + 35: griffon-83 + 36: griffon-84 + 37: griffon-85 + 38: griffon-86 + 39: griffon-87 + 40: griffon-88 + 41: griffon-89 + 42: griffon-90 + 43: griffon-91 + 44: griffon-92 + 1: + naming_pattern: "%LINECARD:A%%PORT%" + kind: router + rate: 10000 + ports: + 1: gw + channels: + naming_pattern: Po%CHANNELID% +stalc1: + model: hp procurve + kind: switch + site: nancy + snmp_community: public + vlans: + naming_pattern: Vlan%VLANID% + routes: {} + + linecards: + 0: + naming_pattern: "%PORT%" + kind: node + rate: 1000 + ports: + 1: talc-1 + 3: talc-2 + 6: talc-3 + 7: talc-4 + 8: talc-5 + 9: talc-6 + 10: talc-7 + 11: talc-8 + 12: talc-9 + 13: talc-10 + 14: talc-11 + 15: talc-12 + 16: talc-13 + 17: talc-14 + 18: talc-15 + 19: talc-16 + 20: talc-17 + 21: talc-18 + 25: talc-19 + 26: talc-20 + 27: talc-21 + 28: talc-22 + 29: talc-23 + 30: talc-24 + 31: talc-25 + 32: talc-26 + 33: talc-27 + 34: talc-28 + 35: talc-29 + 36: talc-30 + 37: talc-31 + 38: talc-32 + 39: talc-33 + 40: talc-34 + 41: talc-35 + 42: talc-36 + 43: talc-37 + 5: talc-134 + channels: + naming_pattern: Po%CHANNELID% +stalc2: + model: hp procurve + kind: switch + site: nancy + snmp_community: public + vlans: + naming_pattern: Vlan%VLANID% + routes: {} + + linecards: + 0: + naming_pattern: "%PORT%" + kind: node + rate: 1000 + ports: + 3: talc-38 + 4: talc-39 + 5: talc-40 + 6: talc-41 + 7: talc-42 + 8: talc-43 + 9: talc-44 + 10: talc-45 + 11: talc-46 + 12: talc-47 + 13: talc-48 + 14: talc-49 + 25: talc-50 + 26: talc-51 + 27: talc-52 + 28: talc-53 + 29: talc-54 + 30: talc-55 + 31: talc-56 + 32: talc-57 + 33: talc-58 + 34: talc-59 + 35: talc-60 + 36: talc-61 + 37: talc-62 + 38: talc-63 + 39: talc-64 + 40: talc-65 + 41: talc-66 + 42: talc-67 + channels: + naming_pattern: Po%CHANNELID% +stalc3: + model: hp procurve + kind: switch + site: nancy + snmp_community: public + vlans: + naming_pattern: Vlan%VLANID% + routes: {} + + linecards: + 0: + naming_pattern: "%PORT%" + kind: node + rate: 1000 + ports: + 2: talc-69 + 1: talc-68 + 3: talc-70 + 4: talc-71 + 5: talc-72 + 6: talc-73 + 7: talc-74 + 8: talc-75 + 9: talc-76 + 10: talc-77 + 11: talc-78 + 12: talc-79 + 13: talc-80 + 14: talc-81 + 15: talc-82 + 16: talc-83 + 17: talc-84 + 18: talc-85 + 19: talc-86 + 20: talc-87 + 25: talc-88 + 26: talc-89 + 27: talc-90 + 28: talc-91 + 29: talc-92 + 30: talc-93 + 31: talc-94 + 32: talc-95 + 33: talc-96 + 34: talc-97 + 35: talc-98 + 36: talc-99 + 37: talc-100 + 38: talc-101 + 39: talc-102 + 40: talc-103 + 41: talc-104 + 42: talc-133 + channels: + naming_pattern: Po%CHANNELID% diff --git a/generators/input/net-links-generator.rb b/generators/input/net-links-generator.rb index 342af2610db..573d68c255b 100644 --- a/generators/input/net-links-generator.rb +++ b/generators/input/net-links-generator.rb @@ -1,34 +1,30 @@ # Find the net-links yaml file passed as argument -net_links_file = ARGV.find{|a| a.match(/\/net-links.yaml$/) != nil} -if net_links_file.nil? - @logger.error "Failed to find the net-links.yaml url to guess the site. Please use the file full name." -else - site_name = File.basename(File.dirname(net_links_file)) +lookup("net-links").each do |equipment_uid, properties| + site_name = properties["site"] site site_name.to_sym do - lookup("net-links").each do |equipment_uid, properties| - network_equipment equipment_uid do |uid| - # Most properties are directly written as they are from the net-links YAML file to the the JSON file - model properties["model"] - kind properties["kind"] - snmp_community properties["snmp_community"] - vlans properties["vlans"] - routes properties["routes"] - channels properties["channels"] + network_equipment equipment_uid do |uid| + # Most properties are directly written as they are from the net-links YAML file to the the JSON file + model properties["model"] + kind properties["kind"] + site_uid properties["site"] + snmp_community properties["snmp_community"] + vlans properties["vlans"] + routes properties["routes"] + channels properties["channels"] - # Change the format of linecard from Hash to Array - linecards_array = [] - properties["linecards"].each do |linecard_index,linecard| - ports = [] - linecard.delete("ports").each do |port_index,port| - port = {"uid"=>port} if port.is_a? String - ports[port_index] = port - end - linecard["ports"] = ports.map{|p| p || {}} - linecards_array[linecard_index] = linecard + # Change the format of linecard from Hash to Array + linecards_array = [] + properties["linecards"].each do |linecard_index,linecard| + ports = [] + linecard.delete("ports").each do |port_index,port| + port = {"uid"=>port} if port.is_a? String + ports[port_index] = port end - linecards linecards_array.map{|l| l || {}} + linecard["ports"] = ports.map{|p| p || {}} + linecards_array[linecard_index] = linecard end + linecards linecards_array.map{|l| l || {}} end end end diff --git a/generators/input/toulouse/net-links/gw.yaml b/generators/input/toulouse/net-links/gw.yaml index 55dd401f714..6e45294e16e 100644 --- a/generators/input/toulouse/net-links/gw.yaml +++ b/generators/input/toulouse/net-links/gw.yaml @@ -1,64 +1,63 @@ --- -- :vlans: +- :ifname: Gi2/2 + :vlans: - 2 - :ifname: Gi2/2 :ip: 192.168.22.252 :mac: 00:09:3d:10:14:b4 - :fqdn: nfs-violette.toulouse.grid5000.fr - :ifname: Gi3/48 :vlans: - 2 + :ifname: Gi3/48 :ip: 192.168.22.253 :mac: 00:14:4f:21:0f:df - :fqdn: gw-g5k.rennes.grid5000.fr - :ifname: Te1/1 :vlans: - 550 - - 667 + :ifname: Te1/1 :ip: 192.168.4.19 :mac: 00:15:2c:0d:34:00 - :fqdn: gw-g5k.nancy.grid5000.fr - :ifname: Te1/1 :vlans: - 550 + - 667 + :ifname: Te1/1 :ip: 192.168.4.14 :mac: 00:18:71:d7:e9:00 - :fqdn: gw-g5k.lille.grid5000.fr - :ifname: Te1/1 :vlans: - 550 - 667 + :ifname: Te1/1 :ip: 192.168.4.18 :mac: 00:19:a9:9f:48:c0 - :fqdn: gw-g5k.bordeaux.grid5000.fr - :ifname: Te1/1 :vlans: - 550 - - 667 + :ifname: Te1/1 :ip: 192.168.4.17 :mac: 00:19:bb:08:c8:00 - :fqdn: gw-g5k.sophia.grid5000.fr - :ifname: Te1/1 :vlans: - 550 - 667 + :ifname: Te1/1 :ip: 192.168.4.12 :mac: 00:1b:ed:38:4f:00 - :fqdn: gw-g5k.luxembourg.grid5000.fr - :ifname: Te1/1 :vlans: - 550 + :ifname: Te1/1 :ip: 192.168.4.21 :mac: 00:25:84:e2:eb:c0 -- :ifname: Te1/1 - :vlans: +- :vlans: - 667 + :ifname: Te1/1 :mac: 00:16:3e:55:79:5b -- :ifname: Te1/1 - :vlans: +- :vlans: - 667 + :ifname: Te1/1 :mac: 00:16:3e:ae:c6:1a -- :ifname: Te1/1 - :vlans: +- :vlans: - 667 + :ifname: Te1/1 :mac: 00:16:3e:c9:78:67 -- GitLab