Grid-Tariff-Api is an implementation of "Nettariff API" specified by DiginEnergi.
"Nettariff-API" is a specification for an API which purpose is to serve information regarding electrical grid tariffs including prices per hour.
DiginEnergi is a Norwegian consortium working with information models and standards related to the national electricity grid of Norway.
"Nettariff-API" specification is available for download from github here
For terms and conditions and further details please read the following (in Norwegian).
Returns a list of available tariffs
Returns prices per hour for the given tariff for the given timeperiod.
Returns prices per hour for given timeperiod for the unique tariffs connected to the list of meteringpoints.
Each tariff contains a list of meteringpoints using the tariff.
Attached to each meteringpoint is a reference to a fixedpricelevel which currently applies to the meteringpoint.
The reference to fixedpricelevel is deduced by max consumption (kWh) for the meteringpoint for the current month.
Implementation of the API.
Unit tests for the implementation of the API.
Project for hosting the API.
The purpose of this project is to handle everything regarding setup, hosting and security of the API.
Anyone wanting to utilize GridTariffApi.lib for implementing "Nettariff-API" is required to write their own project for hosting the API.
This particual implementation is used by Elvia AS.
Not needed for GridTariffApi.lib.
The project is Elvia AS specific and is responsible for synchronizing meteringpoints and their relation to grid tariffs.
It is only used for an earlier version of the API not specified by DiginEnergi.
This project is to be phased out at a later time.
Unit tests for project GridTariffApiSynchronizer.lib
All folders with name "Pilot" is related to an earlier version of the API not specificed by DiginEnergi.
The content of these folders is not needed for the implementation of API specified by DiginEneregi.
These folders are scheduled for removal.
Contains classes for configuration of the project.
Contains controllers for the offered functionality
Subfolder v1 containts controllers for the "Nettariff-API" specified by DiginEnergi.
Subfolder Pilot is to be removed, it is an earlier version of the API not specified by DiginEnergi.
Contains Entity Framework classes for database persisting tariff information.
The content of this project is only used by an earlier version of the API not specified by DiginEnergi.
It is to be phased out at a later time
Interfaces used by GridTariff.lib to fetch data.
These are to be implemented by anyone wanting to use GridTariff.lib.
Contains classes for request/response objects used by controllers,
Subfolder Pilot is to be removed, it is related to an earlier version of the API not specified by DiginEnergi.
Contains classes with business logic used by controllers Subfolder Pilot is to be removed, it is related to an earlier version of the API not specified by DiginEnergi
This folder is to be removed, it is related to an earlier version of the API not specified by DiginEnergi
Contains classes related to documentation of Api.
Sample build/deployment files.
These project is native to Elvia.
Contains this file.
Contains Dockerfile native to Elvia.
You'll need the following tools to get started:
Start by cloning this repo.
Then navigate into the /GridTariffApi
folder and start the application with dotnet run
:
$ GridTariffApi> dotnet run
Note that API will fail at startup outside Elvia environment.
This is due to project GridTariffAPI is using Elvia-specific components.
See paragraph GridTariffApi for details.
If you want to run the tests, navigate into the /GridTariffApi.Lib
folder and run dotnet test
:
$ GridTariffApi.Lib> dotnet test
GridTariffApi.lib uses classes under the Config directory for containing configuration.
These classes may be configured from appsettings.json, or any other mechanism.
GridTariff Api has been successfully deployed with Azure Api Management in front.
Deployment was done using [Api Management Suite] (https://marketplace.visualstudio.com/items?itemName=stephane-eyskens.apim) , but other deployment strategies may also work.