Crash Course In Java Brain Surgery

insinuation and speculations: My thoughts about Java, HTML5, software development and IT in general

API design and APIOps

Written by  Viktor Gamov -

Building an API is just the first step. You also need to deploy that API and help your customers onboard to drive API consumption. Design APIs in Insomnia, generate configurations for Kong Gateway and publish REST, GraphQL, and gRPC services to the Kong Dev Portal to enable your audience. In this workshop, we will go through all steps of the API Management cycle - from designing API specifications to publishing APIs for public consumption.

APIOps

Outline

  • Design API in Insomnia

    • Design

    • Debug

    • Test

  • Deploy Services to API management (APIM) Platform - Kong

    • Generate config with inso from OpenAPI spec.

    • Learn how to use deck and GitHub actions for continuous delivery.

    • Use a mocking plugin for the default implementation.

    • Use rate limit plugin

  • Publish API to Developer Portal for public consumption.

Prerequisites

Test environment

insomnia
I recommend enabling Insomnia Beta channel - Preferences gear → General → Software Updates insomnia beta
test.sh
docker version

> inso --version
2.8.0

> deck version
decK v1.11.0 (4235c73)

Workshop

gitops demo
A code of the application and other things can be found

Designing, testing and debugging API

API Purpose

This is a sample application returns a list of Kong products and Devnexus sessions. A /products endpoint returns a list of Kong products. A /sessions endpoint returns a list of Devnexus sessions.

Open API spec in Insomnia

TBD

Generate Kong config with inso

filename
inso generate config src/main/resources/spec/devnexus-api-v1.0.yaml \
  --type declarative \
  --format yaml \
  --output kong.yaml
Kong and declarative config

I created a tutorial and video about using kong in docker with declarative config. <LINK TO DEMO SCENE> It can we tested as well using for instance with Testcontainers. <LINK TO DEMO SCENE and Kong Builders VIDEO>

Deploying API config to Kong

Lecture parts

Validation of decK + Konnect

  • Create file ~/.deck.yaml

    .deck.yaml
    konnect-email: your_email+konnectt@konghq.com
    konnect-password: your_p!ssw0rd
  • Test connection

    shell
    > deck konnect ping
    Successfully Konnected as Username!
    
    > deck convert --from kong-gateway --to konnect --input-file kong.yaml --output-file konnect.yaml
    
    > deck konnect sync

Adding plugins

Enabling Developer Portal

tags: