-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathswagger.yaml
142 lines (142 loc) · 4.5 KB
/
swagger.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
openapi: 3.0.1
info:
title: Performance Benchmark Stacks
description: Base capabilities for performance scenarios, each operation should be implemented in each stack
version: 1.0.0
tags:
- name: basic
description: Basic operations without external resources, only cpu processing
- name: processing
description: Operations which only do heavy processing, every operation should implement this behaviour > should be allowed for a percentage of requests, and should run a loop for a delay time, when delay time is 0 loop should enter a single time
paths:
/status:
get:
tags:
- basic
summary: Simple rest api without interactions or processing
operationId: status
responses:
200:
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
500:
description: Error response could be 4xx or 5xx status code
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/hash:
get:
tags:
- processing
summary: Service that should internally generate an uuid and hash it using sha256 as hex. This task should be allowed for a percentage of requests, and should run a loop for a delay time
operationId: sha256
parameters:
- name: percentage
in: query
description: percentage of requests that should do processing, default 100
- name: delay
in: query
description: delay time to run the processing loop, default 0
responses:
200:
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/LoopStatus'
500:
description: Error response could be 4xx or 5xx status code
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/crypt:
get:
tags:
- processing
summary: Service that should internally generate an uuid and encrypt it using bcrypt with 10 rounds, then should validate the clear uuid with the encrypted value.
operationId: sha256
parameters:
- name: percentage
in: query
description: percentage of requests that should do processing, default 100
- name: delay
in: query
description: delay time to run the processing loop, default 0
responses:
200:
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/LoopStatus'
500:
description: Error response could be 4xx or 5xx status code
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/prime/{top}:
get:
tags:
- processing
summary: Service that calculates the prime numbers until a top number.
operationId: primes
parameters:
- name: percentage
in: query
description: percentage of requests that should do processing, default 100
- name: delay
in: query
description: delay time to run the processing loop, default 0
- name: top
in: path
description: top number for calculating prime numbers
responses:
200:
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/LoopStatus'
500:
description: Error response could be 4xx or 5xx status code
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
components:
schemas:
Status:
required:
- status
type: object
properties:
status:
type: string
example: OK
LoopStatus:
required:
- status
- applied
- times
type: object
properties:
status:
type: string
example: OK
applied:
type: boolean
example: true
description: indicates if the current request has been in the percentage
times:
type: number
example: 1000
description: amount of loops executed in the delay time
Error:
description: No defined body response is required
type: object