Dell OpenManage Power Center REST API Reference Guide This white paper outlines the usage of the REST API commands in OpenManage Power Center.
Revisions Date Description September 2014 Initial release May 2016 Updated with new REST APIs THIS WHITE PAPER IS FOR INFORMATIONAL PURPOSES ONLY, AND MAY CONTAIN TYPOGRAPHICAL ERRORS AND TECHNICAL INACCURACIES. THE CONTENT IS PROVIDED AS IS, WITHOUT EXPRESS OR IMPLIED WARRANTIES OF ANY KIND. © 2016 Dell Inc. All rights reserved. Reproduction of this material in any manner whatsoever without the express written permission of Dell Inc. is strictly forbidden. For more information, contact Dell.
registered trademarks of Novell Inc. in the United States and other countries. Oracle ® is a registered trademark of Oracle Corporation and/or its affiliates. Citrix®, Xen®, XenServer® and XenMotion® are either registered trademarks or trademarks of Citrix Systems, Inc. in the United States and/or other countries. VMware ®, Virtual SMP®, vMotion®, vCenter® and vSphere® are registered trademarks or trademarks of VMware, Inc. in the United States or other countries.
Table of contents Revisions ............................................................................................................................................................................................. 2 Executive summary........................................................................................................................................................................... 6 1 Introduction .....................................................................................
.8 Raw Monitoring Data Report ...................................................................................................................................... 29 5.9 Comparison Report ...................................................................................................................................................... 31 5.10 Thermal Data Report ..........................................................................................................................................
Executive summary Dell™ OpenManage™ Power Center (OMPC) management console provides increased visibility over power consumption, anomalies, and utilization in a more precise manner. This enables increased control over data center, improved rack density, faster response times, greater accuracy, and broader decision-making intelligence. OMPC provides more than 20 Pre-defined templates to generate the reports.
1 Introduction This document describes the REST integration with Dell OpenManage Power Center. It provides examples (using python 3.5) of enumerating the device details from OMPC server and gathers the report details through REST APIs. Using these APIs, you can create various reports based on your organization requirement, check reports execution status, or retrieve report results.
2 Key Integration Concepts 2.1 Client Integration Overview The REST client sends standard HTTP(s) requests to the REST API end- point. Each request is sent using a HTTP verb (for example, PUT, GET, POST, DELETE, HEAD, and OPTIONS) and includes a message body in JSON format. The response uses a standard HTTP status code.
2.4 Authentication Mechanism OMPC uses Basic Authentication along with HTTPs to enable authentication of REST requests.
3 Device Enumeration API Interface 3.
Name Type Description ] } Indicates target field in sort object and filter object: Sort Object & Filter Object /Field String Sort Object /Order Integer Sort order, 1:Ascending 2:Descending Filter Object /Operator String Filter operator for comparison: "assetTag": "description": "entityType": "hostname": "ipAddress": "link": "location": Asset / service tag Description Entity type (See below) Host name of the entity IP address of the entity URL for link and launch Group path of the entity, if the
3.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”. # 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,"rowCo
Body "location": "/DC/ROOM/ROW/Rack1/", "name": "Server - 192.168.1.1", "serialNumber": "SRNUM53" "devicePosition": "1" "size": "3" Comment authenticated browser window (if applicable), or the login page and if successful, display the corresponding device filtered in its interface. In case of a missing device, the interface will provide an error message to the user indicating the device could not be found.
"errorMessage": "Request data is empty or the format is invalid.", "fldErrors": [] }, "requestObj": null, "responseCode": -1912339653 } Error message Error response code Error messages / codes: Error code 0x8E04033B 0x8E130301 0x8E130304 0x8E130305 0x8E050306 0x8E050307 0x8E12ff04 - 14 Error message Request data is empty or the format is invalid. The pagination object is invalid. The sort descriptor is invalid. The filter descriptor is invalid. Invalid depth value to enumerate entities.
4 Report APIs 4.1 Request Parameters This section introduces the API definition of reporting features for OMPC. Using this set of APIs, users can create various types of reports, check the status of the reports and retrieve the report results when status are ready, or remove target reports. 4.2 Adding Reports Below APIs could be used to add and run report of a specific type: # 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 4.
Type Name Integer aggPeriodValue Array attributes String startDateTime String endDateTime Integer Array maxResults entityList Array Integer entityGroupList percentPower Array of integers severity Boolean selectAllDevices Description If aggregation period is disabled, set both aggregation type and value to -1. Otherwise error will be returned.
Type Boolean 4.4 Name selectAllGroups Description Indicates whether all devices would be selected, “true” for yes and “false” for no. Only applicable for reports that require target devices / groups. Can be combined with “selectAllDevices” flag. Get System Report Type Summary GetSystemReportTypeSummary returns predefined report template for a specific report type. Referring to the attributes list users can customize the attributes for this report type according to below rule: 1.
Sample Request: # developed using Python 3.5 import base64 import json import ssl import urllib.request from pprint import pprint bseurl = 'https://localhost:8643/powercenter/api/report/getSystemReportTypeSummary?reportType=powerHoarders' encoded_auth = base64.b64encode(b'user:pwd:0', None) if __name__ == "__main__": req = urllib.request.Request(bseurl) req.add_header('Authorization', encoded_auth) req.add_header('Content-Type', 'application/json') data = "" try: cntx = ssl.SSLContext(ssl.
When the status for a report is “Completed”, the result is displayed. 4.7 Report Result GetReportResult is used for returning the results of specific report instance from last running. To avoid large amount of data two parameters for pagination added. A typical combination is currentPage=0 and rowCountPerPage=10 calling this API for the first time. Then onwards increment the current page. API usage: POST /getReportResult?reportId=¤tPage=& rowCountPerPage= 4.
5 Reports 5.1 Power Hoarders Report Below API is used for consuming “Power Hoarders” report. API usage: POST /powerHoarders Sample Request: Used Description Aggregation period disabled. Must be -1 "aggPeriodValue": -1, Aggregation period disabled.
Sample Code: # developed using Python 3.5 import base64 import datetime import json import ssl import urllib.request from pprint import pprint bseurl = 'https://localhost:8643/powercenter/api/report/' encoded_auth = base64.b64encode(b'user:pwd:0', None) day = datetime.timedelta(days=1) reportStartDate = (datetime.datetime.utcnow().date() - day).strftime('%Y-%m-%d') + 'T00:00:00.000Z' reportEndDate = datetime.datetime.utcnow().date().strftime('%Y-%m-%d') + 'T00:00:00.000Z' def getdata(reqobj): reqobj.
5.2 Power Frugal Report Below API is used for consuming “Power Frugal” report. API usage: POST /powerFrugal Sample Request: Used Body "aggPeriodType": -1, Description Aggregation period disabled. Must be -1 "aggPeriodValue": -1, Aggregation period disabled. Must be -1 "attributes": [], Use default of customize attributes "startDateTime": "2016-0501T00:00:00.000Z", "endDateTime": "2016-0502T00:00:00.
'{"fieldName": '{"fieldName": '{"fieldName": 1,"required": 1},' '{"fieldName": 1},' '{"fieldName": '{"fieldName": 1,"required": 1},' '{"fieldName": 5.
Sample Code: url = bseurl + 'powerData' post_data = str.encode( '{"requestObj": ' '{"description": "Device/Group MIN/MAX/average and instantaneous power numbers",' '"startDateTime": "' + reportStartDate + '",' '"endDateTime": "' + reportEndDate + '",' '"aggPeriodType": -1,' '"aggPeriodValue": -1,' '"maxResults": -1,' '"entityList": [{"hostName": "","ipAddress": "192.168.2.1","serviceTagOrSerialNum": ""},' '{"hostName": "","ipAddress": "192.168.2.
"entityGroupList": [ { "groupPath": "/DC" } ], "percentPower": 1, Specify target entity group list. If "selectAllGroups" is true, this field is ignored, keep it empty. If "selectAllGroups" is false, must provide non-empty entity group list. Providing empty list or invalid group / entity will result in error.
26 "endDateTime": "2016-0502T00:00:00.000Z", "maxResults": -1, "entityList": [ { "hostName": "idrac1-dell.com", "ipAddress": "", "serviceTagOrSerialNum": "" } ], "entityGroupList": [ { "groupPath": "/DC" } ], End date time should fall between start date time and current date time Max result record count allowed, -1 for returning all records Specify target entity list. If "selectAllDevices" or "selectAllGroups" is true, this field is ignored, keep it empty.
Sample Code: url = bseurl + 'generalInventory' post_data = str.encode( '{"requestObj": ' '{"description": "General inventory report",' '"startDateTime": "' + reportStartDate + '",' '"endDateTime": "' + reportEndDate + '",' '"aggPeriodType": -1,' '"aggPeriodValue": -1,' '"maxResults": -1,' '"entityList": [{"hostName": "","ipAddress": "192.168.2.1","serviceTagOrSerialNum": ""},' '{"hostName": "","ipAddress": "192.168.2.
"entityList": [], not applicable "entityGroupList": [], not applicable "percentPower": 1, not applicable "severity": [], not applicable “selectAllDevices”: false, “selectAllGroups”: false, Selecting all devices not applicable, do not use or set value to false Selecting all devices not applicable, do not use or set value to false Sample Code: url = bseurl + 'powerHoardersRack' post_data = str.
"percentPower": 1, not applicable "severity": [], not applicable “selectAllDevices”: false, “selectAllGroups”: false, Selecting all devices not applicable, do not use or set value to false Selecting all devices not applicable, do not use or set value to false Sample Code: url = bseurl + 'powerFrugalRack' post_data = str.
"entityGroupList": [], If "selectAllDevices" is false, must provide non-empty entity list. Providing empty list or invalid entity will result in error. not applicable "percentPower": 1, not applicable "severity": [], not applicable “selectAllDevices”: false, “true” to select all devices “selectAllGroups”: false, not applicable, do not use or set value to false Sample Code: url = bseurl + 'rawMonitoringData' post_data = str.
5.9 Comparison Report Below API is used for consuming “Comparison” report. API usage: POST /compareReport Sample Request: Used 31 Body "aggPeriodType": -1, Description Aggregation period could be enabled. "aggPeriodValue": -1, Aggregation period could be enabled. "attributes": [], Use default of customize attributes "startDateTime": "2016-0501T00:00:00.000Z", "endDateTime": "2016-0502T00:00:00.000Z", "maxResults": -1, "entityList": [{"hostName": "idrac1dell.
Sample Code: url = bseurl + 'compareReport' post_data = str.encode( '{"requestObj": ' '{"description": "Device/Group comparison report",' '"startDateTime": "' + reportStartDate + '",' '"endDateTime": "' + reportEndDate + '",' '"aggPeriodType": -1,' '"aggPeriodValue": -1,' '"maxResults": -1,' '"entityList": [{"hostName": "","ipAddress": "192.168.2.1","serviceTagOrSerialNum": ""},' '{"hostName": "","ipAddress": "192.168.2.2","serviceTagOrSerialNum": ""},' '{"hostName": "","ipAddress": "192.168.2.
"entityList": [{ "hostName": "idrac1-dell.com", "ipAddress": "", "serviceTagOrSerialNum": ""}], "entityGroupList": [{"groupPath": "/DC1"}, {"groupPath": "/DC2"}], Specify target entity list. If "selectAllDevices" or "selectAllGroups" is true, this field is ignored, keep it empty. If both "selectAllDevices" and "selectAllGroups" are false, must provide non-empty entity group list and/or entity list. Providing empty list or invalid group / entity will result in error.
5.11 Power Utilization Report Below API is used for consuming “ Power Utilization” report. API usage: POST /powerUtilization Sample Request: Used 34 Body "aggPeriodType": -1, Description Aggregation period disabled. Must be -1 "aggPeriodValue": -1, Aggregation period disabled. Must be -1 "attributes": [], Use default of customize attributes "startDateTime": "2016-0501T00:00:00.000Z", "endDateTime": "2016-0502T00:00:00.
Sample Code: url = bseurl + 'powerUtilization' post_data = str.
“selectAllDevices”: false, “selectAllGroups”: false, not applicable, do not use or set value to false not applicable, do not use or set value to false Sample Code: url = bseurl + 'powerThresholdViolations' post_data = str.
"severity": [], “selectAllDevices”: false, “selectAllGroups”: false, not applicable not applicable, do not use or set value to false not applicable, do not use or set value to false Sample Code: url = bseurl + 'powerCapViolations' post_data = str.
“selectAllDevices”: false, “selectAllGroups”: false, not applicable, do not use or set value to false not applicable, do not use or set value to false Sample Code: url = bseurl + 'powerCapSettings' post_data = str.
“selectAllDevices”: false, “selectAllGroups”: false, not applicable, do not use or set value to false not applicable, do not use or set value to false Sample Code: url = bseurl + 'thresholdSettings' post_data = str.
“selectAllDevices”: false, “selectAllGroups”: false, not applicable, do not use or set value to false not applicable, do not use or set value to false Sample Code: url = bseurl + 'rackFragmentationHoarders' post_data = str.
“selectAllGroups”: false, not applicable, do not use or set value to false Sample Code: url = bseurl + 'rackSpaceHoarders' post_data = str.
Sample Code: url = bseurl + 'rackSpaceFrugal' post_data = str.
Sample Code: url = bseurl + 'highestTemperature' post_data = str.
Sample Code: url = bseurl + 'lowestTemperature' post_data = str.
“selectAllDevices”: false, “selectAllGroups”: false, not applicable, do not use or set value to false not applicable, do not use or set value to false Sample Code: url = bseurl + 'eventsReport' post_data = str.
"percentPower": 0, Note: if you provided devices that are not PDUs or do not have Outlet Power capability, error will not be returned, those devices will be filtered and no relevant results will be generated. Specify target entity group list. If "selectAllGroups" is true, this field is ignored, keep it empty.If "selectAllGroups" is false, must provide non-empty entity group list. Providing empty list or invalid group / entity will result in error.
5.23 PDU Sensor Report Below API is used for consuming “PDU Sensor” report. API usage: POST /pduSensor Sample Request: Used 47 Body "aggPeriodType": -1, Description Aggregation period disabled. Must be -1 "aggPeriodValue": -1, Aggregation period disabled. Must be -1 "attributes": [], Use default of customize attributes "startDateTime": "2016-0501T00:00:00.000Z", "endDateTime": "2016-0502T00:00:00.
Sample Code: url = bseurl + 'pduSensor' post_data = str.
Sample Code: url = bseurl + 'thermalEventPolicy' post_data = str.
A Additional resources You can visit Support.dell.com which is focused on meeting your needs with proven services and support. You can also visit DellTechCenter.com/powercenter, an IT Community where you can connect with Dell Customers and Dell employees for sharing knowledge, best practices, and information about Dell products and installations. For more information, visit www.dell.