Exposing a Data API

Overview

You can use a business flow to create a service integration task and encapsulate data sources into standard RESTful APIs for external use.

Prerequisites

You have the read and write permissions on the data sources in the task for the business flow.

Procedure

  1. Log in to the HUAWEI CLOUD official website and go to the ROMA Connect home page.
  2. Click Business Flow.
  3. Click Business Flow Design in the upper right corner of the page and select a creation method. In this example, use Blank Template.
  4. Click Create Flow above Blank Template.

    You can also use the Service Integration template. The default data source type is Gauss200.

  5. Add a source node.
    1. Click Add or drag an integration application to the orchestration area.
    2. Click the Integration Application node for configuration. For details, see Integration Application. After the configuration is complete, click OK.
    3. Select Open API in the API Management area on the left and drag Open API to the integration application.
    4. Click the Open API node for configuration. For details, see Open API. After the configuration is complete, click OK.
  6. Add a destination node.
    1. Select a data source in the Data Source area on the left and drag the data source to the integration application. In this example, Gauss200 is used.
    2. Click the Gauss200 node for configuration and select the corresponding data source.

      If no data source is available, click Add to add one. For details, see Data Source Management.

  7. Connect and configure the business flow.
    1. Connect the Open API node to the Gauss200 data source node.
      Figure 1 Open API connection example
    2. Click the line between Open API and Gauss200 nodes to configure line parameters. For details about the configuration information, see Table 1. After the configuration is complete, click OK.
      Table 1 Parameter description

      Parameter

      Description

      Insert SQL

      This parameter is disabled by default. If common SQL operations cannot meet requirements, you can customize SQL statements.

      SQL Operations

      Common operations include Select, Update, Insert, and Delete.

      Data Table

      Data table in the configured data source. You can select table fields to control the tables to be operated.

      Filter Criteria

      and and or are supported.

      Statement

      This parameter is mandatory only if Insert SQL is enabled. Native SQL statements are supported. You can use a simple expression to reference data on the preceding node. For details, see Data Reference.

    3. Click in the upper right corner of the page and check whether configurations are correct.
      • If incorrect, reconfigure the nodes.
      • If correct, go to 9.
  8. Click Save in the upper right corner of the page to save the business flow configuration.
  9. Start a business flow.

    Click Start in the upper right corner of the page. If the task is started successfully, a success message will be displayed.