Dell OpenManage Power Center 4.0 REST API Reference Guide This white paper outlines the usage of the REST API commands in OpenManage Power Center.
Revisions Date Description June 2017 Initial release The information in this publication is provided “as is.” Dell Inc. makes no representations or warranties of any kind with respect to the information in this publication, and specifically disclaims implied warranties of merchantability or fitness for a particular purpose. Use, copying, and distribution of any software described in this publication requires an applicable software license. Copyright © 2017 Dell Inc. or its subsidiaries.
Table of contents Revisions.............................................................................................................................................................................2 Executive summary.............................................................................................................................................................5 1 Introduction ......................................................................................................................
.9 Comparison Report ..........................................................................................................................................29 4.10 Thermal Data Report ........................................................................................................................................30 4.11 Power Utilization Report ...................................................................................................................................32 4.
Executive summary Dell EMC 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. 1.1 Key integration concepts 1.1.
1.1.3 Security The REST services will only be exposed through HTTPs to ensure that the common threats associated with HTTP traffic are mitigated. 1.1.4 Authentication Mechanism OMPC uses Basic Authentication along with HTTPs to enable authentication of REST requests.
2 Device Enumeration API Interface 2.
Name Sort Object & Filter Object /Field Type String Description Indicates target field in sort object and filter object: 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 entity
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”. # 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 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. Group path of the entity, if the entity belongs to multiple groups, the first path will be returned Name of the entity Serial number Device position in rack.
"requestObj": null, "responseCode": -1912339653 Error response code } Error messages / codes: Error code 0x8E04033B 0x8E130301 0x8E130304 0x8E130305 0x8E050306 0x8E050307 0x8E12ff04 - 12 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. Valid values are: All levels:-1, Immediate sub level:1. Invalid path to enumerate entities.
3 Report APIs 3.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. 3.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 25 26 27 3.
Type Name Integer aggPeriodValue Array attributes String startDateTime String endDateTime Integer Array maxResults entityList Array Integer entityGroupList percentPower Array of integers severity Boolean selectAllDevices Boolean selectAllGroups Description Valid types are: 1 - HOUR, 2 - DAY, 3 - WEEK, 4 – MONTH If aggregation period is disabled, set both aggregation type and value to -1. Otherwise error will be returned.
3.4 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. Mandatory attribute’s fields should not be changed (“required” and “needed” must be 1); 2.
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. 3.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= 3.
4 Report 4.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.
4.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": "Memory Power Consumption","key": "memPowerConsumption","mandatory": 0,"needed": 1,"required": 1},' '{"fieldName": "CPU Power Consumption","key": "cpuPowerConsumption","mandatory": 0,"needed": 1,"required": 1},' '{"fieldName": "CPU Utilization","key": "cpuUtilization","mandatory": 0,"needed": 1,"required": 1},' '{"fieldName": "Memory Bandwidth Utilization","key": "memUtilization","mandatory": 0,"needed": 1,"required": 1},' '{"fieldName": "I/O Utilization","key": "ioUtilization","mandatory": 0
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.
} ], "percentPower": 1, If "selectAllGroups" is false, must provide non-empty entity group list. Providing empty list or invalid group / entity will result in error. not applicable "severity": [], not applicable “selectAllDevices”: false, not applicable “selectAllGroups”: false, “true” to select all groups Sample Code: url = bseurl + 'powerHeadroom' post_data = str.
"maxResults": -1, "entityList": [ { "hostName": "idrac1-dell.com", "ipAddress": "", "serviceTagOrSerialNum": "" } ], 24 "entityGroupList": [ { "groupPath": "/DC" } ], 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. If both "selectAllDevices" and "selectAllGroups" are false, must provide non-empty entity group list and/or entity list.
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.
"maxResults": -1, "entityList": [], Max result record count allowed, -1 for returning all records 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.
"maxResults": -1, "entityList": [], Max result record count allowed, -1 for returning all records 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 + 'powerFrugalRack' post_data = str.
"maxResults": -1, "entityList": [{ "hostName": "idrac1-dell.com", "ipAddress": "", "serviceTagOrSerialNum": ""}], "entityGroupList": [], Max result record count allowed, -1 for returning all records Specify target entity list. If "selectAllDevices" is true, this field is ignored, keep it empty. If "selectAllDevices" is false, must provide non-empty entity list. Providing empty list or invalid entity will result in error.
4.9 Comparison Report Below API is used for consuming “Comparison” report. API usage: POST /compareReport Sample Request: Used 29 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.
"ipAddress": "", "serviceTagOrSerialNum": ""}], "entityGroupList": [{"groupPath": "/DC1"}, {"groupPath": "/DC2"}], 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. Specify target entity group list.
4.11 Power Utilization Report Below API is used for consuming “Power Utilization” report. API usage: POST /powerUtilization Sample Request: Used 32 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.
“selectAllGroups”: false, not applicable, do not use or set value to false Sample Code: url = bseurl + 'powerThresholdViolations' 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 + '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.
“selectAllGroups”: false, not applicable, do not use or set value to false Sample Code: url = bseurl + 'eventsReport' post_data = str.
those devices will be filtered and no relevant results will be generated. "entityGroupList": [{"groupPath": "/DC_001/Room_001/Row(100)/Rack(100)"}], "percentPower": 0, 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.
Sample Request: Used 45 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.000Z", "maxResults": -1, not applicable not applicable "entityList": [ {"hostName": "","ipAddress": "192.186.2.
Sample Code: url = bseurl + 'pduSensor' post_data = str.
Sample Code: url = bseurl + 'thermalEventPolicy' post_data = str.
Sample Code: url = bseurl + 'vmPowerHoarders' post_data = str.
“selectAllDevices”: false, not applicable “selectAllGroups”: false, not applicable Sample Code: url = bseurl + 'vmPowerFrugal' post_data = str.
"percentPower": 0, provide non-empty entity list. Providing empty list or invalid group / entity will result in error. 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.
A Technical support and resources Dell.com/support is focused on meeting customer needs with proven services and support. Dell TechCenter is an online technical community where IT professionals have access to numerous resources for Dell EMC software, hardware and services. For more information, visit DellTechCenter.com/powercenter or www.dell.com/powercenter 51 Dell OpenManage Power Center 4.