A *nix compatible environment with a bash
shell.
- A Tanzu Application Platform 1.4.x installation
- Sign up for the free OpenLegacy 60 day trial
- If you need an extendtion beyond 60 days for now contact: peltgroth@vmware.com
- Java 11 or higher
- Install Gradle
- Install OpenLegacy CLI
- Install Docker
- Clone down this repository
- Login to OpenLegacy Hub
- Generate an OpenLegacy API Key
- Login to ol cli:
ol login
- From this directory
- Allow execute on ol-project.sh:
chmod +x ol-project.sh
- Run
./ol-project.sh
to create the demo OpenLegacy Module, Assets, and Project
- Allow execute on ol-project.sh:
- Go to the Project and click Generate Service
- Select SPRING-JAVA-REST
- Download the Service
- With an higher OpenLegacy License these manual steps could be done using
ol generate
- With an higher OpenLegacy License these manual steps could be done using
- Unzip:
unzip <my-project>.zip -d <destination-directory>
cd
into the unzipped destination directory- Optional: Run
gradle bootRun
and check localhost:8080/openapi/index.html
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"}}'
- See Add your application to the Tanzu Application Platform GUI software catalog
- For the Repository URL use:
https://github.com/PeterEltgroth/ol-tap-demo/blob/main/catalog/catalog-info.yaml
- After registering return to the home page to confirm registration
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("*");
}
}
From the ol-tap-demo Component:
- Click the Runtime Resources tab
- Click the Running pod name, for example
demo-ol-cics-00001-deployment-<hash>
- 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: "*"
- Allow execute on cleanup.sh:
chmod +x cleanup.sh
- Run
./cleanup.sh
- Unregister the ol-tap-demo component