Generating Wizard APIs
This section describes how to generate an API in the wizard mode.
Generating data APIs in the wizard mode is simple and easy. An API can be generated without writing code. Wizard mode is designed for users who do not have high requirements on API functions or have no experience in code development.
Prerequisites
You have configured data sources on the Data Connection Management page of Management Center.
Managing an API Catalog
An API catalog is an API index that is orchestrated and recorded in a certain sequence. It is a tool for reflecting categories, guiding API usage, and searching for APIs, helping API developers effectively classify and manage API services.
- Log in to the DGC console, select a DGC instance, and click Access.
On the displayed page, click the Workspaces tab. In the workspace list, locate the required workspace.
- Click Data Lake Mall of the corresponding workspace.
Navigate to the Data Lake Mall console.
- On the displayed page, choose API Catalogs and click
. In the displayed dialog box, enter an API catalog name.
- In the Operation column of API catalog list, edit API catalogs.
Click Edit to the right of the API catalog that you want to edit.
Configuring Basic API Information
- Log in to the DGC console, select a DGC instance, and click Access.
On the displayed page, click the Workspaces tab. In the workspace list, locate the required workspace.
- Click Data Lake Mall of the corresponding workspace.
Navigate to the Data Lake Mall console.
- Choose APIs > Create. On the displayed page, enter the basic information.
Table 1 API basic info Parameter
Description
API
An API name consists of 3 to 64 characters and starts with a letter. Only letters, digits, and underscores (_) are allowed.
API Catalog
An API catalog is a set of APIs with a specific function or scenario. It is the minimum organization unit of APIs in DLM and the minimum management unit of the API gateway.
Click Select Catalog to create an API catalog or select an existing one created in Managing an API Catalog.
Request Path
The path for accessing an API.
Example: /v2/{project_id}/streams.
Parameter Protocol
A parameter protocol is used to transmit requests. HTTP and HTTPS are supported.
Request Mode
HTTP defines the following request modes that can be used to send a request to the server:
GET requests the server to return specified resources.
POST requests the server to add a resource or perform special operations.
Description
A brief description of the API to be created.
Tag
The tag set for an API. A maximum of 20 tags can be set for an API.
Reviewer
An owner who has permissions to review APIs.
Click Add new to enter the page. On the displayed page, choose > .
Security Authentication
Security authentication mode, which can be:
- App Authentication: API Gateway authenticates API requests.
- IAM Authentication: IAM authenticates API requests.
- None-authentication: No authentication is required.
Display Scope
After the API is published, all users in the selected scope can view the API in the service catalog.
- Current workspace APIs
- Current project APIs
- Current tenant APIs
Access Log
If this parameter is selected, you can view the generated API query results that will be kept for seven days on the Access Logs page.
Min. Retention Period
Minimum duration reserved before API unbinding. Before an API developer suspends, brings offline, or cancels the authorization of an API, the system notifies the authorized API callers and reserves at least X hours for them to unbind the API. During the retention period, the API can be used if it is not unbound. The value 0 indicates that there is no minimum retention period.
Input parameter
Input parameter is a set of parameters in the API request, including dynamic parameters in the resource path, query parameters in the request URI, and header parameters.
The following is an example that describes the dynamic parameters in the resource path (request path):
/v2/{project_id}/streams, where {project_id} is a dynamic parameter that needs to be configured.
- Click Add and enter project_id for Name.
- Set Parameter Location to PATH.
- Set Type to STRING.
- Set Example Value and Description as required.
- After the basic API information is complete, click Next to go to the Data Extract Logic page.
Configuring the Data Extraction Logic
- Select a data source, data connection, database, and data sheet to obtain the tables to be configured.
Currently, only DWS, DLI, HBASE, HIVE, MySQL and RDS data sources are supported. Configure data sources in DGC Management Center in advance. Data tables can be searched by their names.
- Configure parameter fields.
Click Add next to Parameter Setting. All fields in the table are displayed on the page for adding parameters. Select the request parameters, response parameters, and ranking parameters that you want to add to the corresponding lists.
Figure 1 Add Parameter dialog box
- Edit request parameters.
In the request parameter list, select a bound parameter and an operator.
- Edit response parameters.
In the response parameter list, enter the values for Parameter, Parameter Type, Example Value, and Description.
- Edit ranking parameters.
In the list of ranking parameters, set whether the ranking parameters are optional, set the ranking mode, and enter the description.
- Click Next and set the value of pre_order_by as the description of all ranking parameters and separate them with semicolons (;). See Figure 3.
Figure 2 is an example.
Table 2 Ranking parameters Parameter
Description
id
a:asc, where
a is the parameter name. asc indicates that parameters are listed in the ascending order.
name
- b:asc
- b
- b:desc, where
b is the parameter name. asc and desc indicate that parameters are listed in ascending and descending orders respectively. The ranking order can be customized or left blank.
age
c:desc, where
c is the parameter name. desc indicates that parameters are listed in the descending order.
Table 2 lists the ranking parameters. The following table describes how to configure pre_order_by.
Table 3 Configuring parameter pre_order_by Parameter
Backend Statement
Remarks
a:asc;b;c:desc
order by id ASC, name, age DESC
N/A
b;c:desc
order by name, age DESC
a is optional and can be left blank.
b:asc;c:desc
order by name ASC; age DESC
b can be customized. b can be listed in the ascending order.
b:desc;c:desc
order by name DESC; age DESC
b can be customized. b can be listed in the descending order.
- pre_order_by is optional. If pre_order_by is not set, use the mandatory fields as the ranking criterion.
- If pre_order_by is set, configure an API strictly following the ranking sequence specified in Figure 2. Example:
If pre_order_by is set to a:asc;b;c:desc, no error will be generated. If pre_order_by is set to b;a:asc;c:desc, errors will be reported.
Testing an API
After all parameters are set, click Debug. Enter the values for parameter Value and click Debug in the lower left corner. You can view the Request and Response details on the right part of the displayed page. If the test fails, follow the instructions as prompted and restart the test. During the configuration, pay attention to the settings of the normal response example.
After the test is complete, click OK.
Last Article: Buying Exclusive Instances
Next Article: Generating Script APIs


Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.