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

  1. Go to the DataService Studio page.
    1. Log on to the DataWorks console.
    2. In the left-side navigation pane, click Workspaces.
    3. In the top navigation bar, select the region in which the workspace that you want to manage resides. Find the workspace and click DataService Studio in the Actions column.
  2. 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.
  3. On the configuration tab of the function, click Submit in the upper-right corner.
  4. 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.
    Pbulish
  5. 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.

What to do next

You can use the published function as a prefilter or a post-filter for an API. For more information, see Use post filters and Use prefilters.