White Papers
21 Implementation of the DMTF Redfish API on Dell EMC PowerEdge Servers
print "Min reading:
{}".format(systemData[u'PowerMetrics'][u'MinConsumedWatts'])
Output:
Consumed power: 149
Average reading: 155
Max reading: 169
Min reading: 144
3.3.8 Update general System Information with PATCH operation
This example demonstrates how to update the System read/write properties as defined in the Redfish
specification. Users can provide information about the properties in the System and can update single or
multiple properties. If the user provides invalid information for updating a property due to an invalid data type
or unacceptable data, the iDRAC Redfish service provides extended information along with an error
indication.
import requests
import json
url = 'https://<iDRAC IP>/redfish/v1/Systems/System.Embedded.1'
payload = {' Hostname ': ' Ubuntu ' }
headers = {'content-type': 'application/json'}
response = requests.patch(url, data=json.dumps(payload), headers=headers,
verify=False, auth=('root','calvin'))
print "Status Code: {}".format(response.status_code)
print "Extended Info Message: {}".format(response.json())
Output:
Status Code: 200
Extended Info Message: {u'Success': {u'Message': u'Successfully Completed
Request', u'Resolution': u'None', u'Severity': u'Ok', u'MessageId':
u'Base.1.0.Success'}}
Using the above script, if the user provides an incorrect type for the input data as shown below, they will
receive extended information specifying the error. For example, if the payload was improperly input as:
payload = {' Hostname ': 1234 } this would result in the following output: