CPNaaS API Preview

CPN Tools Logo CloudA couple days ago, I wrote about my idea for an API for CPNs, CPNaaS.  I’ve now gotten around to starting specifying the API.  The service comprises 4 APIs and one tentative API: the specification and syntax check API, the simulation API, the simulation-based analysis API, and the state-space-based verification API.  In addition, I’m planning a web service API.

The syntax check API makes it possible to create models and have them syntax-checked.  This API will be useful for editors.  The API focuses on storing CPNs as semantical objects, i.e., places, transitions, arcs, declarations, and hierarchy, all with a number of labels.  In addition, it supports adding auxiliary information, which is useful for storing graphical attributes.  The API supports sharing models with read-only access, so it is easy to grant other applications access to models without fear they are broken.  All data is versioned making it possible to go back to any prior version of a model.  The simulation API supports getting run-time data about a model, including markings of places and enabling and transitions.  The analysis API allows setting up experiments and performing runs.  All such data is stored in a time-series database for subsequent analysis, and details about models and settings are stored for reproducibility.  The verification API allows storing properties and verification projects tying models together with properties for verification.  The web services API allows models to invoke third party web services and to set up web services backed by CPN models.

I’ve set up an API server at api.brinformatics.eu along with prototype stub implementations of the APIs:

Screenshot 2015-05-10 22.32.24

While in the prototype stage, the APIs are in a very fluid stage, and I encourage others to test them out and see if they provide the hooks necessary for envisioned projects.  APIs are versioned.  Version 0.0 means the API has just been set up for future specification.  During the version 0.1 phase the API is being specified.  During phase 0.2 a dumb stub is being set up on the API front-end allowing applications to be built.  Phase 0.3 begins setting up a more intelligent stub backed by a real data-structure on the API application server.  When version 0.9 is out, the interface is frozen, and version 1.0 is the first stable version.

For now, the syntax check API is fully specified.  Calls take a number of optional or required parameters as post parameters, and PUT and POST requests additionally allow a JSON post body.  This body can contain any additional parameters, which will be saved and returned on subsequent GET requests to the same resource.  This makes it possible for a GUI editor to store, e.g., layout and styling information of elements (such as position, line width, color, …) or for extension APIs to store auxiliary information (such as whether a place should be bounded/ordered or a web-service integration for a transition).

Simply select an API to test it – here the syntax checking API:

Screenshot 2015-05-10 22.57.22

 

We can select the API Console to experiment with the API without setting up any applications:

Screenshot 2015-05-10 22.57.39 Screenshot 2015-05-10 23.00.31

Note that while APIs in version 0.1 show calls and parameters, they do not return sensible values!  APIs in version 0.0 may or may not contain calls.

In the future, it is possible to add third-party APIs to the API store, providing a single point of entry for applications depending on CPNs in the cloud.

The site comes with a discussion forum for discussing the individual APIs or general topics:

Screenshot 2015-05-10 23.04.48

Since my previous post, I’ve updated the architecture diagram.  I’ve renamed the analysis and verification APIs (they used to be the analytics and analysis APIs), and I’ve switched the backing database from MySQL to MongoDB to make it easier to save auxiliary information as structured JSON.

cpnaas11

I also made an updated version of the CPN Tools logo, updating the aging design to a new flatter version.  Below top, the old logo, and below bottom, the updated version:

CPN Tools Icon

CPN Tools Logo Flat

Very iOS 7y.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.