HPE Gen9 使用 RESTful API 管理服务器

HPE 在Gen9服务器的iLO中加入了 RESTful API ,可以用来批量修改服务器设置。
HPE官方提供的 HPE RESTful Interface Tool (以下简称tool) http://www.hpe.com/info/resttool

演示使用的服务器为 HPE BL660c Gen9 (E5 V4 CPU)
有数百台服务器需要更改如下BIOS设置
System Configuration→BIOS/Platform Configuration(RBSU)→Power Management Options→Power Profile→Maximum Performance
System Configuration→BIOS/Platform Configuration(RBSU)→Power Management Options→Advanced Power Management Options→ Collaborative Power Control→ disabled
官方提供的tool登录慢效率低 iLO的REST API支持使用curl发送数据
查询当前BIOS设置
登录的用户需要 Administer User Accounts权限
返回的数据为JSON格式 可以用python -m json.tool处理
curl -s --insecure -u [username]:[password] -L https://[iLO IP]/rest/v1/Systems/1/Bios|python -m json.tool


{
    "AcpiRootBridgePxm": "Enabled",
    "AcpiSlit": "Enabled",
    "AdjSecPrefetch": "Enabled",
    "AdminEmail": "",
    "AdminName": "",
    "AdminOtherInfo": "",
    "AdminPassword": null,
    "AdminPhone": "",
    "AdvancedMemProtection": "AdvancedEcc",
    "AsrStatus": "Disabled",
    "AsrTimeoutMinutes": "10",
    "AssetTagProtection": "Locked",
    "AttributeRegistry": "HpBiosAttributeRegistryI38.1.1.52",
    "AutoPowerOn": "AlwaysPowerOn",
    "BootMode": "Uefi",
    "BootOrderPolicy": "RetryIndefinitely",
    "ChannelInterleaving": "Enabled",
    "CollabPowerControl": "Enabled",
    "ConsistentDevNaming": "LomsOnly",
    "CustomPostMessage": "",
    "DaylightSavingsTime": "Disabled",
    "DcuIpPrefetcher": "Enabled",
    "DcuStreamPrefetcher": "Enabled",
    "Description": "This is the Platform/BIOS Configuration (RBSU) Current Settings",
    "Dhcpv4": "Enabled",
    "DynamicPowerResponse": "Fast",
    "EmbSasEnable": "Enabled",
    "EmbSata1Enable": "Enabled",
    "EmbSata2Enable": "Enabled",
    "EmbVideoConnection": "Auto",
    "EmbeddedDiagnostics": "Enabled",
    "EmbeddedDiagsMode": "Auto",
    "EmbeddedSata": "Ahci",
    "EmbeddedSerialPort": "Com2Irq3",
    "EmbeddedUefiShell": "Enabled",
    "EmbeddedUserPartition": "Disabled",
    "EmsConsole": "Com1Irq4",
    "EnergyPerfBias": "MaxPerf",
    "EraseUserDefaults": "No",
    "ExtendedAmbientTemp": "Disabled",
    "ExtendedMemTest": "Disabled",
    "F11BootMenu": "Enabled",
    "FCScanPolicy": "CardConfig",
    "FanFailPolicy": "Shutdown",
    "FanInstallReq": "EnableMessaging",
    "FlexLom1Enable": "Enabled",
    "FlexLom2Enable": "Enabled",
    "HwPrefetcher": "Enabled",
    "IntelDmiLinkFreq": "Auto",
    "IntelNicDmaChannels": "Enabled",
    "IntelPerfMonitoring": "Disabled",
    "IntelProcVtd": "Enabled",
    "IntelQpiFreq": "Auto",
    "IntelQpiPowerManagement": "Disabled",
    "IntelligentProvisioning": "Enabled",
    "InternalSDCardSlot": "Enabled",
    "IoNonPostedPrefetching": "Enabled",
    "Ipv4Address": "0.0.0.0",
    "Ipv4Gateway": "0.0.0.0",
    "Ipv4PrimaryDNS": "0.0.0.0",
    "Ipv4SecondaryDNS": "0.0.0.0",
    "Ipv4SubnetMask": "0.0.0.0",
    "Ipv6Duid": "Auto",
    "MaxMemBusFreqMHz": "Auto",
    "MaxPcieSpeed": "MaxSupported",
    "MemFastTraining": "Enabled",
    "MinProcIdlePkgState": "NoState",
    "MinProcIdlePower": "NoCStates",
    "MixedPowerSupplyReporting": "Enabled",
    "Modified": "2018-03-12T08:45:27+00:00",
    "Name": "BIOS Current Settings",
    "NetworkBootRetry": "Enabled",
    "NicBoot1": "NetworkBoot",
    "NicBoot10": "Disabled",
    "NicBoot11": "Disabled",
    "NicBoot12": "Disabled",
    "NicBoot13": "Disabled",
    "NicBoot14": "Disabled",
    "NicBoot15": "Disabled",
    "NicBoot16": "Disabled",
    "NicBoot2": "Disabled",
    "NicBoot3": "Disabled",
    "NicBoot4": "Disabled",
    "NicBoot5": "Disabled",
    "NicBoot6": "Disabled",
    "NicBoot7": "Disabled",
    "NicBoot8": "Disabled",
    "NicBoot9": "NetworkBoot",
    "NmiDebugButton": "Enabled",
    "NodeInterleaving": "Disabled",
    "NumaGroupSizeOpt": "Clustered",
    "OldAdminPassword": null,
    "OldPowerOnPassword": null,
    "PciBusPadding": "Enabled",
    "PciSlot1Enable": "Enabled",
    "PciSlot2Enable": "Enabled",
    "PcieExpressEcrcSupport": "Disabled",
    "PostF1Prompt": "Disabled",
    "PowerButton": "Enabled",
    "PowerOnLogo": "Enabled",
    "PowerOnPassword": null,
    "PowerProfile": "BalancedPowerPerf",
    "PowerRegulator": "StaticHighPerf",
    "PreBootNetwork": "Auto",
    "ProcAes": "Enabled",
    "ProcCoreDisable": 0,
    "ProcHyperthreading": "Enabled",
    "ProcNoExecute": "Enabled",
    "ProcTurbo": "Enabled",
    "ProcVirtualization": "Enabled",
    "ProcX2Apic": "Enabled",
    "ProductId": "Q1C54A",
    "QpiBandwidthOpt": "Balanced",
    "QpiSnoopConfig": "Standard",
    "RemovableFlashBootSeq": "ExternalKeysFirst",
    "RestoreDefaults": "No",
    "RestoreManufacturingDefaults": "No",
    "RomSelection": "CurrentRom",
    "SataSecureErase": "Disabled",
    "SaveUserDefaults": "No",
    "SecureBootStatus": "Disabled",
    "SerialConsoleBaudRate": "115200",
    "SerialConsoleEmulation": "Vt100Plus",
    "SerialConsolePort": "Auto",
    "SerialNumber": "********",
    "ServerAssetTag": "",
    "ServerName": "",
    "ServerOtherInfo": "",
    "ServerPrimaryOs": "",
    "ServiceEmail": "",
    "ServiceName": "",
    "ServiceOtherInfo": "",
    "ServicePhone": "",
    "SettingsResult": {
        "ETag": "877AAC20",
        "Messages": [
            {
                "MessageArgs": [
                    "NicBoot4"
                ],
                "MessageID": "Base.1.0:PropertyUnknown"
            },
            {
                "MessageArgs": [
                    "NicBoot8"
                ],
                "MessageID": "Base.1.0:PropertyUnknown"
            },
            {
                "MessageArgs": [
                    "NicBoot15"
                ],
                "MessageID": "Base.1.0:PropertyUnknown"
            },
            {
                "MessageArgs": [
                    "NicBoot3"
                ],
                "MessageID": "Base.1.0:PropertyUnknown"
            },
            {
                "MessageArgs": [
                    "NicBoot5"
                ],
                "MessageID": "Base.1.0:PropertyUnknown"
            },
            {
                "MessageArgs": [
                    "NicBoot16"
                ],
                "MessageID": "Base.1.0:PropertyUnknown"
            },
            {
                "MessageArgs": [
                    "NicBoot14"
                ],
                "MessageID": "Base.1.0:PropertyUnknown"
            },
            {
                "MessageArgs": [
                    "NicBoot12"
                ],
                "MessageID": "Base.1.0:PropertyUnknown"
            },
            {
                "MessageArgs": [
                    "NicBoot11"
                ],
                "MessageID": "Base.1.0:PropertyUnknown"
            },
            {
                "MessageArgs": [
                    "NicBoot13"
                ],
                "MessageID": "Base.1.0:PropertyUnknown"
            },
            {
                "MessageArgs": [
                    "NicBoot6"
                ],
                "MessageID": "Base.1.0:PropertyUnknown"
            },
            {
                "MessageArgs": [
                    "NicBoot7"
                ],
                "MessageID": "Base.1.0:PropertyUnknown"
            },
            {
                "MessageArgs": [],
                "MessageID": "Base.1.0:Success"
            }
        ],
        "Time": "1987-03-12T08:41:55+00:00"
    },
    "Slot1NicBoot1": "NetworkBoot",
    "Slot1NicBoot2": "Disabled",
    "Slot1NicBoot3": "Disabled",
    "Slot1NicBoot4": "Disabled",
    "Sriov": "Enabled",
    "ThermalConfig": "OptimalCooling",
    "ThermalShutdown": "Enabled",
    "TimeFormat": "Utc",
    "TimeZone": "Utc0",
    "TpmState": "NotPresent",
    "TpmType": "NoTpm",
    "Type": "HpBios.1.2.0",
    "UefiOptimizedBoot": "Enabled",
    "UefiPxeBoot": "Auto",
    "UefiShellBootOrder": "Disabled",
    "UefiShellStartup": "Disabled",
    "UefiShellStartupLocation": "Auto",
    "UefiShellStartupUrl": "",
    "UrlBootFile": "",
    "Usb3Mode": "Auto",
    "UsbBoot": "Enabled",
    "UsbControl": "UsbEnabled",
    "UtilityLang": "English",
    "VirtualInstallDisk": "Disabled",
    "VirtualSerialPort": "Com1Irq4",
    "VlanControl": "Disabled",
    "VlanId": 0,
    "VlanPriority": 0,
    "WakeOnLan": "Disabled",
    "links": {
        "BaseConfigs": {
            "href": "/rest/v1/systems/1/bios/BaseConfigs"
        },
        "Boot": {
            "href": "/rest/v1/systems/1/bios/Boot"
        },
        "Mappings": {
            "href": "/rest/v1/systems/1/bios/Mappings"
        },
        "Settings": {
            "href": "/rest/v1/systems/1/bios/Settings"
        },
        "iScsi": {
            "href": "/rest/v1/systems/1/bios/iScsi"
        },
        "self": {
            "href": "/rest/v1/systems/1/bios"
        }
    }
}

