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:
See repository llocer_ev_examples for usage examples.
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:
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:
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