Skip to content

PeterEltgroth/ol-tap-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenLegacy Hub CICS demo on Tanzu Application Platform

Assumptions

A *nix compatible environment with a bash shell.

Prerequisites

  1. A Tanzu Application Platform 1.4.x installation
  2. Sign up for the free OpenLegacy 60 day trial
  3. Java 11 or higher
  4. Install Gradle
  5. Install OpenLegacy CLI
  6. Install Docker
  7. Clone down this repository

Create the OpenLegacy Hub Project

  1. Login to OpenLegacy Hub
  2. Generate an OpenLegacy API Key
  3. Login to ol cli: ol login
  4. From this directory
    1. Allow execute on ol-project.sh: chmod +x ol-project.sh
    2. Run ./ol-project.sh to create the demo OpenLegacy Module, Assets, and Project
  5. Go to the Project and click Generate Service Generate Service image
  6. Select SPRING-JAVA-REST SPRING-JAVA-REST image
  7. Download the Service Download Generated image
    • With an higher OpenLegacy License these manual steps could be done using ol generate
  8. Unzip: unzip <my-project>.zip -d <destination-directory>
  9. cd into the unzipped destination directory
  10. Optional: Run gradle bootRun and check localhost:8080/openapi/index.html OpenAPI GUI

Deploy into Tanzu Application Platform

Note: This deploys into the default Kubernetes namespace.

tanzu app wld apply demo-ol-cics \ # Or replace demo-ol-cics with your name
--local-path . \
--source-image <destimation image repository, e.g. my.azurecr.io/supply-chain/cics-demo> \
--type web \
--app ol-tap-demo \
--annotation autoscaling.knative.dev/minScale=1 \
--label apis.apps.tanzu.vmware.com/register-api="true" \
--param-yaml api_descriptor='{"type":"openapi","description":"Open Legacy generated CICS APIs.","owner":"demo-team","system":"ol-tap-demo","location":{"path":"/openapi/openapi.yaml"}}'

Add the Catalog

  1. See Add your application to the Tanzu Application Platform GUI software catalog
  2. For the Repository URL use: https://github.com/PeterEltgroth/ol-tap-demo/blob/main/catalog/catalog-info.yaml
  3. After registering return to the home page to confirm registration

Component list image

Results in TAP GUI

Supply Chain

Supply Chain image

API Explorer

API Explorer image

API Definition

API Definition image

Note: To enable TRY IT OUT the application must have CORS configured to allow requests from TAP GUI. If CORS is not configured try the REST APIs directly at:

https://demo-ol-cics.<namespace>.<your-domain>/openapi/index.html


To configure CORS create this class in src/main/java/com/openlegacy/WebConfig.java:

package com.openlegacy;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.config.CorsRegistry;
import org.springframework.web.reactive.config.EnableWebFlux;
import org.springframework.web.reactive.config.WebFluxConfigurer;

@Configuration
@EnableWebFlux
public class WebConfig implements WebFluxConfigurer {

    @Override
    public void addCorsMappings(CorsRegistry registry) {

        registry.addMapping("/*")
            .allowedOrigins("https://tap-gui.full.tap.isveng.com")
            .allowedMethods("POST", "OPTIONS")
            .allowedHeaders("*");
    }
}

Component

Component image

Application Live View

Application Live View docs

From the ol-tap-demo Component:

  1. Click the Runtime Resources tab
  2. Click the Running pod name, for example demo-ol-cics-00001-deployment-<hash>
  3. Scroll down to the Live View section

NOTE:

By default the exposed actuator endpoints and data are restricted. To demonstrate the full capabilties of Application Live View modify the management section of src/main/resources/application.yml to be:

management:
  endpoint:
    health:
      show-details: always
  endpoints:
    web:
      exposure:
        include: "*"

Details

App Live View Details image

Available Categories

App Live View Categories image

Health

App Live View Health image

Memory

App Live View Memory image

Log Levels

App Live View Log Levels image

Cleanup

  1. Allow execute on cleanup.sh: chmod +x cleanup.sh
  2. Run ./cleanup.sh
  3. Unregister the ol-tap-demo component Unregister image

References

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published