Importing an AsyncAPI from Event Endpoint Management

Import one or more AsyncAPI specifications from Event Endpoint Management.

Before you begin

In this scenario, Event Endpoint Management can be viewed as the authoring tool for your AsyncAPI, as well as the gateway service (and enforcement point provider). API Connect is the place where the API is surfaced, and where events are found and managed. After you import the AsyncAPI, you can use API Connect to package it and offer it to consumers.

Complete the following tasks to prepare your API Connect and the AsyncAPI definition file:

  1. Ask your cloud administrator to Register an event gateway service.
  2. Add the event gateway to the catalog where you will store the API.
  3. To import an individual AsyncAPI to API Connect, first export the YAML file from Event Endpoint Management. To export the YAML file from Event Endpoint Management complete the following steps:
    1. In the Event Endpoint Management UI, navigate to the Topics page, and select the topic you want to export.
    2. Click the Options tab, and then click Export iconExport.
    3. Select For IBM API Connect (contains credentials) as the export format, and then click Export.

    For more information, see Exporting an AsyncAPI document for use in API Connect in the Event Endpoint Management documentation.

About this task

To complete this task, you must be assigned a role that has the Api-Drafts:Edit permission. The Developer role has this permission by default; if you are assigned a custom role that it must have this permission. For more information, see Creating custom roles.

Note: API Designer does not support importing an Async API, you must import the API using API Manager.

Procedure

  1. In the navigation pane, click Develop icon in the API UI navigation pane Develop, then click Add > API.
    The Select API type screen is displayed.
  2. Select the AsyncAPI tab to indicate the type of API that you want to work with.
  3. You can import AsyncAPI definitions into API Connect either individually or in bulk.
  4. To import AsyncAPI in bulk, complete the following steps:
    1. In the Create section, select AsyncAPI from Event Endpoint Management, then click Next.
    2. Select the APIs you want to import.
    3. Click Next to import the selected files.
    4. Click Done on the summary page that opens.
  5. To import an individual AsyncAPI, complete the following steps:
    1. In the Import section, select Existing AsyncAPI, then click Next.
    2. On the Import from file page, choose one of the following methods for importing the file:
      • Drag and drop a file:

        Open another window and select a file. Drag the file to the Select a file box, and release the file.

      • Browse for a file:

        Click the Select a file box. In the File Upload window, locate the file and select it, and then click Open.

      • Specify the URL of a file

        In the Or specify a file URL field, type or paste a URL for the file. Provide a username and password if they are required for accessing the file.

    3. Click Next to import the selected file.

      The import wizard checks the validity of the YAML, and displays a message indicating successful validation: YAML has been successfully validated.

    4. Select the Gateway tab and then click Gateway and portal settings > Properties.
    5. Locate the bootstrapServerAddress property and verify that the Value field is not empty.

      If the field is empty, enter: ${bootstrapServerAddress} before proceeding.

    6. Click Next to create the API.

      The Summary confirms that the new API definition is created.

      The new API is created, published to the sandbox catalog, and made available online (activated) for use. If you want to publish the API to a different catalog, add the Event Gateway Service to the catalog and then publish the API directly to that catalog.

      The summary displays the API's endpoint, and the sandbox catalog's client ID and client secret, which you can use for testing the API.

Results

Using one of the two methods discussed in the topic, you imported the AsyncAPI into API Connect.