Skip to content

Commit

Permalink
Add deployment dir and params scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
renuka-fernando committed May 3, 2021
1 parent 3580f3c commit 4ee90ce
Show file tree
Hide file tree
Showing 4 changed files with 242 additions and 3 deletions.
3 changes: 0 additions & 3 deletions scenarios/scenario-1-target-endpoint/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@

openapi: 3.0.0
servers:
# Added by API Auto Mocking Plugin
- description: Localhost
url: http://localhost:8080
- description: SwaggerHub API Auto Mocking
url: https://virtserver.swaggerhub.com/renuka-fernando/Products/v1
info:
description: This is a sample backend - products
version: v1
Expand Down
24 changes: 24 additions & 0 deletions scenarios/scenario-2-endpoint-cert-override/api_cr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright (c) 2021 WSO2 Inc. (http:www.wso2.org) All Rights Reserved.
#
# WSO2 Inc. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http:www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

apiVersion: wso2.com/v1alpha2
kind: API
metadata:
name: cert-products
spec:
certsValues: cert-products-certs
paramsValues: cert-products-params
swaggerConfigMapName: cert-products-cm
34 changes: 34 additions & 0 deletions scenarios/scenario-2-endpoint-cert-override/params_cm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright (c) 2021 WSO2 Inc. (http:www.wso2.org) All Rights Reserved.
#
# WSO2 Inc. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http:www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

apiVersion: v1
kind: ConfigMap
metadata:
name: cert-products-params
data:
params.yaml: |
environments:
- name: production
configs:
endpoints:
production:
url: https://products-certs
sandbox:
url: https://products-certs
certs:
- hostName: products-certs
alias: products-certs
path: products-certs.crt
184 changes: 184 additions & 0 deletions scenarios/scenario-2-endpoint-cert-override/swagger.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
# Copyright (c) 2021 WSO2 Inc. (http:www.wso2.org) All Rights Reserved.
#
# WSO2 Inc. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http:www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

openapi: 3.0.0
servers:
- description: Localhost
url: http://localhost:8443
info:
description: This is a sample backend - products
version: v1
title: Cert-Products
contact:
email: [email protected]
tags:
- name: product
description: Products of store
x-wso2-production-endpoints:
urls:
- https://products
type: http
x-wso2-sandbox-endpoints:
urls:
- https://products
type: http
x-wso2-basePath: /cert-products-api/v1
paths:
/products:
get:
tags:
- product
summary: All Products
description: All products of the store
responses:
200:
description: Successful operation
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Product"
post:
tags:
- product
summary: Add Product
description: Add new products to the store
requestBody:
content:
applicatoin/json:
schema:
$ref: "#/components/schemas/Product"

responses:
200:
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/Product"
400:
description: Invalid Product
/products/{id}:
get:
tags:
- product
summary: Find product by ID
description: Returns a single product
parameters:
- name: id
in: path
description: ID of product to return
required: true
schema:
type: integer
format: int64
example: 3
responses:
200:
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/Product"
400:
description: Invalid ID supplied
404:
description: Product not found
put:
tags:
- product
summary: Update product by ID
description: Update a product
parameters:
- name: id
in: path
description: ID of product to update
required: true
schema:
type: integer
format: int64
example: 3
requestBody:
content:
applicatoin/json:
schema:
$ref: "#/components/schemas/Product"
responses:
200:
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/Product"
400:
description: Invalid ID supplied
404:
description: Product not found
delete:
tags:
- product
summary: Delete product by ID
description: Delete a product
parameters:
- name: id
in: path
description: ID of product to delete
required: true
schema:
type: integer
format: int64
example: 3
responses:
200:
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/Result"
400:
description: Invalid ID supplied
404:
description: Product not found
components:
schemas:
Product:
type: object
required:
- name
- category
- price
properties:
id:
type: integer
format: int64
example: 3
name:
type: string
example: ABC Smart TV
category:
type: string
example: Electronics
price:
type: integer
format: int64
example: 39999
Result:
type: object
properties:
result:
type: string
example: success

0 comments on commit 4ee90ce

Please sign in to comment.