Reputation: 1
I would like to update all components on each of our vyatta servers in our environement (90+). I would like to do this with an API call n a script, however when I tried to use:
slcli -C USERNAME api-call Hardware_Server createFirmwareUpdateTransaction SERVER-ID
It only rebooted the test system I tried it on.
Is there some extra information I need to add to the command to specify what items (preferably all such as the ipmi and other components) to upgrade?
Upvotes: 0
Views: 215
Reputation: 1532
Please try the following slcli example:
slcli call-api Hardware_Server createFirmwareUpdateTransaction --id=179996 1 1 1 1
Where:
“179996”
is the server_id"FIRMWARE UPDATES":
"upgrade IPMI Firmware" : 1,
"upgrade RAID Firmware" : 1,
"upgrade Bios" : 1,
"upgrade Hard Drive Firmware" : 1
Also this is a Rest example:
https://[username]:[apikey]@api.softlayer.com/rest/v3/ SoftLayer_Hardware_Server/[Server_ID]/createFirmwareUpdateTransaction
Method: POST
{
"parameters": [
1,
0,
1,
0
]
}
This is a python script:
"""
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)
Regards.
Upvotes: 0
Reputation: 4386
you can try this:
slcli call-api --id=155392 Hardware_Server createFirmwareUpdateTransaction 1 1 1 1
Note: change the "155392" value for the server id you want to update
Regards
Upvotes: 0