Coder Social home page Coder Social logo

llocer_ocpi's Introduction

llocer_ocpi

llocer_ocpi is a Free and Open Source librarian that allows implementation of OCPI 2.2.1 nodes.

The librarian elements can be split in two levels:

  • the HTTP servlet to handle OCPI request and the HTTP request builder to send OCPI request.
  • the implementation of the OCPI sender/receiver interfaces described in the specification.

See repository llocer_ev_examples for usage examples.

configuration

Optional configuration file is /etc/ocpi.conf. It must be in json format. The default is:

{
    "public_url": "http://127.0.0.1:8080",
    "private_uri_length": 0,
    "pagination_limit": 100,
    "testing_no_change_credentials": false
}

where:

  • public_url: The server public address (not including the trailing path of the OCPI servlets and query arguments)
  • private_url_length : The length of the path of the server private address. Usually, if the server is not behind a loadbalancer or similar, the public and private addresses will be the same.
  • pagination_limit: maximum number of items to be sent in a pagination request.
  • testing_no_change_credentials: for testing only, a new token will be not generated when new credentials are received from a peer node.

Example:

Assume you public server address is "https://my.com/cso". The loadbalancer redirects the request to a private server with address "https://192.168.21.21:8080/foo/bar" and you have an OCPI servlet serving request on it at "http://192.168.21.21:8080/foo/bar/cso/ocpi/...". Configuration must be:

  • "public_url": "https://my.com/cso"
  • "private_url_length": 2 (number of elements in "/foo/bar")

URL of module interfaces

Following with the same example, if the OCPI servlet is defined in web.xml as:

<servlet-mapping>
     <servlet-name>CpoOcpiServlet</servlet-name>
     <url-pattern>/ocpi/*</url-pattern>
</servlet-mapping>

the initial versions query must be sent to:

https://my.com/cso/ocpi

and the endpoints query for OCPI 2.2.1 must be sent to:

https://my.com/cso/ocpi/221

The URL's for the OCPI modules follows the syntax:

<public_url>/<servlet path>/<OCPI version>/<module>/<ocpi path arguments>

by example, a location PUT to the receiver interface with countryCode=ES, partyId=PID and locationId=myLocation must use the following address:

https://my.com/cso/ocpi/221/locations/ES/PID/myLocation

llocer_ocpi's People

Contributors

llocer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

llocer_ocpi's Issues

Usage of OCPI library

Hi, I'm trying to test the location modules example using this library. But I'm having trouble with understanding the main server code which I have to run. What do I have to do to test this library?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.