{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cisco-catalyst-center/json-schema/cisco-catalyst-center-network-devices-energy-query-response-schema.json",
  "title": "NetworkDevicesEnergyQueryResponse",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cisco-catalyst-center-energy-api-openapi.yml#/components/schemas/NetworkDevicesEnergyQueryResponse",
  "type": "object",
  "properties": {
    "response": {
      "type": "array",
      "description": "Successfully returned list of Devices Energy information",
      "items": {
        "allOf": [
          {
            "$ref": "#/$defs/NetworkDeviceEnergy"
          },
          {
            "type": "object",
            "properties": {
              "aggregateAttributes": {
                "$ref": "#/$defs/DeviceEnergyAggregateAttributesResponse"
              }
            },
            "description": "Response object for device energy summaries query API."
          }
        ]
      }
    },
    "page": {
      "$ref": "#/$defs/NetworkDeviceEnergyPaginationWithAggregateSortBy"
    },
    "version": {
      "type": "string",
      "description": "The version of the response"
    }
  },
  "$defs": {
    "DeviceEnergy": {
      "type": "object",
      "properties": {
        "deviceName": {
          "type": "string",
          "description": "Name of the device."
        },
        "deviceCategory": {
          "type": "string",
          "description": "Category of the device ex - Switch, OtherPOEdevice."
        },
        "deviceSubCategory": {
          "type": "string",
          "description": "Sub category corresponds of the device."
        },
        "siteId": {
          "type": "string",
          "description": "Unique ID of the Site."
        },
        "siteHierarchy": {
          "type": "string",
          "description": "Site hierarchy."
        },
        "siteHierarchyId": {
          "type": "string",
          "description": "Site hierarchy ID."
        },
        "energyConsumed": {
          "type": "number",
          "description": "Total energy consumed in kilowatt-hours (kWh).",
          "format": "double"
        },
        "estimatedCost": {
          "type": "number",
          "description": "Estimated financial cost associated with the energy consumed, in USD.",
          "format": "double"
        },
        "estimatedEmission": {
          "type": "number",
          "description": "Estimated total emissions resulting from energy consumption, in kilograms of CO2 equivalent (kg CO2e).",
          "format": "double"
        },
        "carbonIntensity": {
          "type": "number",
          "description": "Average amount of CO2 emissions per unit of electricity consumed, expressed in gCO2/kWh.",
          "format": "double"
        },
        "nuclearEnergyConsumed": {
          "type": "number",
          "description": "Amount of energy consumed from nuclear sources, in kWh.",
          "format": "double"
        },
        "geothermalEnergyConsumed": {
          "type": "number",
          "description": "Amount of energy consumed from geothermal sources, in kWh.",
          "format": "double"
        },
        "biomassEnergyConsumed": {
          "type": "number",
          "description": "Amount of energy consumed from biomass sources, in kWh.",
          "format": "double"
        },
        "coalEnergyConsumed": {
          "type": "number",
          "description": "Amount of energy consumed from coal sources, in kWh.",
          "format": "double"
        },
        "windEnergyConsumed": {
          "type": "number",
          "description": "Amount of energy consumed from wind power sources, in kWh.",
          "format": "double"
        },
        "solarEnergyConsumed": {
          "type": "number",
          "description": "Amount of energy consumed from solar power sources, in kWh.",
          "format": "double"
        },
        "hydroEnergyConsumed": {
          "type": "number",
          "description": "Amount of energy consumed from hydropower sources, in kWh.",
          "format": "double"
        },
        "gasEnergyConsumed": {
          "type": "number",
          "description": "Amount of energy consumed from natural gas sources, in kWh.",
          "format": "double"
        },
        "oilEnergyConsumed": {
          "type": "number",
          "description": "Amount of energy consumed from oil sources, in kWh.",
          "format": "double"
        },
        "unknownEnergyConsumed": {
          "type": "number",
          "description": "Amount of energy consumed from unspecified or mixed sources, in kWh.",
          "format": "double"
        },
        "hydroDischargeEnergyConsumed": {
          "type": "number",
          "description": "Amount of energy consumed through the discharge of hydropower plants, in kWh.",
          "format": "double"
        },
        "batteryDischargeEnergyConsumed": {
          "type": "number",
          "description": "Amount of energy consumed from the discharge of battery storage systems, in kWh.",
          "format": "double"
        }
      },
      "description": "Assurance Device Energy Summaries details"
    },
    "DeviceEnergyAggregateAttributeKey": {
      "type": "string",
      "description": "Field name on which the aggregate function should be applied when querying the data. The fields supported for aggregation in the API response object are, [energyConsumed, estimatedEmission, estimatedCost, carbonIntensity, deviceCount]",
      "enum": [
        "energyConsumed",
        "estimatedEmission",
        "estimatedCost",
        "carbonIntensity",
        "deviceCount",
        "nuclearEnergyConsumed",
        "geothermalEnergyConsumed",
        "biomassEnergyConsumed",
        "coalEnergyConsumed",
        "windEnergyConsumed",
        "solarEnergyConsumed",
        "hydroEnergyConsumed",
        "gasEnergyConsumed",
        "oilEnergyConsumed",
        "unknownEnergyConsumed",
        "hydroDischargeEnergyConsumed",
        "batteryDischargeEnergyConsumed",
        "renewableEnergyConsumed",
        "nonRenewableEnergyConsumed",
        "fossilEnergyConsumed",
        "fossilFreeEnergyConsumed",
        "energySavings",
        "costSavings",
        "emissionSavings"
      ]
    },
    "DeviceEnergyAggregateAttributesResponse": {
      "type": "array",
      "description": "Response object for device energy aggregate attributes.",
      "items": {
        "$ref": "#/$defs/DeviceEnergyAggregateAttributesResponse_inner"
      }
    },
    "DeviceEnergyAggregateAttributesResponse_inner": {
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/$defs/DeviceEnergyAggregateAttributeKey"
        },
        "function": {
          "$ref": "#/$defs/Function"
        },
        "value": {
          "type": "number",
          "description": "The value for the attribute field in the given time rang"
        }
      }
    },
    "Function": {
      "type": "string",
      "description": "Type of aggregate function to apply on the field when querying   data",
      "enum": [
        "sum",
        "min",
        "max",
        "avg",
        "count",
        "latest",
        "distinctCount",
        "median"
      ]
    },
    "NetworkDeviceEnergy": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique ID of the Device."
        }
      },
      "description": "Assurance Network Device Energy Summaries details",
      "allOf": [
        {
          "$ref": "#/$defs/DeviceEnergy"
        }
      ]
    },
    "NetworkDeviceEnergyAttribute": {
      "type": "string",
      "description": "Field names which are supported by this API as attributes.",
      "enum": [
        "id",
        "deviceName",
        "deviceCategory",
        "deviceSubCategory",
        "siteId",
        "siteHierarchy",
        "siteHierarchyId",
        "energyConsumed",
        "estimatedCost",
        "estimatedEmission",
        "carbonIntensity",
        "nuclearEnergyConsumed",
        "geothermalEnergyConsumed",
        "biomassEnergyConsumed",
        "coalEnergyConsumed",
        "windEnergyConsumed",
        "solarEnergyConsumed",
        "hydroEnergyConsumed",
        "gasEnergyConsumed",
        "oilEnergyConsumed",
        "unknownEnergyConsumed",
        "hydroDischargeEnergyConsumed",
        "batteryDischargeEnergyConsumed",
        "renewableEnergyConsumed",
        "nonRenewableEnergyConsumed",
        "fossilEnergyConsumed",
        "fossilFreeEnergyConsumed",
        "energySavings",
        "costSavings",
        "emissionSavings"
      ]
    },
    "NetworkDeviceEnergyPaginationWithAggregateSortBy": {
      "type": "object",
      "properties": {
        "limit": {
          "type": "integer",
          "description": "The reference to the limit applied in the Pagination Request."
        },
        "cursor": {
          "type": "string",
          "description": "It's an opaque string field that indicates the next record in the requested collection. If no records remain, the API returns a response with a count of zero. The default value is an empty string, and the initial value must be an empty string. The cursor value is populated by the API in the response page block. If the user wants more records, the cursor in the subsequent request must be updated with the value from the previous response.",
          "default": ""
        },
        "count": {
          "type": "integer",
          "description": "Total number of records related to the resource after applying applicable filtering"
        },
        "sortBy": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/NetworkDeviceEnergySortByObj"
          }
        }
      },
      "description": "Pagination model with support for aggregate sort by."
    },
    "NetworkDeviceEnergySortByObj": {
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/$defs/NetworkDeviceEnergyAttribute"
        },
        "order": {
          "type": "string",
          "description": "The sort order of the field ascending or descending.",
          "enum": [
            "asc",
            "desc"
          ]
        },
        "function": {
          "$ref": "#/$defs/Function"
        }
      },
      "description": "This is a unified sortBy model for attributes and aggregate attributes request. If function is specified then API will sort the collection on aggregated attribute. If function is not specified API will sort the collection on attribute.\n"
    }
  }
}