redfish.py 文件源码

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

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


问题


面经


文章

微信
公众号

扫码关注公众号