Difference between revisions of "API"
From PhotoVoltaic Logger new generation
(Created page with "== Abstract == <blockquote>An application programming interface (API) is a protocol intended to be used as an interface by software components to communicate with each other....") |
(No difference)
|
Revision as of 08:24, 28 February 2014
Abstract
An application programming interface (API) is a protocol intended to be used as an interface by software components to communicate with each other." -- Wikipedia:API
The API is implemented as a RESTful API, so it uses HTTP requests to store and read data. Thus, REST uses HTTP for all four CRUD (Create/Read/Update/Delete) operations.
PVLng supports all of them:
- PUT = create
- GET = read
- POST = update
- DELETE = delete
Data storage
For data storage we have two possibilities:
- Web front end for the master data, like channels and their relationships
- HTTP REST API for the operational channel data with HTTP PUT requests
The storage API accepts only one parameter data and routes it to the requested channel.
By default (load live data) system date and time will be used.
The model behind the channel represents the interface to the database.
Data readout
The data readout from the system must be done with HTTP GET requests.
The readout API analyzes the requests, identifies the channel and returns the extracted data.
The model behind the channel provides a defined interface to query data.