Skip to content

Commit 3d24069

Browse files
author
Enda Phelan
committed
chore: add common OpenAPI components
1 parent cdc08ae commit 3d24069

File tree

6 files changed

+349
-41
lines changed

6 files changed

+349
-41
lines changed

.openapi/components.yaml

Lines changed: 258 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,258 @@
1+
schemas:
2+
ObjectReference:
3+
type: object
4+
properties:
5+
id:
6+
type: string
7+
kind:
8+
type: string
9+
href:
10+
type: string
11+
List:
12+
required:
13+
- kind
14+
- page
15+
- size
16+
- total
17+
- items
18+
type: object
19+
properties:
20+
kind:
21+
type: string
22+
page:
23+
type: integer
24+
size:
25+
type: integer
26+
total:
27+
type: integer
28+
Error:
29+
allOf:
30+
- $ref: "#/schemas/ObjectReference"
31+
- type: object
32+
properties:
33+
code:
34+
type: string
35+
reason:
36+
type: string
37+
operation_id:
38+
type: string
39+
ErrorList:
40+
allOf:
41+
- $ref: "#/schemas/List"
42+
- type: object
43+
properties:
44+
items:
45+
type: array
46+
items:
47+
$ref: "#/schemas/Error"
48+
49+
VersionMetadata:
50+
allOf:
51+
- $ref: "#/schemas/ObjectReference"
52+
- type: object
53+
example:
54+
kind: "APIVersion"
55+
id: "v1"
56+
href: "/api/kafkas_mgmt/v1"
57+
collections:
58+
- id: "kafkas"
59+
href: "/api/kafkas_mgmt/v1/kafkas"
60+
kind: "KafkaList"
61+
properties:
62+
collections:
63+
type: array
64+
items:
65+
allOf:
66+
- $ref: "#/schemas/ObjectReference"
67+
68+
RangeQuery:
69+
type: object
70+
properties:
71+
metric:
72+
type: object
73+
additionalProperties:
74+
type: string
75+
values:
76+
type: array
77+
items:
78+
$ref: '#/schemas/values'
79+
80+
CloudProviderList:
81+
allOf:
82+
- $ref: "#/schemas/List"
83+
- type: object
84+
example:
85+
kind: "CloudProviderList"
86+
page: "1"
87+
size: "1"
88+
total: "1"
89+
item:
90+
$ref: '#/examples/CloudProviderExample'
91+
properties:
92+
items:
93+
type: array
94+
items:
95+
allOf:
96+
- $ref: "#/schemas/CloudProvider"
97+
CloudRegionList:
98+
allOf:
99+
- $ref: "#/schemas/List"
100+
- type: object
101+
example:
102+
kind: "CloudRegionList"
103+
page: "1"
104+
size: "1"
105+
total: "1"
106+
item:
107+
$ref: '#/examples/CloudRegionExample'
108+
properties:
109+
items:
110+
type: array
111+
items:
112+
allOf:
113+
- $ref: "#/schemas/CloudRegion"
114+
CloudProvider:
115+
description: 'Cloud provider.'
116+
properties:
117+
kind:
118+
description: 'Indicates the type of this object. Will be ''CloudProvider'' link.'
119+
type: string
120+
id:
121+
description: 'Unique identifier of the object.'
122+
type: string
123+
display_name:
124+
description: 'Name of the cloud provider for display purposes.'
125+
type: string
126+
name:
127+
description: 'Human friendly identifier of the cloud provider, for example `aws`.'
128+
type: string
129+
enabled:
130+
description: 'Whether the cloud provider is enabled for deploying an OSD cluster.'
131+
type: boolean
132+
required:
133+
- enabled
134+
CloudRegion:
135+
description: 'Description of a region of a cloud provider.'
136+
properties:
137+
kind:
138+
description: 'Indicates the type of this object. Will be ''CloudRegion''.'
139+
type: string
140+
id:
141+
description: 'Unique identifier of the object.'
142+
type: string
143+
display_name:
144+
description: 'Name of the region for display purposes, for example `N. Virginia`.'
145+
type: string
146+
enabled:
147+
description: 'Whether the region is enabled for deploying an OSD cluster.'
148+
type: boolean
149+
default: false
150+
required:
151+
- enabled
152+
153+
values:
154+
type: object
155+
properties:
156+
Timestamp:
157+
type: integer
158+
format: int64
159+
deprecated: true
160+
timestamp:
161+
type: integer
162+
format: int64
163+
Value:
164+
type: number
165+
format: double
166+
deprecated: true
167+
value:
168+
type: number
169+
format: double
170+
required:
171+
- value
172+
173+
parameters:
174+
id:
175+
name: id
176+
description: The ID of record
177+
schema:
178+
type: string
179+
in: path
180+
required: true
181+
duration:
182+
name: duration
183+
in: query
184+
description: The length of time in minutes for which to return the metrics
185+
required: true
186+
schema:
187+
type: integer
188+
format: int64
189+
default: 5
190+
minimum: 1
191+
maximum: 4320
192+
examples:
193+
duration:
194+
value: 5
195+
interval:
196+
name: interval
197+
in: query
198+
description: The interval in seconds between data points
199+
required: true
200+
schema:
201+
type: integer
202+
format: int64
203+
default: 30
204+
minimum: 1
205+
maximum: 10800
206+
examples:
207+
interval:
208+
value: 30
209+
filters:
210+
name: filters
211+
in: query
212+
description: List of metrics to fetch. Fetch all metrics when empty. List entries are internal metric names.
213+
schema:
214+
type: array
215+
items:
216+
type: string
217+
default: []
218+
page:
219+
name: page
220+
in: query
221+
description: Page index
222+
required: false
223+
schema:
224+
type: string
225+
examples:
226+
page:
227+
value: "1"
228+
size:
229+
name: size
230+
in: query
231+
description: Number of items in each page
232+
required: false
233+
schema:
234+
type: string
235+
examples:
236+
size:
237+
value: "100"
238+
239+
securitySchemes:
240+
Bearer:
241+
scheme: bearer
242+
bearerFormat: JWT
243+
type: http
244+
245+
examples:
246+
CloudProviderExample:
247+
value:
248+
kind: "CloudProvider"
249+
id: "aws"
250+
name: "aws"
251+
display_name: "Amazon Web Services"
252+
enabled: true
253+
CloudRegionExample:
254+
value:
255+
kind: "CloudRegion"
256+
id: "us-east-1"
257+
display_name: "US East, N. Virginia"
258+
enabled: true

