Updated on 2023-12-28 GMT+08:00

OpenAPI

You can create a custom OpenAPI connector and import OpenAPI files in JSON or YAML format. Currently, OpenAPI 2.0 and 3.0 are supported.

The OpenAPI connector supports multiple authentication modes, connection types, and custom actions and action parameters.

Creating an OpenAPI Connector

  1. Log in to the new ROMA Connect console.
  2. In the navigation pane on the left, choose Connector. On the page displayed, click the Custom Connector tab.
  3. Click New Connector. The New OpenAPI Connector dialog box is displayed.
  4. Select a file to be imported.
    Table 1 Description for file importing

    Parameter

    Description

    Select an OpenAPI file.

    • Select the OpenAPI version. You can select 2.0 or 3.0.
    • Click Download Template to download the OpenAPI template file of the corresponding version.
    • Modify the template file based on service requirements and upload the file.

    Authentication Type

    Select the authentication type required when the connector is used to create a connection. The authentication type is extracted from the security mode in the OpenAPI specification.

    The template file for version 3.0 is used as an example. The following authentication types are available:

    • api_key: API key authentication. Authentication parameters can be modified in this case.
    • x-bfs-iam-token: IAM user token authentication.
    • x-bfs-iam-aksk: IAM user AK/SK authentication.
    • Basic: Basic authorization.
    • None: No authentication is required.

    Action

    Select the action to be configured. The action is extracted from the API in the OpenAPI specification. After a connector is generated, you can add a trigger.

  5. Configure basic information.
    Table 2 Parameter description

    Parameter

    Description

    Icon

    Icon for the custom connector.

    Click Upload Icon to upload an icon from the local host. If this parameter is not uploaded, a default icon is generated based on the initial letter of the connector name.

    Name

    Enter the connector name.

    Tag

    Enter a tag for the connector.

    Type

    Select a connector type.

    • HTTP
    • Database
    • Huawei Cloud service
    • SaaS application
    • Email
    • Other
    • Message system

    Description

    Enter the description of the connector to identify it.

  6. Click Create and Configure Details. The action configuration page is displayed.
  7. Click . In the pop-up box, configure action information and click OK.
    Table 3 Parameter description

    Parameter

    Description

    Name

    Enter the action name.

    Type

    Select an action type.

    • GET
    • POST
    • PUT
    • DELETE

    Path

    Enter a path, for example, /history.

    Description

    Enter the action description.

  8. After the action is added, configure action parameters.
    Table 4 Parameter description

    Parameter

    Description

    Input Parameter

    Options are Query, Header, and Path.

    • Name: Enter the parameter name.
    • Display Name: Enter the parameter display name.
    • Type: Select the parameter type. Options are string, integer, and number.
    • Mandatory: Whether a parameter is mandatory.
    • Description: Enter the parameter description.

    Click in the Operation column to add a parameter.

    Body

    Configure request body parameters. When the action type is POST, PUT, or DELETE, request body parameters are required.

    • Name: Enter the parameter name.
    • Display Name: Enter the parameter display name.
    • Type: Select the parameter type. Options are object, string, integer, and number.
    • Mandatory: Whether a parameter is mandatory.
    • Description: Enter the parameter description.

    Click in the Operation column to add a parameter.

    NOTE:

    By default, the name of the first parameter is a root node, and the parameter type is object. Both of them cannot be modified.

    Return Value

    Configure return value parameters. Click in the Return Value column and add different return values in the drop-down list.

    • Name: Enter the parameter name.
    • Display Name: Enter the parameter display name.
    • Type: Select the parameter type. Options are object, array, string, and integer.
    • Mandatory: Whether a parameter is mandatory.
    • Description: Enter the parameter description.

    Click in the Operation column to add a parameter.

    NOTE:

    By default, the name of the first parameter is a root node, and the parameter type is object. Both of them cannot be modified.

  9. Click Save.

Creating an OpenAPI Connection

  1. Log in to the new ROMA Connect console.
  2. In the navigation pane on the left, choose Connector. On the page displayed, click the Custom Connector tab.
  3. Click New Connection in an OpenAPI connector.
  4. In the pop-up box displayed, configure the information.
    Table 5 Parameter description (Basic authentication)

    Parameter

    Description

    Name

    Enter the connection name.

    URL

    Enter the connection address.

    Username

    Enter a username.

    Password

    Enter the password.

    Description

    Enter a description.

    In this example, the OpenAPI connector uses the basic authentication. OpenAPI connectors using other types of authentication require corresponding authentication parameters when creating a connection.

    If a custom connector uses no authentication, no connection is required.

  5. Click OK.