You can associate a function with an API and use the function as a prefilter or a post-filter for the API only after you publish the function. This way, the function can process the request parameters or responses of the API. This topic describes how to publish a function on the DataService Studio page.
Prerequisites
- A function is created and saved. For more information, see Manage functions.
- The function is tested and successfully executed. For more information, see Test an API.
Publish a function
Go to the DataService Studio page.
Log on to the DataWorks console. In the top navigation bar, select the desired region. In the left-side navigation pane, choose . On the page that appears, select the desired workspace from the drop-down list and click Go to DataService Studio.
- In the left-side navigation pane of the Service Development page, find the function that you want to publish and double-click the name of the function.
- On the configuration tab of the function, click Submit in the upper-right corner.
- In the right-side navigation pane of the configuration tab, click Version. On the Version tab, find the version that is in the Can Be Published state and click Publish in the Actions column.
- After the function is published, click Version in the right-side navigation pane of the configuration tab to view the publishing record. You can also click Version Details or Roll Back in the Actions column.