Tutorial: Staging and publishing a project from the API Designer

This tutorial shows you how to stage and publish a project using the API Designer in IBM® API Connect Version 5.0.7 and later. Staging a project copies all the files to the target, but does not run the project application code. Publishing a project copies all the project files to the target and runs the project application code. You publish a LoopBack® project to make its APIs available to application developers through the Developer Portal.

Before you begin

Note: For tutorials about working with the developer toolkit in IBM API Connect Version 5.0.6 and earlier, see Developer toolkit tutorials for V5.0.6 and earlier.

Before you begin, you must install the developer toolkit on your local machine. For details, see Installing the toolkit.

To stage or publish to API Connect collective, you must install and configure an API Connect collective. You must add a Collective and a Collective controller by using the Cloud Manager. See Installing an API Connect collective.

Note: IBM API Connect collectives are deprecated in IBM API Connect Version 5.0.7 in favor of container runtimes. However, for this tutorial you will continue to publish to an API Connect collective.
You must also fulfill the following additional prerequisites to stage or publish project:
  1. You must be the owner of a provider organization, or have been added to a provider organization as a user with the Publisher role. For details on creating a provider organization and specifying the owner, see Creating a provider organization account. For details on adding a user to a provider organization with the Publisher role, see Adding users and assigning roles.
  2. You must have followed the instructions in the provider organization email invitation to activate your API Connect account.

You must also do the following:

  1. Create a LoopBack project. For more information, see Tutorial: Creating a LoopBack project from the command line.
  2. Change directories to your LoopBack project and enter the following command:
    apic edit
    After a brief pause, the console displays this message:
    Express server listening on http://127.0.0.1:9000

    API Designer opens in your web browser, initially displaying the login page if you haven't logged in recently.

    Note: The login page prompts you to Sign in with IBM Cloud. Enter your IBM Cloud credentials, which authenticates you on IBM Cloud and provides access to the API Manager features such as Publish, Explore, and Analytics. You will continue to work in API Designer locally to create APIs, models and data sources.
    Note: If you need to run the editor on a different port, use the following command:
    [Icon indicating that this applies on Linux platforms][Icon indicating that this applies on Mac OS X platforms]
    PORT=port_number apic edit
    [Icon indicating that this applies on Windows platforms]
    set PORT=port_number && apic edit
    where port_number is the port number to use.
The following diagram shows the sequential flow through the IBM API Connect Developer toolkit tutorials for working with LoopBack projects. Before beginning a tutorial, ensure that you have completed the previous tutorials in the sequence. You can click a tutorial in the diagram to open the instructions for that tutorial.
Tutorial flow diagram for working with LoopBack projects Installing the toolkit Tutorial: Creating a LoopBack project from the command line Tutorial: Creating a model and a data source from the command line Tutorial: Creating a model and a data source in the API Designer Tutorial: Testing a LoopBack project Tutorial: Publishing a project from the command line Tutorial: Staging and publishing a project from the API Designer

About this tutorial

In this tutorial, you will stage and publish a LoopBack project to an API Connect collective from the API Designer.

Publishing a project to an API Connect collective

Note: If your app has binary modules (for example, if it uses the DB2®, SQLLite3, or Oracle connectors), then you must create the app on the same type of platform as that of the target API Connect collective.
  1. In the API Designer, click Publish Publish then click Add and Manage Targets.
  2. Click Add a different target. You'll see the Sign in to IBM API Connect dialog.
  3. Enter your API Connect host address, Username, and Password. Click Sign in. You'll see the Select an organization and catalog dialog.
  4. Select the desired organization, and select the Sandbox Catalog.
  5. Click Next. You'll see the Select an App dialog. Click the desired app, and then click Save.
  6. In the API Designer, click Publish Publish again.
  7. In the drop-down selection, under Other Orgs, click the target you just created. You'll see the Publish dialog:
    Publish options
  8. Select Publish application and Stage or Publish products, then select Select specific products. Select acme-bank, and then click Publish.
While the project is being published, the console displays messages like the following output:
Staged /Users/john/acme-bank/definitions/acme-bank-product.yaml to climbon:sb [acme-bank:1.0.0]
Published /Users/john/acme-bank/definitions/acme-bank-product.yaml to climbon:sb [acme-bank:1.0.0]
Successfully published products
...building package for deploy
Creating keys...this may take some time
...uploading packages to 169.53.159.240:9443, scale: 1
Upload successful: acme-bank-57057c0ee4b011906e320bda-1459977334690-package.tgz
Upload successful: acme-bank-57057c0ee4b011906e320bda-1459977334690.deploy.xml
Upload successful: apic.acme-bank-57057c0ee4b011906e320bda-1459977334690.scalingPolicy.xml

Upload to liberty server completed succesfully.
Applications may take a few minutes to update and start.

Once the project is published, the API Designer displays a Success message.

If you want to confirm that the application was published in your API Connect collective, you can connect to the Liberty Admin Center by clicking Manage this app from within your App in the API Manager.

What you did in this tutorial

In this tutorial, you published a project to an API Connect collective by using the API Designer.

What to do next

If you want to use an application with a DataPower® Gateway, configure your collective and gateway and then modify your assembly. For more information, see [V5.0.2 or later]Configuring your DataPower Gateway and API Connect collective controller to communicate and [V5.0.2 or later]Modifying the assembly to call an application endpoint hosted on a collective.