Here's one, the LUT is wrapped in a simple function, so calling poeb(model) returns the PoE budget.
Note in this script I want the PoE budget as a string, it's trivial to tweak to return a number instead.
def poeb(model):
poebudgets = {
"MS22P": 380,
"MS42P": 380,
"MS120-8LP": 67,
"MS120-8FP": 124,
"MS120-24P": 370,
"MS120-48LP": 370,
"MS120-48FP": 740,
"MS125-24P": 370,
"MS125-48LP": 370,
"MS125-48FP": 740,
"MS130-8P": 120,
"MS130-8X": 120,
"MS130-12X": 240,
"MS130-24P": 370,
"MS130-24X": 370,
"MS130-48P": 740,
"MS130-48X": 740,
"MS130R-8P": 240,
"MS210-24P": 370,
"MS210-48LP": 370,
"MS210-48FP": 740,
"MS220-8P": 124,
"MS220-24P": 370,
"MS220-48LP": 370,
"MS220-48FP": 740,
"MS225-24P": 370,
"MS225-48LP": 370,
"MS225-48FP": 740,
"MS250-24P": 370,
"MS250-48LP": 370,
"MS250-48FP": 740,
"MS320-24P": 370,
"MS320-48LP": 370,
"MS320-48FP": 740,
"MS350-24P": 370,
"MS350-48LP": 370,
"MS350-48FP": 740,
"MS350-24X": 740,
"MS355-24X": 740,
"MS355-48X": 740,
"MS355-24X2": 740,
# the MS390 budget is based on the default primary PSU only, so assumes worst case scenario for estimating PoE headroom
"MS390-24P": 445,
"MS390-24U": 830,
"MS390-24UX": 560,
"MS390-48P": 437,
"MS355-48U": 822,
"MS390-48UX": 490,
"MS390-48UX2": 645,
# the C9300 budget is based on the default primary PSU only, so assumes worst case scenario for estimating PoE headroom
"C9300-24P-M": 445,
"C9300-24U-M": 830,
"C9300-24UX-M": 560,
"C9300-48P-M": 437,
"C9300-48U-M": 822,
"C9300-48UXM-M": 490,
"C9300-48UN-M": 645,
}
if model in poebudgets:
return str(poebudgets[model])
else:
return "0"