def show_ram_details(ram_url):
"""Get memory details .
:param ram_url: relative redfish url to memory,
e.g /redfish/v1/Systems/1/Memory/1.
:returns: dict of memory detail.
"""
resp = send_request(ram_url)
if resp.status_code != http_client.OK:
# Raise exception if don't find memory
raise exception.RedfishException(resp.json(),
status_code=resp.status_code)
respdata = resp.json()
ram_details = {
"data_width_bit": respdata.get("DataWidthBits"),
"speed_mhz": respdata.get("OperatingSpeedMhz"),
"total_memory_mb": respdata.get("CapacityMiB")
}
return ram_details
评论列表
文章目录