Version 1.2 of the Data Exchange library supports a new capability to expose procedures in your model through a REST API. You can simply expose procedures by adding a model annotation to specify the service name through which you want the procedure to be exposed. Within a procedure called this way, you have full access to the query parameters, HTTP headers and the body of the request through predefined parameters in the Data Exchange library. The latter can also be used to map the data in a request body to parameters in your model, or conversely, to create a response body from the output data of your model.
For now, you can directly use this feature on the desktop, for instance to allow AIMMS to be called from within a Python application, or a Jupyter notebook. As you can use this functionality directly from the AIMMS IDE, this will even allow you to interactively debug such requests using the AIMMS debugger. As this functionality will work with all types of AIMMS licenses (also the free Academic and Community licenses), this is now the preferred way to embed AIMMS in other applications running on your desktop.
This functionality will also form the basis for exposing AIMMS models through a REST API on the AMMS Cloud Platform. This will, however, require additional support in the AIMMS Cloud Platform for load-balancing and routing API calls to the appropriate solver session, which is planned for Q4 of this year. We do not plan to support this functionality for AIMMS PRO on-premise installations.
In addition, the Data Exchange library now also contains a completely asynchronous Curl-based HTTP client library, which supports any feature supported by libCurl that can be activated through an integer- or string-valued Curl option.
This makes the Data Exchange library your one-stop shop for producing or consuming REST APIs from within your AIMMS models.
Visit the documentation page for more information.