diff --git a/manifests/aks-petstoreservice-ingress.yml b/manifests/aks-petstoreservices-ingress.yml
similarity index 100%
rename from manifests/aks-petstoreservice-ingress.yml
rename to manifests/aks-petstoreservices-ingress.yml
diff --git a/manifests/azure-petstoreservice-ci-cd-to-aks-pipeline.yml b/manifests/azure-petstoreservice-ci-cd-to-aks-pipeline.yml
deleted file mode 100644
index f22d75ed..00000000
--- a/manifests/azure-petstoreservice-ci-cd-to-aks-pipeline.yml
+++ /dev/null
@@ -1,123 +0,0 @@
-# Deploy to Azure Kubernetes Service
-# Build and push image to Azure Container Registry; Deploy to Azure Kubernetes Service
-# https://docs.microsoft.com/azure/devops/pipelines/languages/docker
-
-trigger:
- branches:
- include:
- - main
- paths:
- include:
- - petstore/petstoreservice/*
-
-resources:
-- repo: self
-
-variables:
-
- # Container registry service connection established during pipeline creation
- dockerRegistryServiceConnection: '1ff734d3-5c1f-4a69-9c30-a23d515fd3e1'
- imageRepository: 'petstoreservice'
- containerRegistry: 'azurepetstorecr.azurecr.io'
- dockerfilePath: 'petstore/petstoreservice/Dockerfile'
- tag: '$(Build.BuildId)'
- imagePullSecret: '$(crImagePullSecret)'
-
-stages:
-- stage: Build
- displayName: Build stage
- jobs:
- - job: Analysis
- displayName: Security Analysis
- pool:
- vmImage: 'windows-latest'
- steps:
- - task: CredScan@2
- inputs:
- toolMajorVersion: 'V2'
-
- - job: Build
- displayName: Build App
- pool:
- vmImage: 'ubuntu-latest'
- steps:
- - script: echo -n -e "{\"version\":\"$(Build.BuildNumber) - $(tag)\"}" > petstore/petstoreservice/src/main/resources/version.json
-
- - task: Maven@3
- continueOnError: true
- displayName: Build Spring Boot Jar
- inputs:
- mavenPomFile: 'petstore/petstoreservice/pom.xml'
- mavenOptions: '-Xmx3072m'
- javaHomeOption: 'JDKVersion'
- jdkVersionOption: '8'
- jdkArchitectureOption: 'x64'
- publishJUnitResults: true
- testResultsFiles: 'petstore/petstoreservice/target/surefire-reports/TEST-*.xml'
- codeCoverageToolOption: 'jaCoCo'
- goals: 'package'
- - task: Docker@2
- displayName: Build and push an image to container registry
- inputs:
- command: buildAndPush
- repository: $(imageRepository)
- dockerfile: $(dockerfilePath)
- containerRegistry: $(dockerRegistryServiceConnection)
- tags: |
- $(tag)
- latest
-
- - upload: manifests
- artifact: manifests
-
-- stage: Deploy
- displayName: Deploy Stage
- dependsOn: Build
-
- jobs:
- - deployment: Deploy
- displayName: Deploy App
- pool:
- vmImage: 'ubuntu-latest'
- environment: 'Development'
- strategy:
- runOnce:
- deploy:
- steps:
- - task: KubernetesManifest@0
- displayName: Create secret
- inputs:
- action: createSecret
- kubernetesServiceConnection: azurepetstore-akscluster-default
- namespace: default
- secretType: dockerRegistry
- secretName: $(imagePullSecret)
- dockerRegistryEndpoint: $(dockerRegistryServiceConnection)
- - task: KubernetesManifest@0
- displayName: Deploy to Kubernetes cluster
- inputs:
- action: deploy
- kubernetesServiceConnection: azurepetstore-akscluster-default
- manifests: |
- $(Pipeline.Workspace)/manifests/petstoreservice-deployment-everything-enabled.yml
- $(Pipeline.Workspace)/manifests/petstoreservice-service-everything-enabled.yml
- imagePullSecrets: |
- $(imagePullSecret)
- containers: |
- $(containerRegistry)/$(imageRepository):$(tag)
-
-- stage: Automation
- displayName: Automation stage
- jobs:
- - job: Automation
- displayName: Automation Testing
- pool:
- vmImage: 'windows-latest'
- steps:
- - task: TriggerPipeline@1
- inputs:
- serviceConnection: 'Automation'
- project: '6b3206dd-90b3-40f6-a611-e5a1e5a13593'
- Pipeline: 'Build'
- buildDefinition: 'azure-petstoreautomation-regression-tests'
- Branch: 'main'
diff --git a/manifests/deployment.yml b/manifests/deployment.yml
deleted file mode 100644
index 59202c85..00000000
--- a/manifests/deployment.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-apiVersion : apps/v1
-kind: Deployment
-metadata:
- name: petstorepetservices
-spec:
- replicas: 1
- selector:
- matchLabels:
- app: petstorepetservices
- template:
- metadata:
- labels:
- app: petstorepetservices
- spec:
- containers:
- - name: petstorepetservices
- image: azurepetstorecr.azurecr.io/petstorepetservices
- ports:
- - containerPort: 80
\ No newline at end of file
diff --git a/manifests/petstoreservice-deployment-everything-enabled.yml b/manifests/petstoreservice-deployment-everything-enabled.yml
deleted file mode 100644
index c77af79e..00000000
--- a/manifests/petstoreservice-deployment-everything-enabled.yml
+++ /dev/null
@@ -1,51 +0,0 @@
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: petstoreservice
-spec:
- replicas: 3
- selector:
- matchLabels:
- app: petstoreservice
- template:
- metadata:
- labels:
- app: petstoreservice
- spec:
- nodeSelector:
- "beta.kubernetes.io/os": linux
- containers:
- - name: petstoreservice
- image: azurepetstorecr.azurecr.io/petstoreservice
- resources:
- requests:
- cpu: 250m
- memory: 1Gi
- limits:
- cpu: 500m
- memory: 2Gi
- ports:
- - containerPort: 8080
- env:
- - name: PETSTORESERVICE_SERVER_PORT
- value: "8080"
- - name: spring.config.name
- value: application_with_everything_enabled
- - name: PETSTORESERVICE_AI_INSTRUMENTATION_KEY
- valueFrom:
- secretKeyRef:
- name: aisecretkey
- key: secret
----
-apiVersion: autoscaling/v1
-kind: HorizontalPodAutoscaler
-metadata:
- name: petstoreservice-hpa
-spec:
- maxReplicas: 12 # define max replica count
- minReplicas: 3 # define min replica count
- scaleTargetRef:
- apiVersion: apps/v1
- kind: Deployment
- name: petstoreservice
- targetCPUUtilizationPercentage: 80 # target CPU utilization
diff --git a/manifests/petstoreservice-deployment.yml b/manifests/petstoreservice-deployment.yml
deleted file mode 100644
index 9bfa442a..00000000
--- a/manifests/petstoreservice-deployment.yml
+++ /dev/null
@@ -1,31 +0,0 @@
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: petstoreservice
-spec:
- replicas: 1
- selector:
- matchLabels:
- app: petstoreservice
- template:
- metadata:
- labels:
- app: petstoreservice
- spec:
- nodeSelector:
- "beta.kubernetes.io/os": linux
- containers:
- - name: petstoreservice
- image: azurepetstorecr.azurecr.io/petstoreservice
- resources:
- requests:
- cpu: 100m
- memory: 128Mi
- limits:
- cpu: 250m
- memory: 256Mi
- ports:
- - containerPort: 8080
- env:
- - name: PETSTORESERVICE_SERVER_PORT
- value: "8080"
\ No newline at end of file
diff --git a/manifests/petstoreservice-service-everything-enabled.yml b/manifests/petstoreservice-service-everything-enabled.yml
deleted file mode 100644
index 61cf7455..00000000
--- a/manifests/petstoreservice-service-everything-enabled.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-apiVersion: v1
-kind: Service
-metadata:
- name: petstoreservice
-spec:
- type: LoadBalancer
- ports:
- - port: 80
- targetPort: 8080
- selector:
- app: petstoreservice
\ No newline at end of file
diff --git a/manifests/petstoreservice-service.yml b/manifests/petstoreservice-service.yml
deleted file mode 100644
index 61cf7455..00000000
--- a/manifests/petstoreservice-service.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-apiVersion: v1
-kind: Service
-metadata:
- name: petstoreservice
-spec:
- type: LoadBalancer
- ports:
- - port: 80
- targetPort: 8080
- selector:
- app: petstoreservice
\ No newline at end of file
diff --git a/manifests/service.yml b/manifests/service.yml
deleted file mode 100644
index 05bd0188..00000000
--- a/manifests/service.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-apiVersion: v1
-kind: Service
-metadata:
- name: petstorepetservices
-spec:
- type: LoadBalancer
- ports:
- - port: 80
- selector:
- app: petstorepetservices
\ No newline at end of file
diff --git a/petstore/petstoreapp/src/main/java/com/chtrembl/petstoreapp/controller/WebAppController.java b/petstore/petstoreapp/src/main/java/com/chtrembl/petstoreapp/controller/WebAppController.java
index fc968a92..617ae999 100644
--- a/petstore/petstoreapp/src/main/java/com/chtrembl/petstoreapp/controller/WebAppController.java
+++ b/petstore/petstoreapp/src/main/java/com/chtrembl/petstoreapp/controller/WebAppController.java
@@ -226,7 +226,7 @@ public String exception(Model model, OAuth2AuthenticationToken token, HttpServle
this.sessionUser.getTelemetryClient().trackException(npe);
- return "home";
+ return "exception";
}
@GetMapping(value = "/*")
diff --git a/petstore/petstoreapp/src/main/resources/templates/exception.html b/petstore/petstoreapp/src/main/resources/templates/exception.html
new file mode 100644
index 00000000..77ab4ec7
--- /dev/null
+++ b/petstore/petstoreapp/src/main/resources/templates/exception.html
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/petstore/petstoreservice/.factorypath b/petstore/petstoreservice/.factorypath
deleted file mode 100644
index 2a79cf0d..00000000
--- a/petstore/petstoreservice/.factorypath
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/petstore/petstoreservice/.gitignore b/petstore/petstoreservice/.gitignore
deleted file mode 100644
index 5e03c66b..00000000
--- a/petstore/petstoreservice/.gitignore
+++ /dev/null
@@ -1,27 +0,0 @@
-*.class
-
-# Package Files #
-*.jar
-*.war
-*.ear
-
-target/
-bin/
-
-**/.openapi-generator/
-.openapi-generator-ignore
-
-#Eclipse files
-**/.project
-**/.classpath
-**/.settings/
-blog/bin/
-**/.tern-project
-
-#IntelliJ files
-**/*.iml
-**/.idea
-**/.gradle
-
-#Visual Studio Code files
-**/.vscode/
\ No newline at end of file
diff --git a/petstore/petstoreservice/Dockerfile b/petstore/petstoreservice/Dockerfile
deleted file mode 100644
index cb95b0d9..00000000
--- a/petstore/petstoreservice/Dockerfile
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# Build stage
-#
-FROM maven:3.6.0-jdk-8-slim AS build
-WORKDIR /build
-COPY pom.xml .
-COPY src ./src
-RUN mvn clean package
-
-#
-# Package stage
-#
-FROM openjdk:8-jre-alpine
-COPY --from=build /build/target/*.jar /app/petstoreservice.jar
-EXPOSE 8080
-ENTRYPOINT ["java","-jar","/app/petstoreservice.jar"]
diff --git a/petstore/petstoreservice/README.md b/petstore/petstoreservice/README.md
deleted file mode 100644
index dd1ed39e..00000000
--- a/petstore/petstoreservice/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-PetStoreService is the Back End Java Spring Boot Web Service used in the Azure Pet Store Reference Guide.
-
-You are also welcome and encouraged to build/deploy it outside of the Azure Pet Store Reference Guide, perhaps on your local developement machine just using Docker in Linux containers mode.
-
-Build the Spring Boot Jar and Docker Image
-
-```docker build -t petstoreservice .```
-
-Run the Docker Image. Note this example instructs Spring Boot to run on any port of your choice, in this case, 8081 and hence forwards the port to the container accordingly. You are welcome to change this as needed. 8081 or whochever port chosen is ultimatley what the petstoreapp will point to, if/when you choose to run petstoreapp locally as well.
-
-```docker run --rm --name petstoreservice -p 8081:8081 -e PETSTORESERVICE_SERVER_PORT=8081 -d petstoreservice:latest```
-
-Other optional aruments that you can specify to do certain things that get covered in the Azure Pet Store Reference Guide(s) like:
-
-- enable Application Inisghts (empty and disabled by default, you'll want to uncomment the property in azure-cloud\petstore\petstoreservice\src\main\resources\application.yml
-
-```-e PETSTORESERVICE_AI_INSTRUMENTATION_KEY=```
diff --git a/petstore/petstoreservice/deployment.yml b/petstore/petstoreservice/deployment.yml
deleted file mode 100644
index 1f38382c..00000000
--- a/petstore/petstoreservice/deployment.yml
+++ /dev/null
@@ -1,40 +0,0 @@
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: petstoreservice
-spec:
- replicas: 1
- selector:
- matchLabels:
- app: petstoreservice
- template:
- metadata:
- labels:
- app: petstoreservice
- spec:
- nodeSelector:
- "beta.kubernetes.io/os": linux
- containers:
- - name: petstoreservice
- image: azurepetstorecr.azurecr.io/petstoreservice:latest
- resources:
- requests:
- cpu: 100m
- memory: 128Mi
- limits:
- cpu: 250m
- memory: 256Mi
- ports:
- - containerPort: 8080
----
-apiVersion: v1
-kind: Service
-metadata:
- name: petstoreservice
-spec:
- type: LoadBalancer
- ports:
- - port: 80
- targetPort: 8080
- selector:
- app: petstoreservice
diff --git a/petstore/petstoreservice/pom.xml b/petstore/petstoreservice/pom.xml
deleted file mode 100644
index 18e2faf5..00000000
--- a/petstore/petstoreservice/pom.xml
+++ /dev/null
@@ -1,157 +0,0 @@
-
- 4.0.0
- org.openapitools
- openapi-spring
- jar
- openapi-spring
- 1.0.5
-
- 1.8
- ${java.version}
- ${java.version}
- 2.8.0
-
-
- org.springframework.boot
- spring-boot-starter-parent
- 2.0.1.RELEASE
-
-
- src/main/java
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
-
- repackage
-
-
-
-
-
- org.jacoco
- jacoco-maven-plugin
- 0.8.6
-
-
-
- prepare-agent
-
-
-
- report
- prepare-package
-
- report
-
-
-
- jacoco-check
-
- check
-
-
-
-
- PACKAGE
-
-
- LINE
- COVEREDRATIO
- 0.00
-
-
-
-
-
-
-
-
-
-
-
-
- com.microsoft.azure
- applicationinsights-spring-boot-starter
- 2.6.1
-
-
-
- com.microsoft.azure
- applicationinsights-logging-logback
- 2.6.1
-
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
- org.apache.logging.log4j
- log4j-api
-
-
-
-
-
- org.apache.logging.log4j
- log4j-api
- 2.16.0
-
-
-
-
- io.springfox
- springfox-swagger2
- ${springfox-version}
-
-
- io.springfox
- springfox-swagger-ui
- ${springfox-version}
-
-
- javax.xml.bind
- jaxb-api
- 2.2.11
-
-
- com.fasterxml.jackson.datatype
- jackson-datatype-jsr310
-
-
- org.openapitools
- jackson-databind-nullable
- 0.1.0
-
-
-
- javax.validation
- validation-api
-
-
- org.springframework.boot
- spring-boot-configuration-processor
- true
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
- org.junit.vintage
- junit-vintage-engine
-
-
-
-
- junit
- junit
- 4.13.2
- test
-
-
-
diff --git a/petstore/petstoreservice/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/petstore/petstoreservice/src/main/java/org/openapitools/OpenAPI2SpringBoot.java
deleted file mode 100644
index a551c240..00000000
--- a/petstore/petstoreservice/src/main/java/org/openapitools/OpenAPI2SpringBoot.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.openapitools;
-
-import org.openapitools.jackson.nullable.JsonNullableModule;
-import org.springframework.boot.CommandLineRunner;
-import org.springframework.boot.ExitCodeGenerator;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-
-import com.fasterxml.jackson.databind.Module;
-
-@SpringBootApplication
-@ComponentScan(basePackages = { "org.openapitools", "org.openapitools.api", "org.openapitools.configuration" })
-public class OpenAPI2SpringBoot implements CommandLineRunner {
-
- @Override
- public void run(String... arg0) throws Exception {
- if (arg0.length > 0 && arg0[0].equals("exitcode")) {
- throw new ExitException();
- }
- }
-
- public static void main(String[] args) throws Exception {
- new SpringApplication(OpenAPI2SpringBoot.class).run(args);
- }
-
- static class ExitException extends RuntimeException implements ExitCodeGenerator {
- private static final long serialVersionUID = 1L;
-
- @Override
- public int getExitCode() {
- return 10;
- }
-
- }
-
- @Bean
- public WebMvcConfigurer webConfigurer() {
- return new WebMvcConfigurer() {
- /*
- * @Override public void addCorsMappings(CorsRegistry registry) {
- * registry.addMapping("/**") .allowedOrigins("*") .allowedMethods("*")
- * .allowedHeaders("Content-Type"); }
- */
- };
- }
-
- @Bean
- public Module jsonNullableModule() {
- return new JsonNullableModule();
- }
-
-}
diff --git a/petstore/petstoreservice/src/main/java/org/openapitools/RFC3339DateFormat.java b/petstore/petstoreservice/src/main/java/org/openapitools/RFC3339DateFormat.java
deleted file mode 100644
index 026bb316..00000000
--- a/petstore/petstoreservice/src/main/java/org/openapitools/RFC3339DateFormat.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.openapitools;
-
-import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
-import com.fasterxml.jackson.databind.util.ISO8601Utils;
-
-import java.text.FieldPosition;
-import java.util.Date;
-
-
-public class RFC3339DateFormat extends ISO8601DateFormat {
-
- private static final long serialVersionUID = 1L;
-
- // Same as ISO8601DateFormat but serializing milliseconds.
- @Override
- public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
- String value = ISO8601Utils.format(date, true);
- toAppendTo.append(value);
- return toAppendTo;
- }
-
-}
\ No newline at end of file
diff --git a/petstore/petstoreservice/src/main/java/org/openapitools/api/ApiUtil.java b/petstore/petstoreservice/src/main/java/org/openapitools/api/ApiUtil.java
deleted file mode 100644
index 1245b1dd..00000000
--- a/petstore/petstoreservice/src/main/java/org/openapitools/api/ApiUtil.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.openapitools.api;
-
-import org.springframework.web.context.request.NativeWebRequest;
-
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-
-public class ApiUtil {
- public static void setExampleResponse(NativeWebRequest req, String contentType, String example) {
- try {
- HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class);
- res.setCharacterEncoding("UTF-8");
- res.addHeader("Content-Type", contentType);
- res.getWriter().print(example);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-}
diff --git a/petstore/petstoreservice/src/main/java/org/openapitools/api/PetApi.java b/petstore/petstoreservice/src/main/java/org/openapitools/api/PetApi.java
deleted file mode 100644
index 951631d7..00000000
--- a/petstore/petstoreservice/src/main/java/org/openapitools/api/PetApi.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/**
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.1).
- * https://openapi-generator.tech
- * Do not edit the class manually.
- */
-package org.openapitools.api;
-
-import java.util.List;
-import java.util.Optional;
-
-import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
-
-import org.openapitools.model.DataPreload;
-import org.openapitools.model.ModelApiResponse;
-import org.openapitools.model.Pet;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestHeader;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RequestPart;
-import org.springframework.web.context.request.NativeWebRequest;
-import org.springframework.web.multipart.MultipartFile;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import io.swagger.annotations.Authorization;
-import io.swagger.annotations.AuthorizationScope;
-
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-04-12T22:51:57.491293-04:00[America/New_York]")
-
-@Validated
-@Api(value = "pet", description = "the pet API")
-public interface PetApi {
-
- default Optional getRequest() {
- return Optional.empty();
- }
-
- public DataPreload getBeanToBeAutowired();
-
- default List getPreloadedPets() {
- return getBeanToBeAutowired().getPets();
- }
-
- /**
- * POST /pet : Add a new pet to the store
- *
- * @param body Pet object that needs to be added to the store (required)
- * @return Invalid input (status code 405)
- */
- @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags = { "pet", })
- @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") })
- @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.POST)
- default ResponseEntity addPet(
- @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) {
- return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
-
- }
-
- /**
- * DELETE /pet/{petId} : Deletes a pet
- *
- * @param petId Pet id to delete (required)
- * @param apiKey (optional)
- * @return Invalid ID supplied (status code 400) or Pet not found (status code
- * 404)
- */
- @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags = { "pet", })
- @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Pet not found") })
- @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE)
- default ResponseEntity deletePet(
- @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,
- @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey) {
- return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
-
- }
-
- /**
- * GET /pet/findByStatus : Finds Pets by status Multiple status values can be
- * provided with comma separated strings
- *
- * @param status Status values that need to be considered for filter (required)
- * @return successful operation (status code 200) or Invalid status value
- * (status code 400)
- */
- @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags = { "pet", })
- @ApiResponses(value = {
- @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
- @ApiResponse(code = 400, message = "Invalid status value") })
- @RequestMapping(value = "/pet/findByStatus", produces = { "application/json",
- "application/xml" }, method = RequestMethod.GET)
- default ResponseEntity> findPetsByStatus(
- @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status) {
- getRequest().ifPresent(request -> {
- try {
- PetApiController.logger.info(String
- .format("PetStoreService incoming GET request to /v2/pet/findPetsByStatus?status=%s", status));
- String petsJSON = new ObjectMapper().writeValueAsString(this.getPreloadedPets());
- ApiUtil.setExampleResponse(request, "application/json", petsJSON);
- } catch (JsonProcessingException e) {
- e.printStackTrace();
- String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }";
- ApiUtil.setExampleResponse(request, "application/json", exampleString);
- }
- });
-
- return new ResponseEntity<>(HttpStatus.OK);
-
- }
-
- /**
- * GET /pet/findByTags : Finds Pets by tags Multiple tags can be provided with
- * comma separated strings. Use tag1, tag2, tag3 for testing.
- *
- * @param tags Tags to filter by (required)
- * @return successful operation (status code 200) or Invalid tag value (status
- * code 400)
- * @deprecated
- */
- @Deprecated
- @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags = { "pet", })
- @ApiResponses(value = {
- @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
- @ApiResponse(code = 400, message = "Invalid tag value") })
- @RequestMapping(value = "/pet/findByTags", produces = { "application/json",
- "application/xml" }, method = RequestMethod.GET)
- default ResponseEntity> findPetsByTags(
- @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) {
- getRequest().ifPresent(request -> {
- for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) {
- if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
- String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }";
- ApiUtil.setExampleResponse(request, "application/json", exampleString);
- break;
- }
- if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
- String exampleString = " 123456789 doggie aeiou aeiou ";
- ApiUtil.setExampleResponse(request, "application/xml", exampleString);
- break;
- }
- }
- });
- return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
-
- }
-
- /**
- * GET /pet/{petId} : Find pet by ID Returns a single pet
- *
- * @param petId ID of pet to return (required)
- * @return successful operation (status code 200) or Invalid ID supplied (status
- * code 400) or Pet not found (status code 404)
- */
- @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = {
- @Authorization(value = "api_key") }, tags = { "pet", })
- @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class),
- @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Pet not found") })
- @RequestMapping(value = "/pet/{petId}", produces = { "application/json",
- "application/xml" }, method = RequestMethod.GET)
- default ResponseEntity getPetById(
- @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId) {
- getRequest().ifPresent(request -> {
- for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) {
- if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
- String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }";
- ApiUtil.setExampleResponse(request, "application/json", exampleString);
- break;
- }
- if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
- String exampleString = " 123456789 doggie aeiou aeiou ";
- ApiUtil.setExampleResponse(request, "application/xml", exampleString);
- break;
- }
- }
- });
- return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
-
- }
-
- /**
- * PUT /pet : Update an existing pet
- *
- * @param body Pet object that needs to be added to the store (required)
- * @return Invalid ID supplied (status code 400) or Pet not found (status code
- * 404) or Validation exception (status code 405)
- */
- @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags = { "pet", })
- @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Pet not found"),
- @ApiResponse(code = 405, message = "Validation exception") })
- @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.PUT)
- default ResponseEntity updatePet(
- @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) {
- return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
-
- }
-
- /**
- * POST /pet/{petId} : Updates a pet in the store with form data
- *
- * @param petId ID of pet that needs to be updated (required)
- * @param name Updated name of the pet (optional)
- * @param status Updated status of the pet (optional)
- * @return Invalid input (status code 405)
- */
- @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags = { "pet", })
- @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") })
- @RequestMapping(value = "/pet/{petId}", consumes = {
- "application/x-www-form-urlencoded" }, method = RequestMethod.POST)
- default ResponseEntity updatePetWithForm(
- @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,
- @ApiParam(value = "Updated name of the pet") @RequestPart(value = "name", required = false) String name,
- @ApiParam(value = "Updated status of the pet") @RequestPart(value = "status", required = false) String status) {
- return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
-
- }
-
- /**
- * POST /pet/{petId}/uploadImage : uploads an image
- *
- * @param petId ID of pet to update (required)
- * @param additionalMetadata Additional data to pass to server (optional)
- * @param file file to upload (optional)
- * @return successful operation (status code 200)
- */
- @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags = { "pet", })
- @ApiResponses(value = {
- @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
- @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = {
- "multipart/form-data" }, method = RequestMethod.POST)
- default ResponseEntity uploadFile(
- @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,
- @ApiParam(value = "Additional data to pass to server") @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,
- @ApiParam(value = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file) {
- getRequest().ifPresent(request -> {
- for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) {
- if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
- String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }";
- ApiUtil.setExampleResponse(request, "application/json", exampleString);
- break;
- }
- }
- });
- return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
-
- }
-
-}
diff --git a/petstore/petstoreservice/src/main/java/org/openapitools/api/PetApiController.java b/petstore/petstoreservice/src/main/java/org/openapitools/api/PetApiController.java
deleted file mode 100644
index 5a4f473f..00000000
--- a/petstore/petstoreservice/src/main/java/org/openapitools/api/PetApiController.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package org.openapitools.api;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.Optional;
-
-import org.openapitools.model.ContainerEnvironment;
-import org.openapitools.model.DataPreload;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.slf4j.MDC;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.context.request.NativeWebRequest;
-
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-04-12T22:51:57.491293-04:00[America/New_York]")
-
-@Controller
-@RequestMapping("${openapi.swaggerPetstore.base-path:/v2}")
-public class PetApiController implements PetApi {
- public static Logger logger = LoggerFactory.getLogger(PetApiController.class);
-
- private final NativeWebRequest request;
-
- @Autowired
- private ContainerEnvironment containerEnvironment;
-
- @Autowired
- private DataPreload dataPreload;
-
- @Override
- public DataPreload getBeanToBeAutowired() {
- return dataPreload;
- }
-
- @org.springframework.beans.factory.annotation.Autowired
- public PetApiController(NativeWebRequest request) {
- this.request = request;
- }
-
- @Override
- public Optional getRequest() {
- try {
- this.containerEnvironment.setContainerHostName(
- InetAddress.getLocalHost().getHostAddress() + "/" + InetAddress.getLocalHost().getHostName());
- } catch (UnknownHostException e) {
- e.printStackTrace();
- }
- MDC.put("containerHostName", this.containerEnvironment.getContainerHostName());
- MDC.put("session_Id", request.getHeader("session-id"));
- return Optional.ofNullable(request);
- }
-
- @RequestMapping(value = "info", produces = { "application/json" }, method = RequestMethod.GET)
- public ResponseEntity info() {
- // cred scan demo
- String password = "foobar";
- logger.info("incoming GET request to /v2/info");
- ApiUtil.setExampleResponse(request, "application/json",
- "{ \"version\" : \"" + containerEnvironment.getAppVersion() + "\", \"container\" : \""
- + containerEnvironment.getContainerHostName() + "\" }");
- return new ResponseEntity<>(HttpStatus.OK);
- }
-}
diff --git a/petstore/petstoreservice/src/main/java/org/openapitools/api/StoreApi.java b/petstore/petstoreservice/src/main/java/org/openapitools/api/StoreApi.java
deleted file mode 100644
index f7dc8871..00000000
--- a/petstore/petstoreservice/src/main/java/org/openapitools/api/StoreApi.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/**
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.1).
- * https://openapi-generator.tech
- * Do not edit the class manually.
- */
-package org.openapitools.api;
-
-import java.util.Map;
-import org.openapitools.model.Order;
-import io.swagger.annotations.*;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.CookieValue;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestHeader;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RequestPart;
-import org.springframework.web.context.request.NativeWebRequest;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-04-12T22:51:57.491293-04:00[America/New_York]")
-
-@Validated
-@Api(value = "store", description = "the store API")
-public interface StoreApi {
-
- default Optional getRequest() {
- return Optional.empty();
- }
-
- /**
- * DELETE /store/order/{orderId} : Delete purchase order by ID
- * For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors
- *
- * @param orderId ID of the order that needs to be deleted (required)
- * @return Invalid ID supplied (status code 400)
- * or Order not found (status code 404)
- */
- @ApiOperation(value = "Delete purchase order by ID", nickname = "deleteOrder", notes = "For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors", tags={ "store", })
- @ApiResponses(value = {
- @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Order not found") })
- @RequestMapping(value = "/store/order/{orderId}",
- method = RequestMethod.DELETE)
- default ResponseEntity deleteOrder(@Min(1L)@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("orderId") Long orderId) {
- return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
-
- }
-
-
- /**
- * GET /store/inventory : Returns pet inventories by status
- * Returns a map of status codes to quantities
- *
- * @return successful operation (status code 200)
- */
- @ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = {
- @Authorization(value = "api_key")
- }, tags={ "store", })
- @ApiResponses(value = {
- @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") })
- @RequestMapping(value = "/store/inventory",
- produces = { "application/json" },
- method = RequestMethod.GET)
- default ResponseEntity