RASON Web IDEOne of the simplest ways to call the RASON Rest API is through the Editor Page on RASON.com. It's easy to either enter your own model, or open one of our example RASON models, into the RASON Model editor, then use the command buttons to analyze, solve, check the status and/or obtain the results from an optimization, simulation, simulation optimization, data science or decision table model. Click the Editor Page to open the RASON web IDE. The blank Web IDE appears. Models entered into or dragged onto the Rason Model Editor in the Web IDE may be solved or analyzed using either a 'Quick Solve' REST API endpoint (Quick Run) or a standard REST API endpoint (Model Execution). Note: The endpoints displayed in the command button intellisense are the actual REST API endpoints that you would call if solving a RASON model from within your own application. (See the next section within this chapter for a complete description of each Rason REST API endpoint. A model name may be entered into the Name field (on the Properties pane). Once the model has been posted (saved) to the RASON server, the version ID will appear under Version. Click Choose Files to upload any data files utilized in the mode. Click Select Query Parameters when calling the POST rason.net/api/model/id/solvetype endpoint to control the content of the final results and if and where intermediate decision flow results are stored. (See the next chapter Creating and Running a Decision Flow for more information.) Note: When dragging a file into the Editor window, a copy of the model will be posted to the Rason server, even if the original file is saved on a user's OneDrive account. This new model will not overwrite or update the file saved on the OneDrive account. Click the down arrow on the first icon, Quick Run, to display the six "Quick Solve" REST API endpoints. 'Quick Solve' endpoints are synchronous and
should only be used with models that solve very quickly, i.e. within a few seconds. There is a time limit of 30 seconds on all 'Quick Solve' calls which
means that if your model takes longer than 30 seconds to solve, the RASON Server will return the result:
For all but the smallest / most quickly solved models, you'll need to use the asynchronous set of REST API calls as used in the Model Execution section of the Editor page. When solving any type of problem, you'll first need to make a call to the REST API endpoint POST rason.net/api/model, within the Model section of the ribbon, which will create a "resource ID". This "model ID" or "resource ID" is used to identify versions of Rason models (where a model's text is changed) and also model instances (where a model is run with new data). These IDs also contain an embedded timestamp which can be used to identify version history and may be used for "auditability" purposes when identifying the model instance used to generate a Rason result. In past versions of Rason, the model ID consisted of a series of digits (i.e. 2590+2015-05-15-20-33-31-034142); there was no way to "name" a model thereby creating an easy way to identify a model. RASON V2020 supports both named and unnamed models A model becomes "named" either by including modelName: "name" in the RASON model text and then calling POST rason.net/api/model or by simply calling POST rason.net/api/model/<name> or both. Either call returns a Location header with a new resource ID that identifies this unique model instance, for example: 2590+productMixExample+2020-01-17-22-10-22-683772. The "name" must be unique among models with a user's account. An unnamed model, or a model not containing modelName, has no name. For more information on naming a model, see Using the RASON REST API section below. Every model (named or unnamed) that is POSTed to the RASON Server will have an assigned resource ID, though for "quick solves" via POST rason.net/api/solvetype that resource ID will never be referenced by the RASON client. After the model has been posted, then the solve can be started via the new REST API endpoint POST rason.net/api/model/{nameorid}/solve, where {nameorid} is either the model's name or the ID of the desired version of the model. The call to this endpoint will return a Location header with a new resource ID that identifies this unique model instance (model bound to data). You can check on the model's progress at any time with the REST API endpoint GET rason.net/api/model/{nameorid}/status and obtain results when finished with the REST API endpoint GET rason.net/api/model/{nameorid}/result. A Note on RASON Organization AccountsAs discussed in the RASON Organization Account chapter that occurs later in this guide, and the previous section, with an Organization Account, your company’s models and data are maintained privately in the company’s own Azure Storage Account, isolated from all other RASON users. Using standard Azure Role-Based Access Control (RBAC), the company can assign “roles” to different users that give them selective access to storage containers where their models and data are saved. In the RASON Model Editor, your company’s authorized users will be able to “see” the containers they can access (read-only or read/write), and easily create, update or delete models within those containers in accordance with their roles. The table below summarizes how the functionality of the Editor page is modified according to various user permissions. Editor Tab
For more information on RASON Organization Accounts, see the RASON Organization Account chapter or contact Sales at sales@solver.com.
|