All Products
Search
Document Center

DataWorks:View, delete, move, and clone an API, perform batch operations on multiple APIs, and use the code search feature to search for APIs

Last Updated:Nov 15, 2024

This topic describes how to view, clone, delete, and move an API. This topic also describes how to perform batch operations on multiple APIs and use the code search feature to search for APIs.

View an API

  1. Log on to the DataWorks console. In the top navigation bar, select the desired region. In the left-side navigation pane, choose Data Development and Governance > DataService Studio. On the page that appears, select the desired workspace from the drop-down list and click Go to DataService Studio.

  2. In the Service Development pane, click the business process to which the desired API belongs.

  3. Find the API whose details you want to view, right-click the API, and then select View Details.

    Note

    The View Details option appears only in the shortcut menu of an API that has been published. If an API has not been published, double-click the API to go to the configuration tab of the API. Then, click Properties in the right-side navigation pane to view the basic information about the API.

Clone an API

You can clone an API to a specified folder in the directory tree.

  1. In the Service Development pane, click the business process to which the desired API belongs.

  2. Find the API that you want to clone, right-click the API, and then select Clone.

  3. In the Clone API dialog box, configure the parameters.

    API克隆

    Parameter

    Description

    API Name

    The name of the cloned API. The name must be 4 to 50 characters in length and can contain letters, digits, and underscores (_). It must start with a letter.

    API Path

    The path of the cloned API. Example: /user.

    The path can be up to 200 characters in length and can contain letters, digits, underscores (_), and hyphens (-). It must start with a forward slash (/).

    Destination Folder

    The folder in which the cloned API is stored.

  4. Click OK.

Delete an API

You can delete only APIs that have not been published. To delete APIs that have been published, you must unpublish them first.

  1. Unpublish the API that you want to delete.

    If the API that you want to delete is in the Unpublished state, skip this step.

    1. On the Service Development page, click the Service Management tab in the top navigation bar. The Manage APIs page appears.

      服务管理

    2. On the Published APIs tab, find the API that you want to delete and click Unpublish in the Actions column.

    3. In the Unpublish API message, click OK.

    4. Click the Service Development tab in the top navigation bar.

  2. In the Service Development pane, click the business process to which the desired API belongs.

  3. Find the API that you want to delete, right-click the API, and then select Delete.

  4. In the Delete API message, click OK.

    Note

    Deleted APIs cannot be recovered. Exercise caution when you delete an API.

Move an API to another folder

You can move only APIs that have not been published. To move APIs that have been published, you must unpublish them first.

  1. Unpublish the API that you want to delete.

    If the API that you want to delete is in the Unpublished state, skip this step.

    1. On the Service Development page, click the Service Management tab in the top navigation bar. The Manage APIs page appears.

      服务管理

    2. On the Published APIs tab, find the API that you want to delete and click Unpublish in the Actions column.

    3. In the Unpublish API message, click OK.

    4. Click the Service Development tab in the top navigation bar.

  2. In the Service Development pane, click the business process to which the desired API belongs.

  3. Find the API that you want to move to another folder, right-click the API, and then select Mobile.

  4. In the Modify file path dialog box, configure the Destination Folder parameter.

  5. Click OK.

    Important

    After you move an API, the group to which the API belongs may change. The endpoint for calling this API after the API is published may also change. Exercise caution when you move an API to another folder.

Perform batch operations on multiple APIs

DataWorks allows you to change resource groups for DataService Studio for multiple APIs at the same time. DataWorks also allows you to submit and publish multiple APIs at the same time. This way, the APIs can run on other resource groups for DataService Studio and can be published in an efficient manner.

  1. Go to the DataService Studio page. In the left-side navigation pane, click Service Development. In the Service Development pane of the page that appears, click the image.png icon.

    image.png

  2. In the upper part of the Batch Operation tab, specify filter conditions, such as business process and owner, to filter APIs.

  3. Select the desired APIs in the list.

  4. Click the buttons at the bottom of the Batch Operation tab to perform corresponding operations on the selected APIs at the same time.

    The following table describes the relationship between batch operations and API states.

    Batch operation

    Unpublished and not submitted

    Unpublished and submitted

    Published and not submitted

    Published and submitted

    Change Resource Group

    image.png

    image.png

    image.png

    image.png

    Submit

    image.png

    Repeated submission is not supported. If you want to resubmit an API that has been submitted, you must go to the configuration tab of the API and discard the previously submitted version on the Version tab in the right-side navigation pane.

    image.png

    Repeated submission is not supported. If you want to resubmit an API that has been submitted, you must go to the configuration tab of the API and discard the previously submitted version on the Version tab in the right-side navigation pane.

    Publish

    You can publish an API only after the API is submitted. If an API that you want to publish has not been submitted, submit the API first.

    image.png

    You can publish an API only after the API is submitted. If an API that you want to publish has not been submitted, submit the API first.

    image.png

    Note

    After you change the resource group for DataService Studio of a published API, you must test, submit, and publish the API again to make the modification take effect.

Use the code search feature to search for APIs

The code search feature allows you to search for APIs that are created in script mode based on code in the current workspace.

  1. Go to the DataService Studio page. In the left-side navigation pane, click the image.png icon.

  2. In the Code Search API pane, click the image.png drop-down arrow to the right of the search box to expand search conditions.

    You can enter keywords such as API name, API path, API description, table name, and field name in the search box to search for APIs. You can also filter query results by owner, business process, or modification time.

  3. View the query results.

    Results that match your search conditions are displayed, including the following items:

    Note

    Only published APIs are displayed.

    • API name: After you click the name of an API, the configuration tab of the API appears on the right.

    • Code: Keywords, corresponding row, and brief context of the matched code are displayed. You can copy the matched code.

    • Basic information: Information, such as the API ID, owner, business process, and last modification time, is displayed.