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
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 Service Development pane, click the business process to which the desired API belongs.
Find the API whose details you want to view, right-click the API, and then select View Details.
NoteThe 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.
In the Service Development pane, click the business process to which the desired API belongs.
Find the API that you want to clone, right-click the API, and then select Clone.
In the Clone API dialog box, configure the parameters.
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.
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.
Unpublish the API that you want to delete.
If the API that you want to delete is in the Unpublished state, skip this step.
On the Service Development page, click the Service Management tab in the top navigation bar. The Manage APIs page appears.
On the Published APIs tab, find the API that you want to delete and click Unpublish in the Actions column.
In the Unpublish API message, click OK.
Click the Service Development tab in the top navigation bar.
In the Service Development pane, click the business process to which the desired API belongs.
Find the API that you want to delete, right-click the API, and then select Delete.
In the Delete API message, click OK.
NoteDeleted 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.
Unpublish the API that you want to delete.
If the API that you want to delete is in the Unpublished state, skip this step.
On the Service Development page, click the Service Management tab in the top navigation bar. The Manage APIs page appears.
On the Published APIs tab, find the API that you want to delete and click Unpublish in the Actions column.
In the Unpublish API message, click OK.
Click the Service Development tab in the top navigation bar.
In the Service Development pane, click the business process to which the desired API belongs.
Find the API that you want to move to another folder, right-click the API, and then select Mobile.
In the Modify file path dialog box, configure the Destination Folder parameter.
Click OK.
ImportantAfter 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.
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 icon.
In the upper part of the Batch Operation tab, specify filter conditions, such as business process and owner, to filter APIs.
Select the desired APIs in the list.
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
Submit
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.
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.
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.
NoteAfter 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.
Go to the DataService Studio page. In the left-side navigation pane, click the icon.
In the Code Search API pane, click the 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.
View the query results.
Results that match your search conditions are displayed, including the following items:
NoteOnly 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.