Personal tools

API

From PhotoVoltaic Logger new generation

Revision as of 09:24, 28 February 2014 by KKoPV (talk | contribs) (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....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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.