White Papers

34 Dell OpenManage Power Center 4.0 REST API Reference Guide
Sample Code:
4.13 Power Cap Violations Report
Below API is used for consuming “ Power Cap Violations” report.
API usage:
POST <BASE_URL>/powerCapViolations
Sample Request:

selectAllGroups: false,
not applicable, do not use or set value to
false
url = bseurl + 'powerThresholdViolations'
post_data = str.encode(
'{"requestObj": '
'{"description": "Device/Group power threshold violations",'
'"startDateTime": "' + reportStartDate + '",'
'"endDateTime": "' + reportEndDate + '",'
'"aggPeriodType": -1,'
'"aggPeriodValue": -1,'
'"maxResults": -1,'
'"entityList": [],'
'"entityGroupList": [],'
'"percentPower": 0,'
'"severity": [],'
'"selectAllDevices": false,'
'"selectAllGroups": false,'
'"attributes": ['
'{"fieldName": "Name","key": "name","mandatory": 1,"needed": 1,"required": 1},'
'{"fieldName": "Hostname","key": "hostname","mandatory": 1,"needed": 1,"required": 1},'
'{"fieldName": "Device Type","key": "deviceType","mandatory": 1,"needed": 1,"required": 1},'
'{"fieldName": "Model","key": "model","mandatory": 1,"needed": 1,"required": 1},'
'{"fieldName": "Device IP","key": "deviceIp","mandatory": 1,"needed": 1,"required": 1},'
'{"fieldName": "Service Tag","key": "serviceTag","mandatory": 1,"needed": 1,"required": 1},'
'{"fieldName": "Location","key": "location","mandatory": 1,"needed": 1,"required": 1},'
'{"fieldName": "Number of Violations","key": "violationCount","mandatory": 1,"needed": 1,"required": 1},'
'{"fieldName": "Average Warning Violation","key": "avgWarningViolationAmount","mandatory": 1,"needed": 1,"required": 1},'
'{"fieldName": "Average Critical Violation","key": "avgCriticalViolationAmount","mandatory": 1,"needed": 1,"required": 1}]}}')
Used
Body
Description
"aggPeriodType": -1,
Aggregation period disabled. Must be -1
"aggPeriodValue": -1,
Aggregation period disabled. Must be -1
"attributes": [],
Use default of customize attributes
"startDateTime": "2016-05-
01T00:00:00.000Z",
Start date time should be earlier than end
date time and current date time
"endDateTime": "2016-05-
02T00:00:00.000Z",
End date time should fall between start
date time and current date time
"maxResults": -1,
Max result record count allowed, -1 for
returning all records
"entityList": [],
not applicable
"entityGroupList": [],
not applicable
"percentPower": 0,
not applicable
"severity": [],
not applicable