Updated on 2022-12-05 GMT+08:00

Importing and Exporting APIs

Overview

ROMA Connect allows you to import and export APIs using files.

  • Importing APIs: API files in YAML and JSON formats can be imported, and the file content must comply with the Swagger 2.0 specifications.
  • Exporting APIs: API files in YAML and JSON formats can be exported.

Prerequisites

  • You have supplemented the extended Swagger definition of APIs in the API file to be imported.
  • Ensure that the quotas of APIs and API groups meet the requirements before importing APIs.

Importing APIs

  1. Log in to the ROMA Connect console. On the Instances page, click View Console next to a specific instance.
  2. In the navigation pane, choose API Connect > API Management. On the APIs tab page, choose More > Import API.
  3. On the Import API page, configure API import information.
    Table 1 Parameters for importing APIs

    Parameter

    Description

    Import To

    Select the method for importing APIs.

    • New group: Import APIs to a new API group. If you select this option, the system automatically creates an API group and imports the APIs to this group.
    • Existing group: Select an existing API group and add the imported APIs to this group.

    Type

    This parameter is mandatory only if Import To is set to New group.

    Select the type of the API group.

    • Integration application: An API group belongs to a specific integration application. Only users who have permissions on the integration application can view and perform operations on the API group.
    • Global: All users can view and perform operations on the API group.

    Integration Application

    This parameter is mandatory only if Integration application is selected for Type.

    Select the integration application to which the API group belongs.

    Overwrite

    This parameter is available only if Import To is set to Existing group.

    This parameter specifies whether to overwrite the existing API when the imported API conflicts with the API in the API group.

    Overwrite Extended Definition

    This parameter specifies whether to overwrite the existing extended information when the extended information (such as custom authentication, request throttling policy, and access control policy) defined in the imported API conflicts with the existing extended information in ROMA Connect.

    • If you select this option, the system overwrites the existing information with the extended information defined in the imported file.
    • If you do not select this option, the existing extended information in the system is used, rather than the extended information in the imported file.

    Parameter Import

    Select and check the imported file.

    • Click File and select the local API file in YAML or JSON format.
    • After the file is imported, click Check to check whether the content format of the imported file meets the requirements.
    • Click Format to format the content of the imported file.
    • Click Download to download the imported file to the local host.
    • Enable Mock if you want to use the Mock service as a backend service for importing APIs.
  4. Click Fast Roll Out to import APIs.

    If you need to configure request information and backend service information of the imported APIs in a centralized manner before the import, click Configure Global Settings and configure API information as prompted. Click Submit to import the APIs.

    If the imported API has not been published in the environment, you need to manually publish the API.

Exporting APIs

  1. Log in to the ROMA Connect console. On the Instances page, click View Console next to a specific instance.
  2. In the navigation pane, choose API Connect > API Management. On the APIs tab page, choose More > Export API.
  3. On the Export API page, configure API export information.
    Table 2 Parameters for exporting APIs

    Parameter

    Description

    API Group

    Select the API group from which APIs are to be exported.

    Environment

    Select the environment in which the APIs to be exported have been published.

    API

    Select the APIs to be exported. If this parameter is not specified, all APIs in the API group in the selected environment will be exported by default.

    API Definition

    Select the scope of the API definition to be exported.

    • Basic: Only the API frontend request information is exported. The API frontend request information includes both standard and extended Swagger fields.
    • Full: Both API frontend request information and backend service information are exported.
    • Extended: The API frontend request information, backend service information, as well as the request throttling policy and access control policy associated with the API are all exported.

    Format

    Select the format of the exported API file. The value can be YAML or JSON.

    Version

    Enter the version of the API file to be exported. If no version is specified, the version will be set to the current time.

  4. Click Export to export the API file to the local host. The content of the exported file is displayed in the right pane.
    • If no independent domain name is bound to the API group to which the exported API belongs, the subdomain name of the API group will be exported.
    • If multiple independent domain names are bound to the API group to which the exported API belongs, only one independent domain name will be exported randomly.