redfish使用RESTFUL API 对服务器进行管理
Turn on a system
Server power is controlled by using a POST operation to the ComputerSystem.Reset URI to request the
desired action.
import requests
import json
url = 'https://<iDRAC
IP>/redfish/v1/Systems/System.Embedded.1/Actions/ComputerSystem.Reset'
payload = {'ResetType': 'On'}
headers = {'content-type': 'application/json'}
response = requests.post(url, data=json.dumps(payload), headers=headers,
verify=False, auth=('root','calvin'))
3.3.6 Turn off a system
import requests
import json
url = 'https://<iDRAC
IP>/redfish/v1/Systems/System.Embedded.1/Actions/ComputerSystem.Reset'
payload = {'ResetType': 'ForceOff'}
headers = {'content-type': 'application/json'}
response = requests.post(url, data=json.dumps(payload), headers=headers,
verify=False, auth=('root','calvin'))
本文来自博客园,作者:萱乐庆foreverlove,转载请注明原文链接:https://www.cnblogs.com/leleyao/p/17877190.html

浙公网安备 33010602011771号