Layer7 Live API Creatorcomplements automation with provisions for extending:
Layer7 Live API Creatorapplies table-based logic to updates on the table and to updates to the resources that you define explicitly in API Creator over the table.
- External services, by way of REST, Simple Object Access Protocol (SOAP), etc.
Layer7 Live API Creatorrunning in a container, such as Docker. For more information about installing
Layer7 Live API Creator, see Installing and Upgrading.
For more information about logic, see Logic.
Code Insertion Points
Layer7 Live API Creatorfires rules in an order that reflects their dependencies. This order changes as you alter rules and, therefore, affect their dependencies. By contrast,
Layer7 Live API Creatorfires events at designated points in the request-processing cycle, as illustrated in the following image:
While you define most RESTful endpoints as resources (tables, views, and stored procedures) or functions, you can build services, perhaps unrelated to your database objects, by adding custom endpoints. For example, you can add a custom endpoint that returns JSON or HTML responses or that returns results directly to the client.
For more information about how to determine which endpoint type to define for your API, see Customize your API.
Layer7 Live API Creatorinvokes event handlers before resource and logic processing begin. You can intercept an incoming request or log the request in a request event. Before
Layer7 Live API Creatorsends the response back out to the client, you can reformat the response message in a response event.
For more information about event handlers, see Event Handlers.
Resource GET Events
Layer7 Live API Creatorinvokes resource GET events as it retrieves rows. For example, add attributes or filter the row. You can inject resource attributes, remove resource attributes, or make REST calls and append the results.
For more information about resource GET events, see Manage Resource Events.
Row Logic Events
Layer7 Live API Creatorinvokes event rules with the current/old rows and the current verb on POST, PUT, and DELETE operations. They can operate on the row, the results of which
Layer7 Live API Creatorsubjects to reactive logic.
For more information about how to create event rules, see Event Rule Types.
DemoAPI sample includes the
row.price * row.quantity.
Layer7 Live API Creatoranalyzes the logic for dependencies which are reflected in proper execution order.
For more information:
- About how to create a formula rule, Formula Rule Type.
Access JVM and Services
System Variables and System Classes
The extension capabilities draw upon system variables and system classes. Discover these services using code completion. System variables define system state, for example, for the request and logic operation, and useful methods. System classes provide helper classes.
For more information about these system variables and classes, see Code Completion.
Your code requires the following system variables that are set when
- Thereqobject. This variable provides access to the API request, such as the current user and the url parameters.For more information about this object, see The req Object.
- ThelogicContextobject. Logic context makes visible key aspects of logic execution.For more information about this object, see The logicContext Object.
Layer7 Live API Creatorinitializes the following variables:
- TheSysUtilityobject. You can invoke RESTful services from business logic or resource GET events using the services that this object provides, such as therestGet,restPut,restPost, andrestDeletemethods.For more information about this context variable, see The SysUtility Object.
- TheSysLogicobject. You also have access to logic services, such as theallocateFromTo()andInsertIntoFrom()methods.For more information about this context variable, see The SysLogic Object.
For more information:
For more information about logic libraries, see Logic Libraries.
Re-usable Rule Types
You can add rules to the core rules (such as formula, sum, and count, or validation rules). You can define the parameters that the rule types accept.
Layer7 Live API Creatoruses extended rules by using the parameters. You can detect logic patterns and you can implement re-usable solutions to these using the extended rules.
InsertIntoFrom()system method and allocation rules uses this underlying technology.
For more information about this method, see InsertIntoFrom System Method.
For more information about how to add rules, see Rule Types.
Integrate SOAP with
Layer7 Live API Creator
You can integrate Simple Object Access Protocol (SOAP) with
Layer7 Live API Creatorusing Java libraries that access SOAP services and return them as REST services in
Layer7 Live API Creator.
For more information about viewing an example on how to access SOAP endpoints and return them as REST responses using
Layer7 Live API Creator, see the LAC-SOAP2REST example on GitHub.