{"type":"api","title":"Get Post Aggregation Data By Query Monitoring Power Consumption Statistics 4004","meta":{"id":"/apps/pubhub/media/cisco-catalyst-sd-wan-api-guide-20-18/1c4807bcb76af36988ebb37dc2e455b1787a155e/d2f02ba2-fd0d-3a26-bcc5-feafc8f24d17","info":{"title":"Monitoring and Troubleshooting","description":"Includes API operations for the following:\n- Real-time monitoring\n- Accessing statistics APIs and statistics bulk APIs\n- Retrieving device state\n- Managing alarms and events\n","contact":{"email":"vmanage@cisco.com"},"version":"20.18 - 2025-08-15"},"openapi":"3.1.0","servers":[{"url":"/dataservice"}]},"spec":{"tags":["Monitoring - Power Consumption Statistics"],"description":"Get aggregated data based on input query and filters. The data can be filtered on time and other unique parameters based upon necessity and intended usage","operationId":"getPostAggregationDataByQuery_MonitoringPowerConsumptionStatistics_4004","requestBody":{"description":"Stats query string","content":{"application/json":{"schema":{"type":"object"},"examples":{"power consumption aggregation query":{"description":"power consumption aggregation query","value":{"query":{"condition":"AND","rules":[{"value":["12"],"field":"entry_time","type":"date","operator":"last_n_hours"},{"value":["\u003cPWR_NA/\u003e"],"field":"dir","type":"string","operator":"in"},{"value":["SystemEnergy"],"field":"comp_name","type":"string","operator":"in"}]},"sort":[{"field":"entry_time","type":"date","order":"asc"}],"aggregation":{"histogram":{"property":"entry_time","type":"hour","interval":1,"order":"asc"},"metrics":[{"property":"power_usage","type":"sum"},{"property":"emission","type":"sum"},{"property":"cost","type":"sum"}]}},"$$ref":"#/components/examples/ComViptelaVmanageServerDevicePowerconsumptionStatisticsapiParameterExamplePowerconsumptionaggregation"}}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"cost":{"type":"number","example":0.029},"count":{"type":"integer","format":"int32","example":1},"emission":{"type":"number","example":0.031},"entry_time":{"type":"integer","format":"int32","example":1717056000000},"power_usage":{"type":"number","example":0.19}},"$$ref":"#/components/schemas/PowerConsumptionRespData"}},"entryTimeList":{"type":"array","items":{"type":"integer","format":"int64"}},"header":{"type":"object","properties":{"chart":{"type":"object","properties":{"series":{"type":"array","items":{"type":"string"}},"title":{"type":"string"},"xAxis":{"type":"array","items":{"type":"string"}},"xAxisLabel":{"type":"string"},"yAxis":{"type":"array","items":{"type":"string"}},"yAxisLabel":{"type":"string"}},"$$ref":"#/components/schemas/ChartObject"},"columns":{"required":["dataType","property","title"],"type":"object","properties":{"dataType":{"type":"string","example":"date"},"displayFormat":{"type":"string","example":"DD MMM YYYY h:mm:ss A z"},"hideable":{"type":"boolean","example":true},"inputFormat":{"type":"string","example":"unix-time"},"isDisplay":{"type":"boolean","example":true},"minWidth":{"type":"integer","format":"int32","example":300},"property":{"type":"string","example":"entry_time"},"title":{"type":"string","example":"Timestamp"},"width":{"type":"integer","format":"int32","example":220}},"$$ref":"#/components/schemas/PowerConsumptionColumns"},"fields":{"type":"object","properties":{"dataType":{"type":"string","example":"date"},"property":{"type":"string","example":"entry_time"}},"$$ref":"#/components/schemas/GetStatDataFields"},"generatedOn":{"type":"integer","format":"int64"},"viewKeys":{"type":"object","properties":{"preferenceKey":{"type":"string"},"uniqueKey":{"type":"array","items":{"type":"string"}}},"$$ref":"#/components/schemas/PowerConsumptionViewKeys"}},"$$ref":"#/components/schemas/PowerConsumptionRespHeader"}},"$$ref":"#/components/schemas/PowerConsumptionResp"}}}}},"400":{"description":"Bad Request"},"403":{"description":"Forbidden"},"500":{"description":"Internal Server Error"}},"x-roles-required":"Energy Management-read","method":"post","path":"/statistics/powerconsumption/aggregation"}}