Softlayer createFirmwareUpdateTransaction

时间:2016-03-27 07:12:29

标签: api ibm-cloud-infrastructure

我想更新环境中每个vyatta服务器上的所有组件(90+)。我想通过API调用脚本执行此操作,但是当我尝试使用时:

slcli -C USERNAME api-call Hardware_Server createFirmwareUpdateTransaction SERVER-ID

它只重新启动了我试过的测试系统。

我是否需要在命令中添加一些额外信息来指定要升级的项目(最好是所有项目,如ipmi和其他组件)?

2 个答案:

答案 0 :(得分:0)

请尝试以下 slcli 示例:

slcli call-api Hardware_Server createFirmwareUpdateTransaction --id=179996 1 1 1 1

<强>其中:

  • “179996”是server_id
  • &#34; FIRMWARE UPDATES&#34;:

    "upgrade IPMI Firmware" : 1,
    "upgrade RAID Firmware" : 1,
    "upgrade Bios" : 1,
    "upgrade Hard Drive Firmware" : 1
    

这也是休息示例:

https://[username]:[apikey]@api.softlayer.com/rest/v3/ SoftLayer_Hardware_Server/[Server_ID]/createFirmwareUpdateTransaction

方法:POST

{
  "parameters": [
    1,
    0,
    1,
    0
  ]
}

这是一个 python 脚本:

"""
Update the firmware in a BareMetal server

The script makes a single call to SoftLayer_Hardware_Server::createFirmwareUpdateTransaction
method to update the firmware in a bare metal server.

See below for more details

Important manual pages:
http://sldn.softlayer.com/reference/services/SoftLayer_Hardware_Server/createFirmwareUpdateTransaction

License: http://sldn.softlayer.com/article/License
Author: SoftLayer Technologies, Inc. 
"""
import SoftLayer.API
from pprint import pprint as pp

# Your SoftLayer API username and key.
USERNAME = 'set me'
API_KEY = 'set me'

# Declare the API client
client = SoftLayer.Client(username=USERNAME, api_key=API_KEY)
hardwareServerService = client['SoftLayer_Hardware_Server']

# The id of the bare metal server you wish to update the firmware
hardwareId = 100123

"""
The firmware to update
set the values with "1" to update and "0" skip
"""
ipmi = 0
raidController = 1
bios = 0
hardDrive = 0

try:
result = hardwareServerService.createFirmwareUpdateTransaction(ipmi, raidController, bios, hardDrive, id=hardwareId)
pp(result)
except SoftLayer.SoftLayerAPIError as e:
print("Unable to update the firmware. "
% (e.faultCode, e.faultString))
exit(1)

问候。

答案 1 :(得分:0)

你可以试试这个:

slcli call-api --id=155392 Hardware_Server createFirmwareUpdateTransaction 1 1 1 1

注意:更改要更新的服务器ID的“155392”值

此致

相关问题