.openapi/components/schemas.yaml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
ObjectReference:
2+
type: object
3+
properties:
4+
id:
5+
type: string
6+
kind:
7+
type: string
8+
href:
9+
type: string
10+
11+
List:
12+
required:
13+
- kind
14+
- page
15+
- size
16+
- total
17+
- items
18+
type: object
19+
properties:
20+
kind:
21+
type: string
22+
page:
23+
type: integer
24+
size:
25+
type: integer
26+
total:
27+
type: integer
28+
29+
Error:
30+
required:
31+
- id
32+
- kind
33+
- href
34+
- code
35+
- reason
36+
allOf:
37+
- $ref: "#ObjectReference"
38+
- type: object
39+
properties:
40+
code:
41+
type: string
42+
reason:
43+
type: string
44+
operation_id:
45+
type: string
46+
47+
ErrorList:
48+
allOf:
49+
- $ref: "#List"
50+
- type: object
51+
properties:
52+
items:
53+
type: array
54+
items:
55+
$ref: "#Error"
56+
57+
VersionMetadata:
58+
allOf:
59+
- $ref: "#ObjectReference"
60+
- type: object
61+
example:
62+
kind: "APIVersion"
63+
id: "v1"
64+
href: "/api/kafkas_mgmt/v1"
65+
collections:
66+
- id: "kafkas"
67+
href: "/api/kafkas_mgmt/v1/kafkas"
68+
kind: "KafkaList"
69+
properties:
70+
collections:
71+
type: array
72+
items:
73+
allOf:
74+
- $ref: "#ObjectReference"
75+
76+
ServiceStatus:
77+
description: Schema for the service status response body
78+
example:
79+
kafkas:
80+
max_capacity_reached: true
81+
type: object
82+
properties:
83+
kafkas:
84+
description: The Kafka resource api status
85+
type: object
86+
required:
87+
- max_capacity_reached
88+
properties:
89+
max_capacity_reached:
90+
description: Indicates whether we have reached Kafka maximum capacity
91+
type: boolean

antora-playbook.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

antora.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

modules/ROOT/nav.adoc

Lines changed: 0 additions & 1 deletion
This file was deleted.

modules/ROOT/pages/index.adoc

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)