def show_cpu_details(cpu_url):
"""Get processor details .
:param cpu_url: relative redfish url to processor,
e.g /redfish/v1/Systems/1/Processors/1.
:returns: dict of processor detail.
"""
resp = send_request(cpu_url)
if resp.status_code != http_client.OK:
# Raise exception if don't find processor
raise exception.RedfishException(resp.json(),
status_code=resp.status_code)
respdata = resp.json()
cpu_details = {
"instruction_set": respdata.get("InstructionSet"),
"model": respdata.get("Model"),
"speed_mhz": respdata.get("MaxSpeedMHz"),
"total_core": respdata.get("TotalCores")
}
return cpu_details
评论列表
文章目录