-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi.yaml
201 lines (195 loc) · 4.74 KB
/
openapi.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
openapi: "3.0.0"
info:
version: 0.1.0
title: Loadbalancer API
description: API to configure a loadbalancer
contact:
name: Sven Haardiek
email: sven@haardiek.de
license:
name: MIT
url: https://choosealicense.com/licenses/mit/
security:
- BearerAuth: []
paths:
/healthz:
get:
description: Health check endpoint
operationId: getHealth
responses:
'200':
description: Everything OK
application/json:
schema:
type: string
default:
description: unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/error'
/loadbalancers:
get:
description: Get all loadbalancer
operationId: GetLoadbalancers
responses:
'200':
description: List of all loadbalancers
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/loadbalancer'
default:
description: unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/error'
/loadbalancers/{name}:
get:
description: Get loadbalancer by Name
operationId: GetLoadbalancer
parameters:
- $ref: '#/components/parameters/name'
responses:
'200':
description: Named loadbalancer
content:
application/json:
schema:
$ref: '#/components/schemas/loadbalancer'
default:
description: unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/error'
put:
description: Create a new loadbalancer
operationId: CreateLoadBalancer
parameters:
- $ref: '#/components/parameters/name'
requestBody:
description: Create a new loadbalancer
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/loadbalancer'
responses:
'201':
description: Named loadbalancer
content:
application/json:
schema:
$ref: '#/components/schemas/loadbalancer'
default:
description: unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/error'
delete:
description: Delete a loadbalancer
operationId: DeleteLoadBalancer
parameters:
- $ref: '#/components/parameters/name'
responses:
'200':
description: Deleted Loadbalancer
default:
description: unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/error'
components:
securitySchemes:
BearerAuth:
type: http
scheme: bearer
parameters:
name:
name: name
in: path
description: Name of the loadbalancer
required: true
schema:
type: string
minLength: 1
example: 9b6ce066-d7c1-4cd5-bf6f-0f363f9084fb
schemas:
loadbalancer:
type: object
required:
- name
- config
- status
properties:
name:
type: string
readOnly: true
example: 9b6ce066-d7c1-4cd5-bf6f-0f363f9084fb
config:
$ref: '#/components/schemas/config'
status:
$ref: '#/components/schemas/status'
config:
type: object
required:
- frontends
properties:
frontends:
type: array
items:
$ref: '#/components/schemas/frontend'
frontend:
type: object
required:
- port
- backend
properties:
port:
type: integer
minimum: 1
maximum: 65536
example: 1337
backend:
$ref: '#/components/schemas/backend'
backend:
type: object
required:
- server
properties:
health_check_node_port:
type: integer
server:
type: array
items:
type: string
pattern: '^.+:[0-9]+$'
example: 1.2.3.4:1337
status:
type: object
readOnly: true
properties:
ip:
type: string
example: 1.2.3.4
hostname:
type: string
example: hostname.example.com
error:
type: object
required:
- code
- message
properties:
code:
type: integer
example: 404
message:
type: string
example: "Not Found"