Parameter variables
- Last Updated: February 14, 2022
- 2 minute read
- DataDirect Connectors
- JDBC
- Autonomous REST Connector 6.0
- Documentation
When creating or editing a REST model file, the parameter values you define in an endpoint might not apply to all users of the service. For example, using a parameter that filters results by your user ID or project might retrieve data relevant only to you. To facilitate sharing REST model files, the Composer allows you to designate parameter values in an endpoint as variables. Users with whom you share the file can then provide values for these variables that are replaced across their REST model file, allowing them to quickly customize the endpoints according to their use cases.
Replacing a parameter value with a variable
- Select the Configure Endpoints tab from the menu.
- From the list of endpoints, expose and select the table that uses the parameter value you want to replace.
- In the Endpoints field or
Parametrized Paths pane, double-click on the
parameter value in the path that you want to replace with a variable. The
Set as a new parameter window opens.
Figure 1. Set as new parameter window in the Autonomous REST Composer
- In the Name field, type the name of the variable that will replace your parameter value.
- If the parameter value must be specified to return results, select the Mandatory check box. The mandatory box requires that a value is set for the parameter for the driver to query the associated table.
- Click Save to apply your changes.
After you done configuring your REST model file, you can click Download to generate a copy of the REST Model file to share.
Setting parameter values for variables
- Select the Configure Endpoints tab from the menu.
- From the list of endpoints, expose and select the table that uses a parameter value you want to define.
- Open the Params pane to expose a list of parameters and value pairs that apply to the selected table. Note that a value must be specified for mandatory values.
- In the Value field, provide
- Click Set to apply your changes.
Follow this procedure for any table that uses parameter variables.