From f8071f82f01185cf93d4214fc090170c94da4e72 Mon Sep 17 00:00:00 2001 From: VitaliiSorokin Date: Fri, 28 Oct 2022 10:26:21 -0600 Subject: [PATCH] Electricity Maps (Independent Publisher) (#1996) * Electricity Maps (Independent Publisher) * added electricity map connector artifacts * updated after PR review --- .../Electricity Maps/Readme.md | 54 + .../apiDefinition.swagger.json | 1238 +++++++++++++++++ .../Electricity Maps/apiProperties.json | 84 ++ 3 files changed, 1376 insertions(+) create mode 100644 independent-publisher-connectors/Electricity Maps/Readme.md create mode 100644 independent-publisher-connectors/Electricity Maps/apiDefinition.swagger.json create mode 100644 independent-publisher-connectors/Electricity Maps/apiProperties.json diff --git a/independent-publisher-connectors/Electricity Maps/Readme.md b/independent-publisher-connectors/Electricity Maps/Readme.md new file mode 100644 index 000000000..4b0da35a7 --- /dev/null +++ b/independent-publisher-connectors/Electricity Maps/Readme.md @@ -0,0 +1,54 @@ +# Electricity Maps Connector + +You can use Electricity Maps API to get access to information about +where the electricity in a specific area comes from, +how much carbon was emitted to produce it. +Furthermore, you can use this API to get historical data, live data and forecasts. + +## Source +[Electricity Maps API docs](https://static.electricitymaps.com/api/docs/index.html) + +## Publisher: Vitalii Sorokin + +## Prerequisites +This API uses an API key. +The API key should be included as a header in all requests. Don't have an API key [Contact Electricity Maps](https://www.electricitymaps.com/#contactform) or [sign up](https://api-portal.electricitymaps.com) for a free trial product or subscribe for a product for your needs. + +## Getting Started +To create a connection you need to enter the Base URL of the subscribed product and corresponding API Key. You can find these values in your profile at [Electricity Map API Portal](https://api-portal.electricitymaps.com). + +## Known Issues and Limitations +There are no known issues at this time. + +## Supported Operations + +### Get Carbon Intensity Forecast +Retrieves the forecasted carbon intensity (in gCO2eq/kWh) of an area. It can either be queried by zone identifier or by geolocation. + +### Get Carbon Intensity History +Retrieves the last 24h of carbon intensity (in gCO2eq/kWh) of an area. It can either be queried by zone identifier or by geolocation. The resolution is 60 minutes. + +### Get Live Carbon Intensity +Retrieves the last known carbon intensity (in gCO2eq/kWh) of electricity consumed in an area. It can either be queried by zone identifier or by geolocation. + +### Get Power Breakdown History +Retrieves the last 24h of power consumption and production breakdown of an area, which represents the physical origin of electricity broken down by production type. It can either be queried by zone identifier or by geolocation. The resolution is 60 minutes. + +### Get Live Power Breakdown +Retrieves the last known data about the origin of electricity in an area. +`Power Production` (in MW) represents the electricity produced in the zone, broken down by production type +`Power Consumption` (in MW) represents the electricity consumed in the zone, after taking into account imports and exports, and broken down by production type. +`Power Export` and `Power Import` (in MW) represent the physical electricity flows at the zone border +`Renewable Percentage` and `FossilFree Percentage` refers to the % of the power consumption breakdown coming from renewables or fossil-free power plants (renewables and nuclear) It can either be queried by zone identifier or by geolocation. + +### Get Power Consumption Forecast +Retrieves the forecasted power consumption breakdown of an area, which represents the physical origin of electricity broken down by production type. It can either be queried by zone identifier or by geolocation. + +### Get Power Production Forecast +Retrieves the forecasted power production breakdown of an area by production type. It can either be queried by zone identifier or by geolocation. + +### Get Available Zones +Returns all zones available. + +### Check API Health + Can be used to automatically verify that the Electricity Maps API is up. \ No newline at end of file diff --git a/independent-publisher-connectors/Electricity Maps/apiDefinition.swagger.json b/independent-publisher-connectors/Electricity Maps/apiDefinition.swagger.json new file mode 100644 index 000000000..453379a88 --- /dev/null +++ b/independent-publisher-connectors/Electricity Maps/apiDefinition.swagger.json @@ -0,0 +1,1238 @@ +{ + "swagger": "2.0", + "info": { + "description": "You can use Electricity Maps API to get information about where the electricity in a specific area comes from, how much carbon was emitted to produce it, and to get historical data, live data and forecasts.", + "title": "Electricity Maps", + "version": "1.0", + "contact": { + "name": "Vitalii Sorokin", + "url": "https://www.electricitymaps.com/", + "email": "sorokindva@gmail.com" + } + }, + "host": "api-access.electricitymaps.com", + "basePath": "/", + "schemes": ["https"], + "consumes": [], + "produces": [], + "paths": { + "/carbon-intensity/forecast": { + "get": { + "parameters": [ + { + "name": "zone", + "in": "query", + "required": false, + "type": "string", + "description": "A string representing the zone identifier.", + "x-ms-summary": "Country or Zone", + "x-ms-visibility": "important", + "x-ms-dynamic-values": { + "operationId": "GetZones", + "value-path": "Name", + "value-collection": "Zones", + "value-title": "Details/zoneName" + } + }, + { + "name": "lon", + "in": "query", + "required": false, + "type": "string", + "description": "Longitude(if querying with a geolocation).", + "x-ms-summary": "Longitude", + "x-ms-visibility": "advanced" + }, + { + "name": "lat", + "in": "query", + "required": false, + "type": "string", + "description": "Latitude (if querying with a geolocation).", + "x-ms-summary": "Latitude", + "x-ms-visibility": "advanced" + } + ], + "responses": { + "200": { + "description": "Default response.", + "schema": { + "properties": { + "forecast": { + "items": { + "properties": { + "carbonIntensity": { + "type": "number", + "description": "Forecasted carbon intensity (gCO2eq/kWh).", + "x-ms-summary": "Carbon Intensity" + }, + "datetime": { + "type": "string", + "description": "Forecast datetime in ISO format.", + "x-ms-summary": "Date and Time" + } + }, + "type": "object", + "description": "Forecasted carbon intensity object.", + "x-ms-summary": "Carbon Intensity Forecast" + }, + "type": "array", + "description": "Array of carbon intensity forecasts.", + "x-ms-summary": "Forecasts" + }, + "updatedAt": { + "type": "string", + "description": "Date and time when data has been updated.", + "x-ms-summary": "Updated At" + }, + "zone": { + "type": "string", + "description": "Country or Zone.", + "x-ms-summary": "Zone" + } + }, + "type": "object" + } + } + }, + "operationId": "CarbonForecast", + "summary": "Get Carbon Intensity Forecast", + "description": "Retrieves the forecasted carbon intensity (in gCO2eq/kWh) of an area. It can either be queried by zone identifier or by geolocation." + } + }, + "/carbon-intensity/history": { + "get": { + "parameters": [ + { + "name": "zone", + "in": "query", + "required": false, + "type": "string", + "description": "A string representing the zone identifier.", + "x-ms-summary": "Country or Zone", + "x-ms-visibility": "important", + "x-ms-dynamic-values": { + "operationId": "GetZones", + "value-path": "Name", + "value-collection": "Zones", + "value-title": "Details/zoneName" + } + }, + { + "name": "lon", + "in": "query", + "required": false, + "type": "string", + "description": "Longitude(if querying with a geolocation).", + "x-ms-summary": "Longitude", + "x-ms-visibility": "advanced" + }, + { + "name": "lat", + "in": "query", + "required": false, + "type": "string", + "description": "Latitude (if querying with a geolocation).", + "x-ms-summary": "Latitude", + "x-ms-visibility": "advanced" + }, + { + "name": "emissionFactorType", + "in": "query", + "required": false, + "type": "string", + "description": "Type of emission factors used for computing the carbon intensity.", + "x-ms-summary": "Emission Factor Type", + "x-ms-visibility": "advanced", + "enum": ["lifecycle", "direct"] + }, + { + "name": "disableEstimations", + "in": "query", + "required": false, + "type": "boolean", + "description": "If estimated data should be disabled.", + "x-ms-summary": "Disable Estimated Data", + "x-ms-visibility": "advanced" + } + ], + "responses": { + "200": { + "description": "Default response.", + "schema": { + "properties": { + "history": { + "items": { + "properties": { + "carbonIntensity": { + "type": "number", + "description": "Historical carbon intensity value(gCO2eq/kWh).", + "x-ms-summary": "Carbon Intensity" + }, + "createdAt": { + "type": "string", + "description": "Date and time when record was created.", + "x-ms-summary": "Created At" + }, + "datetime": { + "type": "string", + "description": "Date and time for current carbon intensity.", + "x-ms-summary": "Date and Time" + }, + "emissionFactorType": { + "type": "string", + "description": "Type of emission factors used for computing the carbon intensity.", + "x-ms-summary": "Emission Factor Type" + }, + "estimationMethod": { + "type": "string", + "description": "Estimation method used for computing the carbon intensity.", + "x-ms-summary": "Estimation Method" + }, + "isEstimated": { + "type": "boolean", + "description": "Was estimated method enabled.", + "x-ms-summary": "Is Estimated" + }, + "updatedAt": { + "type": "string", + "description": "Date and time when record was updated.", + "x-ms-summary": "Updated At" + } + }, + "type": "object" + }, + "type": "array", + "description": "Array of carbon intensity history records.", + "x-ms-summary": "History" + }, + "zone": { + "type": "string", + "description": "Country or Zone.", + "x-ms-summary": "Zone" + } + }, + "type": "object" + } + } + }, + "operationId": "CarbonHistory", + "summary": "Get Carbon Intensity History", + "description": "Retrieves the last 24h of carbon intensity (in gCO2eq/kWh) of an area. It can either be queried by zone identifier or by geolocation. The resolution is 60 minutes." + } + }, + "/carbon-intensity/latest": { + "get": { + "parameters": [ + { + "name": "zone", + "in": "query", + "required": false, + "type": "string", + "description": "A string representing the zone identifier.", + "x-ms-summary": "Country or Zone", + "x-ms-visibility": "important", + "x-ms-dynamic-values": { + "operationId": "GetZones", + "value-path": "Name", + "value-collection": "Zones", + "value-title": "Details/zoneName" + } + }, + { + "name": "lon", + "in": "query", + "required": false, + "type": "string", + "description": "Longitude(if querying with a geolocation).", + "x-ms-summary": "Longitude", + "x-ms-visibility": "advanced" + }, + { + "name": "lat", + "in": "query", + "required": false, + "type": "string", + "description": "Latitude (if querying with a geolocation).", + "x-ms-summary": "Latitude", + "x-ms-visibility": "advanced" + }, + { + "name": "emissionFactorType", + "in": "query", + "required": false, + "type": "string", + "description": "Type of emission factors used for computing the carbon intensity.", + "x-ms-summary": "Emission Factor Type", + "x-ms-visibility": "advanced", + "enum": ["lifecycle", "direct"] + }, + { + "name": "disableEstimations", + "in": "query", + "required": false, + "type": "boolean", + "description": "If estimated data should be disabled.", + "x-ms-summary": "Disable Estimated Data", + "x-ms-visibility": "advanced" + } + ], + "responses": { + "200": { + "description": "Default response.", + "schema": { + "properties": { + "carbonIntensity": { + "type": "number", + "description": "Live carbon intensity value(gCO2eq/kWh).", + "x-ms-summary": "Carbon Intensity" + }, + "datetime": { + "type": "string", + "description": "Date and time for current carbon intensity.", + "x-ms-summary": "Date and Time" + }, + "emissionFactorType": { + "type": "string", + "description": "Type of emission factors used for computing the carbon intensity.", + "x-ms-summary": "Emission Factor Type" + }, + "estimationMethod": { + "type": "string", + "description": "Estimation method used for computing the carbon intensity.", + "x-ms-summary": "Estimation Method" + }, + "isEstimated": { + "type": "boolean", + "description": "Was estimated method enabled.", + "x-ms-summary": "Is Estimated" + }, + "updatedAt": { + "type": "string", + "description": "Date and time when record was updated.", + "x-ms-summary": "Updated At" + }, + "zone": { + "type": "string", + "description": "Country or Zone.", + "x-ms-summary": "Zone" + } + }, + "type": "object" + } + } + }, + "operationId": "CarbonLatest", + "summary": "Get Live Carbon Intensity", + "description": "Retrieves the last known carbon intensity (in gCO2eq/kWh) of electricity consumed in an area. It can either be queried by zone identifier or by geolocation." + } + }, + "/power-breakdown/history": { + "get": { + "parameters": [ + { + "name": "zone", + "in": "query", + "required": false, + "type": "string", + "description": "A string representing the zone identifier.", + "x-ms-summary": "Country or Zone", + "x-ms-visibility": "important", + "x-ms-dynamic-values": { + "operationId": "GetZones", + "value-path": "Name", + "value-collection": "Zones", + "value-title": "Details/zoneName" + } + }, + { + "name": "lon", + "in": "query", + "required": false, + "type": "string", + "description": "Longitude(if querying with a geolocation).", + "x-ms-summary": "Longitude", + "x-ms-visibility": "advanced" + }, + { + "name": "lat", + "in": "query", + "required": false, + "type": "string", + "description": "Latitude (if querying with a geolocation).", + "x-ms-summary": "Latitude", + "x-ms-visibility": "advanced" + }, + { + "name": "disableEstimations", + "in": "query", + "required": false, + "type": "boolean", + "description": "If estimated data should be disabled.", + "x-ms-summary": "Disable Estimated Data", + "x-ms-visibility": "advanced" + } + ], + "responses": { + "200": { + "description": "Default response.", + "schema": { + "properties": { + "history": { + "items": { + "properties": { + "datetime": { + "type": "string", + "description": "Power breakdown data date and time.", + "x-ms-summary": "Date and Time" + }, + "estimationMethod": { + "type": "string", + "description": "Estimation method used for computing the power breakdown.", + "x-ms-summary": "Estimation Method" + }, + "fossilFreePercentage": { + "type": "number", + "description": "Percentage of the power consumption breakdown coming from renewables or fossil-free power plants.", + "x-ms-summary": "Fossil Free Percentage" + }, + "isEstimated": { + "type": "boolean", + "description": "Was estimated method enabled.", + "x-ms-summary": "Is Estimated" + }, + "powerConsumptionBreakdown": { + "properties": { + "battery discharge": { + "type": "number", + "description": "Battery discharge consumption in MW.", + "x-ms-summary": "Battery Discharge" + }, + "biomass": { + "type": "number", + "description": "Biomass power consumption(in MW).", + "x-ms-summary": "Biomass" + }, + "coal": { + "type": "number", + "description": "Coal power consumption(in MW).", + "x-ms-summary": "Coal" + }, + "gas": { + "type": "number", + "description": "Gas power consumption(in MW).", + "x-ms-summary": "Gas" + }, + "geothermal": { + "type": "number", + "description": "Geothermal power consumption(in MW).", + "x-ms-summary": "Geothermal" + }, + "hydro": { + "type": "number", + "description": "Hydro power consumption(in MW).", + "x-ms-summary": "Hydro" + }, + "hydro discharge": { + "type": "number", + "description": "Hydro discharge consumption(in MW).", + "x-ms-summary": "Hydro Discharge" + }, + "nuclear": { + "type": "number", + "description": "Nuclear power consumption(in MW).", + "x-ms-summary": "Nuclear" + }, + "oil": { + "type": "number", + "description": "Oil power consumption(in MW).", + "x-ms-summary": "Oil" + }, + "solar": { + "type": "number", + "description": "Solar power consumption(in MW).", + "x-ms-summary": "Solar" + }, + "unknown": { + "type": "number", + "description": "Unknown power consumption(in MW).", + "x-ms-summary": "Unknown" + }, + "wind": { + "type": "number", + "description": "Wind power consumption(in MW).", + "x-ms-summary": "Wind" + } + }, + "type": "object", + "description": "Power Consumption Data.", + "x-ms-summary": "Power Consumption" + }, + "powerConsumptionTotal": { + "type": "number", + "description": "Power Consumption Total(in MW).", + "x-ms-summary": "Total Consumption" + }, + "powerExportBreakdown": { + "properties": {}, + "type": "object", + "description": "Power Export Breakdown by zones (in MW).", + "x-ms-summary": "Power Export Breakdown" + }, + "powerExportTotal": { + "type": "number", + "description": "Total Power Export(in MW).", + "x-ms-summary": "Power Export Total" + }, + "powerImportBreakdown": { + "properties": {}, + "type": "object", + "description": "Power Import Breakdown by zones(in MW).", + "x-ms-summary": "Power Import Breakdown" + }, + "powerImportTotal": { + "type": "number", + "description": "Total Power Import (in MW).", + "x-ms-summary": "Power Import Total" + }, + "powerProductionBreakdown": { + "properties": { + "battery discharge": { + "type": "number", + "description": "Battery discharge production in MW.", + "x-ms-summary": "Battery Discharge" + }, + "biomass": { + "type": "number", + "description": "Biomass power production in MW.", + "x-ms-summary": "Biomass" + }, + "coal": { + "type": "number", + "description": "Coal power production in MW.", + "x-ms-summary": "Coal" + }, + "gas": { + "type": "number", + "description": "Gas power production in MW.", + "x-ms-summary": "Gas" + }, + "geothermal": { + "type": "number", + "description": "Geothermal power production in MW.", + "x-ms-summary": "Geothermal" + }, + "hydro": { + "type": "number", + "description": "Hydro power production in MW.", + "x-ms-summary": "Hydro" + }, + "hydro discharge": { + "type": "number", + "description": "Hydro discharge production in MW.", + "x-ms-summary": "Hydro discharge" + }, + "nuclear": { + "type": "number", + "description": "Nuclear power production in MW.", + "x-ms-summary": "Nuclear" + }, + "oil": { + "type": "number", + "description": "Oil power production in MW.", + "x-ms-summary": "Oil" + }, + "solar": { + "type": "number", + "description": "Solar power production in MW.", + "x-ms-summary": "Solar" + }, + "unknown": { + "type": "number", + "description": "Unknown power production in MW.", + "x-ms-summary": "Unknown" + }, + "wind": { + "type": "number", + "description": "Wind power production in MW.", + "x-ms-summary": "Wind" + } + }, + "type": "object", + "description": "Power Production Data.", + "x-ms-summary": "Power Production" + }, + "powerProductionTotal": { + "type": "number", + "description": "Power Production Total(in MW).", + "x-ms-summary": "Total Production" + }, + "renewablePercentage": { + "type": "number", + "description": "Percentage of renewable energy.", + "x-ms-summary": "Renewables Percentage" + } + }, + "type": "object" + }, + "type": "array" + }, + "zone": { + "type": "string", + "description": "Country or Zone.", + "x-ms-summary": "Zone" + } + }, + "type": "object" + } + } + }, + "operationId": "BreakdownHistory", + "summary": "Get Power Breakdown History", + "description": "Retrieves the last 24h of power consumption and production breakdown of an area, which represents the physical origin of electricity broken down by production type. It can either be queried by zone identifier or by geolocation. The resolution is 60 minutes." + } + }, + "/power-breakdown/latest": { + "get": { + "parameters": [ + { + "name": "zone", + "in": "query", + "required": false, + "type": "string", + "description": "A string representing the zone identifier.", + "x-ms-summary": "Country or Zone", + "x-ms-visibility": "important", + "x-ms-dynamic-values": { + "operationId": "GetZones", + "value-path": "Name", + "value-collection": "Zones", + "value-title": "Details/zoneName" + } + }, + { + "name": "lon", + "in": "query", + "required": false, + "type": "string", + "description": "Longitude(if querying with a geolocation).", + "x-ms-summary": "Longitude", + "x-ms-visibility": "advanced" + }, + { + "name": "lat", + "in": "query", + "required": false, + "type": "string", + "description": "Latitude (if querying with a geolocation).", + "x-ms-summary": "Latitude", + "x-ms-visibility": "advanced" + }, + { + "name": "disableEstimations", + "in": "query", + "required": false, + "type": "boolean", + "description": "If estimated data should be disabled.", + "x-ms-summary": "Disable Estimated Data", + "x-ms-visibility": "advanced" + } + ], + "responses": { + "200": { + "description": "Default response.", + "schema": { + "properties": { + "createdAt": { + "type": "string", + "description": "Date and time when data has been created.", + "x-ms-summary": "Created At" + }, + "datetime": { + "type": "string", + "description": "Date and time for current power breakdown.", + "x-ms-summary": "Date and Time" + }, + "estimationMethod": { + "type": "string", + "description": "Estimation method used for computing the power breakdown.", + "x-ms-summary": "Estimation Method" + }, + "fossilFreePercentage": { + "type": "number", + "description": "Percentage of the power consumption breakdown coming from renewables or fossil-free power plants.", + "x-ms-summary": "Fossil Free Percentage" + }, + "isEstimated": { + "type": "boolean", + "description": "Was estimated method enabled.", + "x-ms-summary": "Is Estimated" + }, + "powerConsumptionBreakdown": { + "properties": { + "battery discharge": { + "type": "number", + "description": "Battery discharge consumption in MW.", + "x-ms-summary": "Battery Discharge" + }, + "biomass": { + "type": "number", + "description": "Biomass power consumption(in MW).", + "x-ms-summary": "Biomass" + }, + "coal": { + "type": "number", + "description": "Coal power consumption(in MW).", + "x-ms-summary": "Coal" + }, + "gas": { + "type": "number", + "description": "Gas power consumption(in MW).", + "x-ms-summary": "Gas" + }, + "geothermal": { + "type": "number", + "description": "Geothermal power consumption(in MW).", + "x-ms-summary": "Geothermal" + }, + "hydro": { + "type": "number", + "description": "Hydro power consumption(in MW).", + "x-ms-summary": "Hydro" + }, + "hydro discharge": { + "type": "number", + "description": "Hydro discharge consumption(in MW).", + "x-ms-summary": "Hydro Discharge" + }, + "nuclear": { + "type": "number", + "description": "Nuclear power consumption(in MW).", + "x-ms-summary": "Nuclear" + }, + "oil": { + "type": "number", + "description": "Oil power consumption(in MW).", + "x-ms-summary": "Oil" + }, + "solar": { + "type": "number", + "description": "Solar power consumption(in MW).", + "x-ms-summary": "Solar" + }, + "unknown": { + "type": "number", + "description": "Unknown power consumption(in MW).", + "x-ms-summary": "Unknown" + }, + "wind": { + "type": "number", + "description": "Wind power consumption(in MW).", + "x-ms-summary": "Wind" + } + }, + "type": "object", + "description": "Power Consumption Data.", + "x-ms-summary": "Power Consumption" + }, + "powerConsumptionTotal": { + "type": "number", + "description": "Power Consumption Total(in MW).", + "x-ms-summary": "Total Consumption" + }, + "powerExportBreakdown": { + "properties": {}, + "type": "object", + "description": "Power Export Breakdown by zones (in MW).", + "x-ms-summary": "Power Export Breakdown" + }, + "powerExportTotal": { + "type": "number", + "description": "Total Power Export(in MW).", + "x-ms-summary": "Power Export Total" + }, + "powerImportBreakdown": { + "properties": {}, + "type": "object", + "description": "Power Import Breakdown by zones(in MW).", + "x-ms-summary": "Power Import Breakdown" + }, + "powerImportTotal": { + "type": "number", + "description": "Total Power Import (in MW).", + "x-ms-summary": "Power Import Total" + }, + "powerProductionBreakdown": { + "properties": { + "battery discharge": { + "type": "number", + "description": "Battery discharge production in MW.", + "x-ms-summary": "Battery Discharge" + }, + "biomass": { + "type": "number", + "description": "Biomass power production in MW.", + "x-ms-summary": "Biomass" + }, + "coal": { + "type": "number", + "description": "Coal power production in MW.", + "x-ms-summary": "Coal" + }, + "gas": { + "type": "number", + "description": "Gas power production in MW.", + "x-ms-summary": "Gas" + }, + "geothermal": { + "type": "number", + "description": "Geothermal power production in MW.", + "x-ms-summary": "Geothermal" + }, + "hydro": { + "type": "number", + "description": "Hydro power production in MW.", + "x-ms-summary": "Hydro" + }, + "hydro discharge": { + "type": "number", + "description": "Hydro discharge production in MW.", + "x-ms-summary": "Hydro discharge" + }, + "nuclear": { + "type": "number", + "description": "Nuclear power production in MW.", + "x-ms-summary": "Nuclear" + }, + "oil": { + "type": "number", + "description": "Oil power production in MW.", + "x-ms-summary": "Oil" + }, + "solar": { + "type": "number", + "description": "Solar power production in MW.", + "x-ms-summary": "Solar" + }, + "unknown": { + "type": "number", + "description": "Unknown power production in MW.", + "x-ms-summary": "Unknown" + }, + "wind": { + "type": "number", + "description": "Wind power production in MW.", + "x-ms-summary": "Wind" + } + }, + "type": "object", + "description": "Power Production Data.", + "x-ms-summary": "Power Production" + }, + "powerProductionTotal": { + "type": "number", + "description": "Power Production Total(in MW).", + "x-ms-summary": "Total Production" + }, + "renewablePercentage": { + "type": "number", + "description": "Percentage of renewable energy.", + "x-ms-summary": "Renewables Percentage" + }, + "updatedAt": { + "type": "string", + "description": "Date and time when data has been updated.", + "x-ms-summary": "Updated At" + }, + "zone": { + "type": "string", + "description": "Country or Zone.", + "x-ms-summary": "Zone" + } + }, + "type": "object" + } + } + }, + "operationId": "BreakdownLatest", + "summary": "Get Live Power Breakdown", + "description": "Retrieves the last known data about the origin of electricity in an area." + } + }, + "/power-consumption-breakdown/forecast": { + "get": { + "parameters": [ + { + "name": "zone", + "in": "query", + "required": false, + "type": "string", + "description": "A string representing the zone identifier.", + "x-ms-summary": "Country or Zone", + "x-ms-visibility": "important", + "x-ms-dynamic-values": { + "operationId": "GetZones", + "value-path": "Name", + "value-collection": "Zones", + "value-title": "Details/zoneName" + } + }, + { + "name": "lon", + "in": "query", + "required": false, + "type": "string", + "description": "Longitude(if querying with a geolocation).", + "x-ms-summary": "Longitude", + "x-ms-visibility": "advanced" + }, + { + "name": "lat", + "in": "query", + "required": false, + "type": "string", + "description": "Latitude (if querying with a geolocation).", + "x-ms-summary": "Latitude", + "x-ms-visibility": "advanced" + } + ], + "responses": { + "200": { + "description": "Default response.", + "schema": { + "properties": { + "forecast": { + "items": { + "properties": { + "datetime": { + "type": "string", + "description": "Date and time for the forecast.", + "x-ms-summary": "Date and Time" + }, + "powerConsumptionBreakdown": { + "properties": { + "biomass": { + "type": "number", + "description": "Biomass power consumption forecast.", + "x-ms-summary": "Biomass" + }, + "coal": { + "type": "number", + "description": "Coal power consumption forecast.", + "x-ms-summary": "Coal" + }, + "gas": { + "type": "number", + "description": "Gas power consumption forecast.", + "x-ms-summary": "Gas" + }, + "hydro": { + "type": "number", + "description": "Hydro power consumption forecast.", + "x-ms-summary": "Hydro" + }, + "nuclear": { + "type": "number", + "description": "Nuclear power consumption forecast.", + "x-ms-summary": "Nuclear" + }, + "solar": { + "type": "number", + "description": "Solar power consumption forecast.", + "x-ms-summary": "Solar" + }, + "unknown": { + "type": "number", + "description": "Unknown power consumption forecast.", + "x-ms-summary": "Unknown" + }, + "wind": { + "type": "number", + "description": "Wind power consumption forecast.", + "x-ms-summary": "Wind" + } + }, + "type": "object", + "description": "Power Consumption Breakdown data.", + "x-ms-summary": "Power Consumption Breakdown" + }, + "powerConsumptionTotal": { + "type": "number", + "description": "Power Consumption Total Forecast.", + "x-ms-summary": "Total Consumption" + } + }, + "type": "object" + }, + "type": "array", + "description": "Power Consumption forecast data.", + "x-ms-summary": "Power Consumption Forecast" + }, + "updatedAt": { + "type": "string", + "description": "Date and time when forecast has been updated.", + "x-ms-summary": "Updated At" + }, + "zone": { + "type": "string", + "description": "Country or Zone.", + "x-ms-summary": "Zone" + } + }, + "type": "object" + } + } + }, + "operationId": "ConsumptionForecast", + "summary": "Get Power Consumption Forecast", + "description": "Retrieves the forecasted power consumption breakdown of an area, which represents the physical origin of electricity broken down by production type. It can either be queried by zone identifier or by geolocation." + } + }, + "/power-production-breakdown/forecast": { + "get": { + "parameters": [ + { + "name": "zone", + "in": "query", + "required": false, + "type": "string", + "description": "A string representing the zone identifier.", + "x-ms-summary": "Country or Zone", + "x-ms-visibility": "important", + "x-ms-dynamic-values": { + "operationId": "GetZones", + "value-path": "Name", + "value-collection": "Zones", + "value-title": "Details/zoneName" + } + }, + { + "name": "lon", + "in": "query", + "required": false, + "type": "string", + "description": "Longitude(if querying with a geolocation).", + "x-ms-summary": "Longitude", + "x-ms-visibility": "advanced" + }, + { + "name": "lat", + "in": "query", + "required": false, + "type": "string", + "description": "Latitude (if querying with a geolocation).", + "x-ms-summary": "Latitude", + "x-ms-visibility": "advanced" + } + ], + "responses": { + "200": { + "description": "Default response.", + "schema": { + "properties": { + "forecast": { + "items": { + "properties": { + "datetime": { + "type": "string", + "description": "Date and time for the forecast.", + "x-ms-summary": "Date and Time" + }, + "powerProductionBreakdown": { + "properties": { + "biomass": { + "type": "number", + "description": "Biomass power production forecast.", + "x-ms-summary": "Biomass" + }, + "coal": { + "type": "number", + "description": "Coal power production forecast.", + "x-ms-summary": "Coal" + }, + "gas": { + "type": "number", + "description": "Gas power production forecast.", + "x-ms-summary": "Gas" + }, + "hydro": { + "type": "number", + "description": "Hydro power production forecast.", + "x-ms-summary": "Hydro" + }, + "nuclear": { + "type": "number", + "description": "Nuclear power production forecast.", + "x-ms-summary": "Nuclear" + }, + "oil": { + "type": "number", + "description": "Oil power production forecast.", + "x-ms-summary": "Oil" + }, + "solar": { + "type": "number", + "description": "Solar power production forecast.", + "x-ms-summary": "Solar" + }, + "unknown": { + "type": "number", + "description": "Unknown power production forecast.", + "x-ms-summary": "Unknown" + }, + "wind": { + "type": "number", + "description": "Wind power production forecast.", + "x-ms-summary": "Wind" + } + }, + "type": "object", + "description": "Power Production Breakdown data.", + "x-ms-summary": "Power Production Breakdown" + }, + "powerProductionTotal": { + "type": "number", + "description": "Power Production Total Forecast.", + "x-ms-summary": "Total Production" + } + }, + "type": "object" + }, + "type": "array", + "description": "Power Production forecast data.", + "x-ms-summary": "Power Production Forecast" + }, + "updatedAt": { + "type": "string", + "description": "Date and time when forecast has been updated.", + "x-ms-summary": "Updated At" + }, + "zone": { + "type": "string", + "description": "Country or Zone.", + "x-ms-summary": "Zone" + } + }, + "type": "object" + } + } + }, + "operationId": "BreakdownForecast", + "summary": "Get Power Production Forecast", + "description": "Retrieves the forecasted power production breakdown of an area by production type. It can either be queried by zone identifier or by geolocation." + } + }, + "/zones": { + "get": { + "responses": { + "200": { + "description": "default", + "schema": { + "type": "object", + "properties": { + "Zones": { + "type": "array", + "items": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name" + }, + "Details": { + "type": "object", + "properties": { + "zoneName": { + "type": "string", + "description": "Name of zone.", + "x-ms-summary": "Zone Name" + }, + "countryName": { + "type": "string", + "description": "Name of country.", + "x-ms-summary": "Country Name" + } + }, + "description": "Details for Zone.", + "x-ms-summary": "Zone Details" + } + } + }, + "description": "Zone List.", + "x-ms-summary": "Zones" + } + } + } + } + }, + "summary": "Get Available Zones", + "description": "A list of countries and zones by code (zone being the country is divided by zones seen on app.electricitymap.org).", + "operationId": "GetZones", + "parameters": [] + } + }, + "/health": { + "get": { + "responses": { + "200": { + "description": "default", + "schema": { + "type": "object", + "properties": { + "monitors": { + "type": "object", + "properties": { + "state": { + "type": "string", + "description": "Current API State.", + "x-ms-summary": "State" + } + } + }, + "status": { + "type": "string", + "description": "Current API Status.", + "x-ms-summary": "Status" + } + } + } + } + }, + "summary": "Check API Health", + "description": "Verify that the Electricity Maps API is up.", + "operationId": "CheckHealth", + "parameters": [] + } + } + }, + "definitions": {}, + "parameters": {}, + "responses": {}, + "securityDefinitions": { + "API Key": { + "type": "apiKey", + "in": "header", + "name": "x-blobr-key" + } + }, + "security": [ + { + "API Key": [] + } + ], + "tags": [], + "x-ms-connector-metadata": [ + { + "propertyName": "Website", + "propertyValue": "https://www.electricitymaps.com/" + }, + { + "propertyName": "Privacy policy", + "propertyValue": "https://www.electricitymaps.com/privacy-policy" + }, + { + "propertyName": "Categories", + "propertyValue": "Data" + } + ] +} diff --git a/independent-publisher-connectors/Electricity Maps/apiProperties.json b/independent-publisher-connectors/Electricity Maps/apiProperties.json new file mode 100644 index 000000000..0f395ba39 --- /dev/null +++ b/independent-publisher-connectors/Electricity Maps/apiProperties.json @@ -0,0 +1,84 @@ +{ + "properties": { + "connectionParameters": { + "api_key": { + "type": "securestring", + "uiDefinition": { + "displayName": "API Key", + "description": "The API Key for this api", + "tooltip": "Provide your API Key", + "constraints": { + "tabIndex": 2, + "clearText": false, + "required": "true" + } + } + }, + "base_product_url": { + "type": "string", + "uiDefinition": { + "displayName": "Base Product URL", + "description": "The base URL of subscribed product at Electricity Maps", + "tooltip": "Provide your base product URL", + "constraints": { + "tabIndex": 3, + "clearText": false, + "required": "true" + } + } + } + }, + "policyTemplateInstances": [ + { + "templateId": "dynamichosturl", + "title": "Set Zone Host", + "parameters": { + "x-ms-apimTemplateParameter.urlTemplate": "https://api.electricitymap.org", + "x-ms-apimTemplate-operationName": ["GetZones", "CheckHealth"] + } + }, + { + "templateId": "routerequesttoendpoint", + "title": "Set Zone Path", + "parameters": { + "x-ms-apimTemplateParameter.newPath": "/v3/zones", + "x-ms-apimTemplateParameter.httpMethod": "@Request.OriginalHTTPMethod", + "x-ms-apimTemplate-operationName": ["GetZones"] + } + }, + { + "templateId": "dynamichosturl", + "title": "Set Base URL for product API", + "parameters": { + "x-ms-apimTemplateParameter.urlTemplate": "@connectionParameters('base_product_url')", + "x-ms-apimTemplate-operationName": [ + "CarbonForecast", + "CarbonHistory", + "CarbonLatest", + "BreakdownHistory", + "BreakdownLatest", + "ConsumptionForecast", + "BreakdownForecast" + ] + } + }, + { + "templateId": "convertobjecttoarray", + "title": "Process Zone Payload", + "parameters": { + "x-ms-apimTemplateParameter.propertyParentPath": "@body()", + "x-ms-apimTemplateParameter.propertySubPath": "null", + "x-ms-apimTemplateParameter.newPropertyPath": "@body().Zones", + "x-ms-apimTemplateParameter.keyName": "Name", + "x-ms-apimTemplateParameter.valueName": "Details", + "x-ms-apimTemplate-policySection": "Response", + "x-ms-apimTemplate-operationName": ["GetZones"] + } + } + ], + "iconBrandColor": "#da3b01", + "capabilities": [], + "publisher": "Vitalii Sorokin", + "stackOwner": "Electricity Maps" + } +}