-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.yaml
112 lines (112 loc) · 2.9 KB
/
api.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
apiVersion: gateway.kusk.io/v1alpha1
kind: API
metadata:
name: hello-world
spec:
fleet:
name: kusk-gateway-envoy-fleet
namespace: kusk-system
spec: |
openapi: 3.0.0
info:
title: simple-api
version: 0.4.0
x-kusk:
cors:
origins:
- "*"
methods:
- GET
paths:
/hello:
x-kusk:
upstream:
service:
name: hello-svc
namespace: default
port: 8080
rewrite:
pattern: "^/hello"
substitution: "/"
get:
responses:
'200':
description: A simple hello world!
content:
text/plain:
schema:
type: string
example: Hello from a mocked response!
/foo:
x-kusk:
upstream:
service:
name: foo-svc
namespace: default
port: 8080
rewrite:
pattern: "^/foo"
substitution: "/"
get:
responses:
'200':
description: A simple foo bar!
content:
text/plain:
schema:
type: string
example: Bar from a mocked response!
/statuscode/{code}:
get:
x-kusk:
upstream:
host:
hostname: mocktarget.apigee.net
port: 80
parameters:
- name: "code"
in: "query"
description: "Desired response status code."
required: true
schema:
type: "string"
/users:
get:
x-kusk:
upstream:
host:
hostname: jsonplaceholder.typicode.com
port: 80
summary: "View personalized greeting"
operationId: "View personalized greeting"
description: "View a personalized greeting for the specified or guest user."
parameters:
- name: "user"
in: "query"
description: "Your user name."
required: false
schema:
type: "string"
responses:
"200":
description: "Success"
/users/{id}:
get:
x-kusk:
upstream:
host:
hostname: jsonplaceholder.typicode.com
port: 80
summary: "View personalized greeting"
operationId: "View personalized greeting"
description: "View a personalized greeting for the specified or guest user."
parameters:
- name: "id"
in: "query"
description: "user id"
required: true
schema:
type: "integer"
responses:
"200":
description: "Success"