原文地址:http://blog.51cto.com/gregdefanhua/2089399

时间: 2024-10-17 13:56:36

HPE Gen9 使用 RESTful API 管理服务器的相关文章

利用express搭建一个restful api 服务器

学习express有几天了,记录一下内容也给入门的兄弟们一点提示. 想要解决的问题: node开发过程中自动重启服务器,无需每次都要运行node index.js启动服务器(nodemon) 使用ES6,ES7 编写代码,自动编译 使用import,export新特性.(babel) 使用express开发RESTFUL API,模块化开发. 学习postman中的提交内容方式. 利用mongoose中间件来实现model层映射. 利用body-parser中间件来实现提交内容解析.(multi

[CI] 使用CodeIgniter框架搭建RESTful API服务

在2011年8月的时候,我写了一篇博客<使用CodeIgniter框架搭建RESTful API服务>,介绍了RESTful的设计概念,以及使用CodeIgniter框架实现RESTful API的方法.转眼两年过去了,REST在这两年里有了很大的改进.我对于前一篇博客中的某些方面不是很满意,所以希望能利用这次机会写一个更加完善的版本.我的项目基于Phil Sturgeon的CodeIgniter REST Server,遵循他自己的DBAD协议.Phil的这个项目很棒,干净利落,简单实用,并

使用Node.js + MongoDB 构建restful API

很多天前已经翻译了一大半了,今天收收尾~ RESTful API With Node.js + MongoDB Translated By 林凌灵 翻译目的:练练手,同时了解别人的思维方式 原文地址:RESTful API With Node.js + MongoDB 12 Sep 2013 我是一名移动应用开发者,我需要某种后端服务用来频繁地处理用户数据到数据库中.当然,我可以使用后端即服务类的网站(Parse, Backendless, 等等-),(译者:国内比较出名的有Bmob).但自己解

DICOM医学图像处理:深入剖析Orthanc的SQLite,了解WADO &amp; RESTful API

背景: 上一篇博文简单翻译了Orthanc官网给出的CodeProject上"利用Orthanc Plugin SDK开发WADO插件"的博文,其中提到了Orthanc从0.8.0版本之后支持快速查询,而原本的WADO请求需要是直接借助于Orthanc内部的REST API逐级定位.那么为什么之前的Orthanc必须要逐级来定位WADO请求的Instance呢?新版本中又是如何进行改进的呢?此篇博文通过分析Orthanc内嵌的SQLite数据库,来剖析Orthanc的RESTful A

RESTful API 设计最佳实践(转)

摘要:目前互联网上充斥着大量的关于RESTful API(为了方便,以后API和RESTful API 一个意思)如何设计的文章,然而却没有一个”万能“的设计标准:如何鉴权?API格式如何?你的API是否应该加入版本信息? 背景 目前互联网上充斥着大量的关于RESTful API(为了方便,以后API和RESTful API 一个意思)如何设计的文章,然而却没有一个”万能“的设计标准:如何鉴权?API格式如何?你的API是否应该加入版本信息?当你开始写一个app的时候,特别是后端模型部分已经写完

RESTful API 设计最佳实践

1. 背景 REST(英文:Representational State Transfer,表述性状态转移)描述了一个架构样式的网络系统,比如 web 应用程序. 目前互联网上充斥着大量的关于RESTful API(为方便,下文中"RESTful API "简写为"API")如何设计的文章,然而却没有一个"万能"的设计标准:如何鉴权?API 格式如何?你的API是否应该加入版本信息?当你开始写一个app的时候,特别是后端模型部分已经写完的时候,你

使用Flask设计带认证token的RESTful API接口[翻译]

上一篇文章, 使用python的Flask实现一个RESTful API服务器端  简单地演示了Flask实的现的api服务器,里面提到了因为无状态的原则,没有session cookies,如果访问需要验证的接口,客户端请求必需每次都发送用户名和密码.通常在实际app应用中,并不会每次都将用户名和密码发送. 这篇里面就谈到了产生token的方法. 完整的例子的代码 可以在github:REST-auth 上找到.作者欢迎大家上去跟他讨论. 创建用户数据库 这个例子比较接近真实的项目,将会使用F

DICOM:深入剖析Orthanc的SQLite,了解WADO&RESTful API

背景: 上一篇博文简单翻译了Orthanc官网给出的CodeProject上"利用Orthanc Plugin SDK开发WADO插件"的博文,其中提到了Orthanc从0.8.0版本之后支持快速查询,而原本的WADO请求需要是直接借助于Orthanc内部的REST API逐级定位.那么为什么之前的Orthanc必须要逐级来定位WADO请求的Instance呢?新版本中又是如何进行改进的呢?此篇博文通过分析Orthanc内嵌的SQLite数据库,来剖析Orthanc的RESTful A

Android使用Bmob移动后端云Restful API需要注意的问题

如果你自己想做一个客户端玩玩,但是又不想去搭建后台服务器,显然Bmob移动后端云是你的最佳选择.官方地址见bmob,文档地址见http://www.bmob.cn/docs.他提供了Android的sdk,同样也提供了Restful Api,但是个人建议Restful Api还是不适合直接在客户端使用,毕竟会暴露一下一些key的信息,但是本篇文章就是在android中使用它的restful api,原因嘛很简单,我想网络层自己控制,不想用它提供的android sdk,对于安全方面,同样给出了这