From the left navigation pane, select Application Integration > Develop APIs.
Select a service gateway from the service gateway filter list.
Click Create.
You are placed on the API Orchestration Designer page. On the left of the page, you can orchestrate the APIs. On the right of the page, you can configure API attributes.
Perform the following tasks to develop APIs through drag-and-dropping:
To edit the global template, click the canvas.
To edit information for an icon, drag-and-drop that icon to the canvas, click that icon, and then edit the information in the window that opens.
To specify the sequence in which the attributes are executed, drag-and-drop to connect the icons.
Click Save.
To debug the application, click Debug. To verify the orchestration, click Verify.
To import an orchestration file, click Import. Importing a file will overwrite the current data preview. Only JSON files are supported.
Click Save to save the application.
To close the orchestration designer, click Close.
On the API development page, click Deploy in the Gateway to deploy the API in the service gateway.
Figure-1 API orchestration designer
Table-1 API orchestration designer
|
Section |
Description |
|
Toolbar |
Allows you to zoom in or zoom out the orchestration section, debug and save the application, download images, verify the orchestration, import an orchestration file, and close the orchestration designer. |
|
Icons |
Provides component icons for you to drag-and-drop to the orchestration area and define attributes for them. The following types of component icons are available:
|
|
Orchestration |
Allows you to orchestrate the API. |
|
Configuration |
Allows you to configure the API or component icons as needed.
|
Drag-and-drop the API component icon to the canvas, click the icon, and then edit the attributes for it in the configuration pane to the right of the page.
|
Attribute |
Description |
|
|
Basic Info |
Name |
Specify an API name, a string of 1 to 64 characters. The value can contain Chinese characters, letters, digits, dots (.), hyphens (-), and underlines (_). It can start with a letter or Chinese character. When you bind a policy to an API or subscribe to an API, you can select an API by its name. |
|
Description |
Specify an API description, a string of 0 to 128 characters. |
|
|
Configuration Information |
Backend Service |
Select a backend service. |
|
API Data |
Select API data. |
|
|
Path |
Path for the API. |
|
|
Request Method |
Request method for the API. This field is automatically populated based on the model of the device you selected. |
|
|
Input Parameters/Output Parameters |
Configure input and output parameters as needed. |
|
|
Attempts |
Set the maximum number of attempts to access the API. If the limit is reached, the API is unavailable. |
|
|
Timeout |
Set the timeout for access to the API. |
|
|
Timeout Unit |
Specify the timeout unit. |
|
Drag-and-drop the assignment component icon to the canvas, click the icon, and then edit the attributes for it in the configuration pane to the right of the page. You can assign values to variables used in the workflow. You can select global contexts as variables and values or manually specify variables and values.
|
Attribute |
Description |
|
|
Basic Info |
Name |
Specify a name for the assignment component icon, a string of 1 to 64 characters. The value can contain Chinese characters, letters, digits, dots (.), hyphens (-), and underlines (_). It can start with a letter or Chinese character. |
|
Description |
Specify a description for the assignment component icon, a string of 0 to 128 characters. |
|
|
Configuration Information |
Configure the assignment component icon by selecting a context or defining a custom context. For the configuration to take effect, click Add. |
|
Drag-and-drop the decision component icon to the canvas, click the icon, and then edit the attributes for it in the configuration pane to the right of the page. With a decision icon, you can define multiple branches based on constants or variables to support different services.
|
Attribute |
Description |
|
Name |
Specify a name for the decision component icon, a string of 1 to 64 characters. The value can contain Chinese characters, letters, digits, dots (.), hyphens (-), and underlines (_). It can start with a letter or Chinese character. |
|
Description |
Specify a description for the decision component icon, a string of 0 to 128 characters. |
|
Configuration Information |
1. Click Add Branch. In the dialog box that opens, click Add Criterion. 2. Enter the branch name, click Add Criterion, select Global Constants or Variables, and specify the criterion. 3. To add more criteria, click Add Criterion. 4. To clear all criteria, click Clear All. 5. Click OK.
You can add a maximum of 11 branches, and you can select the default and true branches |
Drag-and-drop the loop component icon to the canvas, click the icon, and then edit the attributes for it in the configuration pane to the right of the page. A loop icon is used to iterate over a set of objects. You can connect a loop to other icons such as assignment and decision.
|
Attribute |
Description |
|
Name |
Specify a name for the loop component icon, a string of 1 to 64 characters. The value can contain Chinese characters, letters, digits, dots (.), hyphens (-), and underlines (_). It can start with a letter or Chinese character. |
|
Description |
Specify a description for the loop component icon, a string of 0 to 128 characters. |
|
Configuration Information |
|
Drag-and-drop the break component icon to the canvas, click the icon, and then edit the attributes for it in the configuration pane to the right of the page. Use break icons to break out of loops. This type of icons must be used together with loop icons.
|
Attribute |
Description |
|
Name |
Specify a name for the break component icon, a string of 1 to 64 characters. The value can contain Chinese characters, letters, digits, dots (.), hyphens (-), and underlines (_). It can start with a letter or Chinese character. |
|
Description |
Specify a description for the break component icon, a string of 0 to 128 characters. |
|
Break |
Select the loop to exit. |
Drag-and-drop the pending component icon to the canvas, click the icon, and then edit the attributes for it in the configuration pane to the right of the page. With a pending component icon, you can define a wait timer.
|
Attribute |
Description |
|
Name |
Specify a name for the pending component icon, a string of 1 to 64 characters. The value can contain Chinese characters, letters, digits, dots (.), hyphens (-), and underlines (_). It can start with a letter or Chinese character. |
|
Description |
Specify a description for the pending component icon, a string of 0 to 128 characters. |
|
Configuration Information |
|
Drag-and-drop the scripts component icon to the canvas, click the icon, and then edit the attributes for it in the configuration pane to the right of the page. With a script component icon, you can define custom scripts to implement specific logics. Java scripts are supported. For how to write scripts, see the script usage guide.
|
Attribute |
Description |
|
Name |
Specify a name for the scripts component icon, a string of 1 to 64 characters. The value can contain Chinese characters, letters, digits, dots (.), hyphens (-), and underlines (_). It can start with a letter or Chinese character. |
|
Description |
Specify a description for the scripts component icon, a string of 0 to 128 characters. |
|
Configuration Information |
Use the sample script as a reference or see the script usage guide. |
|
Parameter |
Description |
|
|
Name |
Specify an API name. When you bind a policy to an API or subscribe to an API, you can select an API by its name. |
|
|
Description |
Specify an API description. |
|
|
API Info |
Start Icon |
Select a component icon as the start icon. |
|
Method |
Select a request method, GET or POST. |
|
|
Input Parameters |
|
|
|
Output Parameters |
Select output parameters. |
|
Click Add Variable.
In the dialog box that opens, configure the parameters as required, and then click OK.
Click Add Global Constant.
In the dialog box that opens, configure the parameters as required, and then click OK.
|
Parameter |
Description |
|
Name |
Specify a name for the variable. |
|
Data Type |
Select a data type. Options include Text, Digit, Integer, Boollean, Arrary, and Object. |
|
Value |
Specify the default value. |
|
Description |
Specify a description for the custom variable. |
To preview the configured variables, click the Data Preview tab.