redfish.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:valence 作者: openstack 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号