White Papers
10 Dell OpenManage Power Center 4.0 REST API Reference Guide
2.2 Sample request
Below request body enumerates from root path with the complete detail, seeking entities whose type is “Server”,
arranging the result in ascending order by “name”.
2.3 Sample response body
All Servers under root path are enumerated, result arranged by entity name in ascending order.
Body
Comment
{
"criteriaObj": {
"errorObj": null,
"requestObj": null,
"responseCode": 0,
"responseObj": [
Array of entity summaries
{
"assetTag": "ASSET1234",
Asset Tag
"description": "",
Description
"entityType": "Server",
Entity type
"hostname": "idrac.dell.com.",
Host name for the entity
"ipAddress": "192.168.1.1",
IP address
"link":
"https://localhost:8643/index.html#/devices.alldevices/4"
,
URL can be used to launch the OMPC GUI
interface on the target device / group using a
browser. When launched, OMPC will
authenticate the user through SSO (if
configured), reuse of an existing authenticated
browser window (if applicable), or the login page
and if successful, display the corresponding
# developed using Python 3.5
import base64
import json
import ssl
import urllib.request
from pprint import pprint
bseurl = 'https://localhost:8643/api/overview/'
encoded_auth = base64.b64encode(b'user:pwd:0', None)
requestdata = b'{"requestObj":{"depth":-1,"path":"/"},' \
b'"criteriaObj":{"paginationObj":{"currentPage":0,"rowCountPerPage":9999,"totalItemsCount":0},' \
b'"sortObj":[{"field": "name","order": "1"}],' \
b'"filterObj": [{"field": "entityType", "op": "=", "opTarget": ["Server"]}]}}'
if __name__ == "__main__":
url = bseurl + 'enumerateEntitySummaries'
req = urllib.request.Request(url, data=requestdata)
req.add_header('Authorization', encoded_auth)
req.add_header('Content-Type', 'application/json')
data = ""
try:
cntx = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
with urllib.request.urlopen(req, context=cntx) as f:
data = json.loads(f.read().decode('utf-8'))
except Exception as e:
print('Error:', str(e))
pprint(data)
quit()