-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yml
More file actions
218 lines (213 loc) · 8.04 KB
/
Copy pathopenapi.yml
File metadata and controls
218 lines (213 loc) · 8.04 KB
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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
openapi: 3.0.3
info:
description: |-
This is the specification for the Cheops API.
version: 0.1.0
title: Cheops API - OpenAPI 3.0.3
contact:
url: https://gitlab.com/discovery/cheops
name: Cheops website
license:
name: GNU AGPLv3
url: 'https://www.gnu.org/licenses/agpl-3.0.txt'
servers:
- url: 'http://localhost:{port}/api'
description: Server used for development by the mock server.
variables:
port:
default: '8079'
description: The port to use for the mock server.
tags:
- name: exec
description: Executing operation
- name: show
description: Visualizing the status of a resource
paths:
/exec/{id}:
post:
tags:
- exec
summary: Execute a command
description: This endpoint sends an operation to a Cheops node. Cheops will organize all operations to come up with a convergent list on all nodes, make sure all the operations that need to be run on each node are run, synchronize the replies, and return the replies to the caller. Times out after 30 seconds
operationId: exec
parameters:
- $ref: '#/components/parameters/paramsResourceId'
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
required:
- command
- sites
- type
properties:
command:
type: string
description: Command used to create resource
example: kubectl apply {recipe.yml}
sites:
type: string
description: List of nodes where resource must exist, separated by '&'
example: site12&site23
type:
type: string
description: Type of resource as defined in Resolutions Matrix
example: apply
config:
type: object
description: JSON document specifying all the configuration related to the resource, especially the Resolutions Matrix
properties:
ResolutionMatrix:
type: array
description: a list of Resolutions
items:
type: object
description: a Resolution between two types of commands
required:
- Before
- After
- Result
properties:
Before:
type: string
description: an operation type as defined by the user
After:
type: string
description: an operation type as defined by the user
Result:
type: string
enum:
- "take-one"
- "take-both-any-order"
- "take-both-keep-order"
- "take-both-reverse-order"
description: see CONSISTENCY.md for details on the values
files:
type: array
description: files necessary for the command to run, stored as base64-encoded strings
items:
type: string
format: byte # base64-encoded file contents
responses:
200:
description: Responses of tentative synchronization and execution. Cheops will give a reply for each node, whether it is successful, failed or unknown because of a timeout. Each reply is a JSON object flattened to a single line. All replies are separated by a newline. The model shown here is one of a single reply.
content:
application/json:
schema:
type: object
description: A single reply from a node. Other replies will be added at the end, separated by a newline
properties:
Locations:
type: array
description: The list of sites where the resource exists
example: ["site1", "site2"]
items:
type: string
description: A site address
Site:
type: string
description: The site where the command was executed
example: site2
RequestId:
type: string
description: the id given by Cheops to this request
example: NTEOHRCNKNEORUHROCHU
ResourceId:
type: string
description: the id of the resource
example: my-deployment
Status:
type: string
description: status of the execution of the command.
enum:
- OK
- KO
- TIMEOUT
Cmd:
type: object
required:
- Input
properties:
Input:
type: string
description: the command that was run
example: kubectl apply {recipe.yml}
Type:
type: string
description: a field to designate the object type. Always REPLY
enum:
- REPLY
400:
$ref: '#/components/responses/badRequest'
default:
$ref: '#/components/responses/unexpected'
/show/{id}:
post:
tags:
- show
summary: Displays the current state of a resource
description: This endpoint is used to check the status of a resource on all nodes. The operator sends a command, typically a preview command. Cheops sends that command to be executed on all nodes and returns the aggregated result
operationId: show
parameters:
- $ref: '#/components/parameters/paramsResourceId'
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
required:
- command
- sites
properties:
command:
type: string
description: Command used to create resource
example: kubectl get deployment DEPLOYMENT-ID
sites:
type: string
description: List of nodes where resource must exist, separated by '&'
example: site12&site23
responses:
200:
description: Current status of the resource on each site
content:
application/json:
schema:
type: object
properties:
additionalProperties:
type: object
properties:
Status:
description: The result of running the command
type: string
enum:
- OK
- KO
- TIMEOUT
Output:
type: string
description: the output of the command
example:
400:
$ref: '#/components/responses/badRequest'
default:
$ref: '#/components/responses/unexpected'
components:
parameters:
paramsResourceId:
name: id
in: path
required: true
description: Id of the resource.
schema:
type: string
example: 746f746f2e747874a
responses:
badRequest:
description: Bad Request
unexpected:
description: Unexpected internal error.