Module 1 - Publish API with OAS3 spec file from the Controller GUI

Note

In this section we will push OAS3 specification file into the controller GUI in order to create the API

Connect to Controller GUI via your laptop’s browser or the jumphost

login: admin@nginx-udf.internal

password: admin123!

Step 1 - Create an New Application

  1. Click on top left corner icon, and click on Apps

  2. Click Create

  3. Create a new Application

    1. name : app_api

    2. display name : API Application Arcadia

    3. Environment : Production Environment

  4. Click Summit

../../_images/apps.png

Step 2 - Create an API Definition

  1. Click on the left menu APIs

  2. Click Create API Definition

    1. Name : arcadia-api-def

    2. Display Name : Arcadia API Definition

    3. Version : v1

    4. Select OpenAPI specification

      1. and Copy and paste specification text if you are not connected in the jumphost from here : https://app.swaggerhub.com/apis/F5EMEASSA/Arcadia-OAS3/2.0.1-schema

      2. or Import file if your are connected in the jumphost, the file is located in the Desktop folder and its name is OAS3-Arcadia.yaml

      ../../_images/oas_paste.png
    5. Click Next

    6. You can see all the resources have been imported from the swagger file and please open one resource to check its content.

      ../../_images/resource_list.png ../../_images/resource_money_transfer.png
    7. Click Summit


Step 3 - Publish the API

Note

At this stage, the API definition is created. So the controller knows the differents URI but doesn’t know yet where to forward the traffic to.

  1. Click on the API definition raw, and on the right frame, click on + Add Published API

    ../../_images/add_published_api.png
  2. Configure the mandatory settings

    1. Name: prod-api

    2. Display Name: Production API

      ../../_images/published-api-1.png
  3. Click Next

  4. Configure the deployment

    1. Environment: Production Environment

    2. App: API Application Arcadia

    3. Gateways: Gateway API

      ../../_images/published-api-2.png
  5. It is time to configure the Routing. It is similar to the components in the WebApp configuration

  6. Create a new component, routing the traffic to the MainApp

    1. Click Add New in the Components section and configure it as below

      ../../_images/component_1.png ../../_images/component_2.png

      Note

      Click Done then click Next

      Note

      We only configure one workload as the API we will test is hosted in the main app K8S service (sell stocks and buy stocks)

    2. Click Next until the end and click Submit

  7. Now, drag and drop the 3 URI starting by /trading to the right Component MainApp

    ../../_images/routing.png
  8. Click Next and Submit

    ../../_images/api-definition.png

Step 4 - Test your API

RDP to the jumphost

login: user

password: user

  1. Open Postman

  2. Open up the collection Arcadia API

  3. Make 2 calls

    1. Last transactions

    2. POST Buy Stocks

  4. Both works and are routed to the MainApp pod in K8S thanks to the NIGNX+ API GW.

  5. You can check in the Web Application in Chrome if your Buy Stock call passed. It should appear in the last transaction GUI.

../../_images/webapp.png

Step 5 - Look at the analytics

  1. In the controler GUI

  2. Click on the left icon Apps

  3. Click on your API Application Arcadia

  4. You can see your analytics for this API

../../_images/analytics.png